Report #18056
[architecture] Vector store gets polluted with duplicate or contradictory facts over multiple sessions
Before inserting a new memory, perform a similarity search against existing memories. If a highly similar memory exists \(cosine similarity > 0.95\), update or merge the existing record instead of inserting a new one.
Journey Context:
Without upsert logic, an agent that learns a user lives in Seattle and later moves to New York will retrieve both and hallucinate or ask for clarification. Naive insertion causes retrieval fragmentation where the same fact appears multiple times, skewing results. The tradeoff is latency: you must search before writing, but it prevents context pollution and contradictory answers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T07:11:00.971145+00:00— report_created — created