Context EngineeringPersistent state and memoryStaff
How should a memory extractor distinguish hypothetical statements from durable user facts?
By Amit Kumar3 min readWorked answer includedReviewed 28 Sept 2026
The question
Interview question
A user asks what would change if they moved to London next year. A memory extractor stores residence=London, and a later unrelated answer assumes that residence. Design source and modality metadata, promotion gates and later-use checks. Explain how to test false promotions and repair summaries that already copied the hypothetical as fact.
Draft your approach first
Take a few minutes before you read the answer. Name the constraint that matters most, the failure you are designing for and how you would know it worked.
Reveal the worked answerWorked answer
A conditional question supplies a premise for reasoning without asserting that the premise is true. Similar traps are “I might,” “my colleague lives in,” quoted text, and a tool result that merely suggests an address. I would first recover the exact message span that caused the memory write and its surrounding turns. Was this an explicit user assertion, a question, a conditional, a quotation, or an inference made by the assistant? The system needs to preserve what kind of statement was made, not only how confidently an extractor recognized its words.
I would keep conversation evidence separate from durable personal facts. An extraction candidate should carry the subject, predicate, value, original quote and turn ID, speaker, modality or conditional scope, event time, and whether the user explicitly asserted it. The promotion policy can accept “I moved to London last week” as a candidate for durable residence, while keeping “if I move” in episodic conversation history as a hypothetical. For consequential facts, ask the user or rely on an authoritative profile field before acting. Even a direct assertion can become stale, so provenance and a way to correct it still matter.
If someone says, “Just use an LLM to classify hypotheticals,” I would use that classifier as a gate, then measure its false promotions with adversarial pairs that differ by a few words. Include counterfactual planning, other people's biographies, negation, sarcasm and corrections. Inspect the write decision and the later action, not only extraction accuracy. A small false positive rate can compound when a long-lived fact is injected into many future prompts. The safer default for uncertain candidates is no durable write, with a way for the user to confirm a useful memory.
For example, store a conversation event saying that the user explored a possible future move, with its original quoted span and conditional scope. Do not populate the current-residence field. If the user later says they completed the move, that is a new assertion with its own observed time, subject and verification needs. It may support a profile update under the product’s policy, while the earlier hypothetical remains historical conversation evidence.
A classifier is useful only if its output controls a real write boundary. Test “I moved,” “if I move,” “I did not move” and “my colleague moved” through extraction, persistence and a later prompt build. Count false durable writes separately from harmless temporary candidate records. A user-visible confirmation can resolve consequential ambiguity, while routine uncertain candidates can simply remain unpromoted.
At read time, do not quietly turn a conversation snippet into a personal profile. Show the provenance to the assistant and give a conditional statement conditional status. If wrong facts have already propagated into summaries, invalidate descendants and correct the user-visible profile. Research on provenance-aware agent memory motivates keeping events and curated facts distinguishable. The classification and promotion rules here are a design proposal, not a rule established by that paper. The memory expired yesterday. Why does the agent still act on it today? is about a valid temporary fact outliving its expiry. Here the fact was never asserted in the first place.
Related questions
Keep practising context engineering
Follow another question in this area, or search the complete library.
Get my essays on AI engineering and distributed systems by email. Subscribe to ArchCrux