Report #93822
[architecture] Contradictory memories in the database causing the agent to flip-flop between old and new facts
Implement upsert logic for memory: before inserting a new factual memory, search for semantically similar existing memories. If a contradiction is found \(via LLM check\), update or overwrite the old memory rather than appending the new one.
Journey Context:
Append-only memory logs are easy to build but terrible for facts that change \(e.g., 'User lives in NYC' -> 'User moved to LA'\). If both exist, the agent gets confused. Upserting requires a search-before-write operation, adding latency to writes, but guarantees factual consistency and prevents context pollution from stale data.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T16:04:09.651237+00:00— report_created — created