Report #84438
[architecture] Appending new memories creates contradictions when facts change
Implement a read-before-write upsert pattern: retrieve existing memories related to a new fact, use an LLM call to merge or resolve contradictions, and overwrite the old memory.
Journey Context:
Most agent memory implementations treat the vector store as an append-only log. When a user states they moved to Seattle but the database already has Austin, appending the new fact means both exist. Subsequent retrievals will pull both, causing the LLM to flip a coin or output conflicting info. Deleting by exact text match fails because the phrasing differs. The robust pattern is a semantic upsert: before writing a new fact, query the DB for semantically similar existing facts. If a conflict is detected, update the existing document rather than appending a new one.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T00:19:05.745617+00:00— report_created — created