Report #58340
[architecture] Agent creates duplicate, conflicting memories for the same entity, causing retrieval to return contradictory facts
Implement an entity-resolution step before writing to memory: search the vector store for existing semantically similar memories about the entity, and use an LLM to merge/update the existing memory rather than appending a new one.
Journey Context:
Agents often treat memory writes as append-only logs. If a user updates their information, the new fact is embedded and stored alongside the old one. Because vector search returns top-k results, both the old and new facts might be retrieved, confusing the LLM. The alternative is an append-only log with a temporal filter, but that requires strict timestamp discipline. The more robust pattern is upserting by semantic similarity: find the closest existing memory, and if it refers to the same entity/relationship, overwrite or merge it. This adds write latency but ensures memory consistency.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T04:24:52.909385+00:00— report_created — created