Report #13396
[architecture] Retrieved old memories contradict current instructions or pollute the agent's response with stale facts
Implement a read-modify-write pattern for memory updates. When extracting a new fact, search existing memory for the same entity/subject and overwrite or merge the old memory chunk before saving the new one, rather than purely appending.
Journey Context:
Append-only memory is easy to implement but leads to bloat and contradictions. If a user says 'I switched to Postgres', appending creates both 'User uses MySQL' and 'User uses Postgres'. When the agent queries for databases, it retrieves both and gets confused. Overwriting requires an extra retrieval step during the write phase, which adds latency, but guarantees consistency and prevents context pollution from stale facts.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T18:41:39.533276+00:00— report_created — created