Identify the failure when persistent memory and fresh retrieval disagree about a fact
The model treats memory and retrieval as plain text; outcome is determined by position, recency, and any explicit precedence rule you write, not by source type.
Imagine a kid doing homework who gets two answers to the same question: one from a sticky note on the fridge (older, but written by a parent) and one from a textbook just opened on the desk. Nobody told the kid which to trust. The kid will probably go with whatever they read last or whichever is louder. That is exactly what the model does when persistent memory says one thing and a fresh retrieved document says another. The model has no built-in rule that 'retrieval beats memory' or the reverse. If you want a specific answer when they disagree, you have to write the rule down at the top of the prompt: 'when these two disagree, do this'.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Persistent memory and freshly retrieved context are both staples of 2026 LLM systems. A personal assistant remembers your project; a RAG layer pulls today's documentation. When they agree, the model is in good shape. When they disagree, the model is forced to choose, and many teams discover that the choice it makes is not the choice they expected.
The bug is usually classified as a hallucination but it is structural. The model has no signal that one block is 'memory' and the other is 'retrieval'; they are both text. Outcome therefore depends on three mechanical factors, none of which are about source type.
The three actual drivers
The model's choice between conflicting sources is determined by three things, none of them source labels.
Position. A long context has a strong U-shape attention curve, content at the very top and very bottom is attended to more than content in the middle (the well-known lost-in-the-middle effect). If the persistent memory sits at the top of the prompt and the retrieved chunk sits in the middle, the memory has a structural advantage that has nothing to do with the kind of source it is.
Recency. In a multi-turn conversation, content that arrived recently relative to the user's current question has more salience. A memory block that was injected on this turn beats a memory block that was injected three turns ago. A retrieved chunk freshly added beats an older chunk still hanging around in the conversation.
Explicit precedence. A clear rule in the system prompt,'When persistent memory and retrieved documentation conflict, prefer the documentation and quote it', overrides the first two effects on instruction-following models. Modern frontier models follow this kind of rule reliably when it is stated up front, which is exactly why context engineering treats explicit precedence as a primary tool.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- ChatGPT's memory feature explicitly tells the model how to reconcile with web search results when they disagree, surfaced in OpenAI's published system-prompt patterns.
- Cursor's agent mode includes precedence between the user's persistent rules, the project-level context, and freshly read files; conflicts are resolved by stated rule.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow would you build an eval set for conflict resolution?
Synthesize adversarial pairs where memory and retrieval disagree on a specific fact, score whether the model followed the declared precedence rule, and track drift over model versions.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Assuming the model has an implicit rule that 'fresh retrieval beats stored memory', then being surprised when it confidently quotes the stale memory because that copy was nearer the user turn.
60 second bullets to scan on the way to the call.
State that the model has no built-in preference between memory and retrieval
Name the three levers that drive outcome in practice
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.