Report #55237
[architecture] Agent writes duplicate or highly overlapping memories on every turn
Before writing a new memory to the persistent store, perform a similarity search against existing memories. If a highly similar memory exists \(cosine similarity > 0.95\), update or merge the existing memory rather than inserting a new one.
Journey Context:
When instructed to 'remember important things', LLMs will often extract and save the same fact repeatedly across multiple turns \(e.g., 'User prefers React', 'User likes React', 'User uses React'\). This pollutes the retrieval space, causing the same fact to occupy multiple top-K slots and drown out other diverse context. Upserting/merging based on similarity prevents write amplification and keeps the retrieval pool diverse.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T23:12:24.314890+00:00— report_created — created