All answers

Agent memory

What happens when an AI agent's memory contains conflicting information?

Alexandru Lupascu, CTO & Co-founder · Updated

When an AI agent's memory contains conflicting information, the model usually receives both versions in its context and has no built-in way to tell which is current or better supported, so it may act on either. Anthropic's Claude Code documentation says the same of instruction files: "if two instructions contradict each other, Claude may pick one arbitrarily." A bigger context window does not fix this. What helps is a step before the model call that marks superseded facts, keeps each fact's source and shows real disagreements openly instead of resolving them silently.

Why does agent memory end up with conflicting facts?

Agent memory collects conflicts because facts change while old notes stay. A price, an owner or a policy gets updated in one system, and the earlier version remains in a note, a summary or a document. Conflicts also come from several agents and people writing to the same store, and from documents that simply disagree. Summaries add risk: Anthropic's context engineering guide warns that "overly aggressive compaction can result in the loss of subtle but critical context whose importance only becomes apparent later." The original RAG paper (Lewis et al., 2020) listed "providing provenance for their decisions and updating their world knowledge" as open problems for models that store facts in their parameters. Moving facts into a memory that agents write to does not solve them; it makes them the memory's job.

What does a stale fact do to an agent's answer?

A stale fact turns a working retrieval system into a wrong answer. Lewis et al. tested this with 82 world leaders who changed between 2016 and 2018: their RAG model answered 70% correctly with a 2016 index for 2016 leaders and 68% with a 2018 index for 2018 leaders, but only 12% and 4% when the index and the question came from different years. The model and retriever were the same in every run; only the age of the memory changed. When old and new versions sit side by side, the model has no rule for choosing: for a user rule and a project rule that conflict, Claude Code's documentation says Claude "may follow either one."

How do you handle conflicting information in agent memory?

Track sources, retire old versions and surface what still disagrees.

  1. Store provenance with every memory: source, author and time. The "Generative Agents" paper (Park et al., 2023) stores each reflection "including pointers to the memory objects that were cited."
  2. Supersede instead of append: when a fact changes, mark the old entry as replaced so retrieval can skip it.
  3. Expire what nobody uses. Anthropic's memory tool documentation advises: "Periodically delete memory files that haven't been accessed in a long time."
  4. Audit instruction files. Claude Code's /doctor prompt-audit looks for files that contradict each other and proposes edits.
  5. When both versions may be true, show both with sources and let the agent or a person decide.
  6. Log what the agent saw on each turn, so you can trace a wrong action to its source. See how to audit what an AI agent saw and did.

How does elephant.broker handle sources that disagree?

elephant.broker flags disagreement instead of hiding it: when two sources conflict, both are placed in the agent's context and weighed by proof. Before each turn, the runtime's rank-and-prune step keeps current, verified context and drops stale or duplicate facts, and the research paper behind the runtime (arXiv 2603.25097) describes "a four state evidence verification model". Every read, placement, write-back and approval is recorded against the actions taken, so you keep a record of why the agent saw what it saw. elephant.broker reports on its website +36% better accuracy, with stale-state errors falling from 47% to 11%. That is elephant.broker's own reported result, not an independent or head-to-head test. Related: how to reduce hallucinations in AI agents and how multiple agents share memory.

Sources

Product details come from each vendor's public documentation as viewed on 2026-10-28 and may have changed. Product names are trademarks of their respective owners; elephant.broker is not affiliated with them.