All chapters
  1. Start hereMemory is what you keep. A checkpoint is where you stopped
  2. Memory · 1The stateless request: why anything has to be stored at all
  3. Memory · 2Five kinds of memory: working, episodic, semantic, procedural and preference
  4. Memory · 3Conversation history, summaries, retrieval and durable facts
  5. Memory · 4Files as memory in coding agents: instructions, journals, artifacts and checkpoints
  6. Memory · 5Database stores: tables, JSON, documents, objects and vectors
  7. State · 6Run identity: run_id, thread_id, trace_id, correlation_id and task_id
  8. State · 7State machines, checkpoints, event sourcing and where replay must stop
  9. State · 8Failure and resume: idempotency keys, retry policy and the exactly-once illusion
  10. State · 9The transactional outbox: side effects, compensation and deduplication
  11. Policy · 10Memory write policy: extraction, confidence, provenance, expiry and deletion
  12. Policy · 11Retrieval and ranking: relevance, recency, salience and scope
  13. Policy · 12Shared memory between agents: consistency, isolation, ownership and races
  14. Policy · 13Security: tenant separation, personal data, secrets, consent and retention
  15. Practice · 14Evaluation: memory correctness, stale facts, contamination and recovery tests
  16. Practice · 15Frameworks and standards: what each one stores for you
  17. Practice · 16The insurance lab: one run that fails, resumes and remembers, end to end
  18. Practice · 17Advanced: migration, conflict resolution, forgetting, summary drift and disaster recovery
  19. ReferenceGlossary
  20. AboutAbout this site and its sources
Memory · 3

Conversation history, summaries, retrieval and durable facts

Four ways to carry the past forward, what each one loses, and why a summary of what was said is not a record of what is true.

What you will understand
Four ways
Replay the whole history, keep a summary, retrieve passages, or store a durable fact: four ways to carry the past forward.
What each loses
Each way drops something different. A summary is a lossy copy of what was said.
Source of truth
Why a durable fact needs a source and an owner, and which record wins when two disagree.

Submission SUB-1003 arrived without a roof age. The policy fixture's rule R-ROOF-02 says the agent cannot assess a roof of unknown age, so the recommendation is request_info. Over the next week the broker and an assistant exchange twelve messages about the building: the fire alarm, the parking, the tenant, an outbuilding. In the third message the broker writes: "The roof was replaced in 2019, I'll send the invoice."

On day eight someone asks the agent: "What do we know about the roof of SUB-1003?"

Whether the agent can answer depends on how the past was carried forward. If every message was kept and is sent again, the sentence is there, buried in turn 3 of twelve. If only the last four messages are kept, it is gone. If a summary was written, it depends on whether the summarizer thought the roof mattered. If someone stored "roof replaced in 2019" as a fact, it is there, but is it true? The broker promised an invoice and never sent one.

This page compares the four ways and shows what each one loses. It also shows the line this site draws between what was said and what is true. This case is UW-M09, one of this site's own cases. The agent here is a scripted stand-in, so the results on this page show how the mechanism works, not how good any model is.

The four ways, in plain words#

The first way is to keep the conversation history: the full, ordered list of messages, sent back to the model on every call. For example, the twelve messages about SUB-1003, all twelve, every time.

The second way is a summary: a shorter text that someone or something wrote from the history, kept instead of the history. For example: "Broker discussed fire alarm, tenant and roof; invoice pending."

Replacing older history with a summary to make room is called compaction.

The third way is retrieval: keep everything in a store, and at question time fetch only the passages that match the question. For example, the question mentions "roof", so the search returns turn 3 and turn 9, the two messages that mention the roof.

The fourth way is a durable fact: one statement, stored on purpose, with where it came from and who is responsible for it. For example: "Broker states roof replaced in 2019. Source: broker email, turn 3. No document yet."

These four are not rival products. They answer different needs, and a real system often uses all four. The trouble starts when one is used for the job of another.

What each way loses#

Here is the twelve-message exchange in the lab below. Pick a strategy and a question, and see what would be given to the model and whether the needed sentence is still there.

Strategy"When was the roof replaced?""Has the invoice arrived?"Size given to the model
Full historyPresent (turn 3)Present (turn 3 promises it; no later turn delivers it), if the model reads all twelveLargest: all twelve turns
Last 4 turnsLost: turn 3 is outside the windowLost: the promise is outside the windowSmall
SummaryPresent only if the summarizer kept itUsually lost: "pending" is easy to dropSmall
RetrievalPresent: "roof" matches turn 3Partly: "invoice" matches turn 3, but the absence of a later turn is not a passage that can be retrievedSmall
Durable factPresent, with source and statusPresent, if the fact records "no document yet"Smallest

Read the table by row first. Full history keeps everything, and its cost grows with every message: the twelfth call carries all twelve. It also hands the model the job of finding the one sentence that matters among many. A window keeps the size fixed by dropping the oldest messages, and the oldest messages are often where the important facts were stated. A summary keeps the size small and keeps whatever its writer judged important, which is a guess made before anyone knew the question.

Retrieval is good at finding a sentence that exists. It cannot find a sentence that does not exist. "Has the invoice arrived?" is answered by the absence of a delivery, and there is no passage that says "nothing arrived". Retrieval returns the promise and leaves the model to infer the rest.

The durable fact is the smallest and the most precise, and it is the only one of the four that someone decided to keep. That decision is also its risk: a durable fact is exactly as good as the policy that wrote it. The next sections deal with that.

What this is not. This page is about what is kept after a conversation, across calls and days. Choosing, at the moment of one call, which of the kept items go into the model's input and how much room each may take, is context engineering: context.sammuthu.com. Compaction appears on both sites. Here it is a way of keeping the past; there it is an operation on the input.

A summary is a lossy copy of what was said#

The tempting design is to summarize. It is cheap, it fits any size limit, and it reads well. Look closely at what a summary is.

A summary is a new text, written from the history by a model or a person, at one moment. It contains three kinds of loss.

  1. Omission. The writer did not know the future question, so it kept what seemed important then. "Roof replaced in 2019" may survive; "I'll send the invoice" often does not.
  2. Status loss. "The broker says the roof was replaced" can become "the roof was replaced". The words that marked a claim as a claim disappear.
  3. Drift on re-summarizing. When the summary is later summarized again together with new messages, each round compounds the first two. Summary drift is treated on Advanced.

The second loss is the dangerous one. A claim has become a fact without anyone deciding that it should. In UW-M09 that would mean the agent treats the roof age as known, and R-ROOF-02 no longer fires. The recommendation could change from request_info to something else on the strength of an email that promised a document that never came.

Common confusion. "We keep a summary, so we have memory." A summary is a compressed copy of a conversation. It is not a record of what is true, and it has no owner who answers for each statement in it.

A durable fact has a source and an owner#

Compare that with a durable fact. A durable fact is one statement, stored on purpose, with three things attached: where it came from, how far it may be trusted, and when it stops being valid.

In UW-M09 the write policy stores the broker's sentence as follows. The policy is explained on Write policy; here only its result matters. These are the fields of the row the example's store holds after python run_memory.py --case UW-M09, read from its database:

{"memory_id": "MEM-0031", "kind": "semantic", "scope": "submission:SUB-1003",
 "subject": "roof_replaced_year",
 "text": "The broker states the roof was replaced in 2019 (no document yet).",
 "source_type": "broker_statement", "source_run_id": "run-b07f",
 "confidence": 0.5, "salience": 0.4,
 "created_at": "2026-07-14", "expires_at": "2026-08-13",
 "written_by": "intake agent"}

The ids and dates are synthetic, and the memory id is the first new id of the store when this case runs alone. Three fields carry the difference from a summary. source.type is broker_statement, so every reader knows it is a claim. The confidence of 0.5 is assigned by a rule from that source type; it is not anyone's opinion of the sentence. expires_at is thirty days later: if no document arrives, the claim stops being returned. And it never replaces roof_age_years in the submission, which stays null until a document or an inspection sets it.

That last point is the idea of a source of truth. A source of truth is the one record that wins when two records disagree about the same thing. For the roof age of SUB-1003, the source of truth is the submission record, updated only from a document or an inspection. The memory is a pointer to a claim, kept so that the agent and the underwriter do not lose it. If the memory and the submission disagree, the submission wins.

Where each of the four lives, and who owns it#

The diagram puts the four side by side, from the most complete to the most deliberate.

Diagram: Four ways to carry the past forward · less text kept, more decided

Read left to right. Full history keeps every message and decides nothing. A summary keeps what its writer judged important at one moment. Retrieval keeps everything and fetches what matches the question. A durable fact keeps one statement and decides its source, its confidence and its expiry. Only the last one has an owner who answers for it.

  1. 1 · Keep everything
    1. Conversation history: Every message in order, sent again on each call. Loses nothing until it is cut.
  2. 2 · Keep a copy
    1. Summary: A shorter text written from the history at one moment. Drops what seemed unimportant and can turn a claim into a fact.
  3. 3 · Find on demand
    1. Retrieval: Everything stays in a store; the passages that match the question are fetched. Cannot find what is absent.
  4. 4 · Decide and keep
    1. Durable fact: One statement stored on purpose by a write policy, with provenance and an expiry. Never overrules the source of truth.

Read it from left to right. Each step keeps less text and adds more decision. Full history keeps all text and decides nothing. A durable fact keeps one sentence and decides several things about it. The decision is where the owner comes in: somebody must answer for a durable fact, and nobody answers for a conversation.

WayWho writes itWhat it keepsWhat it losesGood for
Conversation historyNobody decides; every message is appendedEverything said, in orderNothing, until it is cut; then the oldestShort exchanges; audit of what was said
SummaryA model or a person, at one momentWhat seemed important thenOmissions, the status of claims, detailOrientation: what was this about?
RetrievalAn index over the history or documentsEverything, findable by matchingAbsences; anything phrased unlike the questionFinding a sentence that exists
Durable factA write policy, with provenanceOne statement with source, confidence, expiryEverything else, on purposeInformation later runs must rely on
For a backend engineer. This is the distinction between a log and a table. An application log keeps every line in order; you search it with grep when something goes wrong. A table keeps the current value of a field, written by code that validated it, with a column that says where it came from. Nobody runs a business from grep over the logs. A summary is a nightly report written from the log: useful to read, never a replacement for the table.

The failure, shown#

Here is the same question asked on day eight of UW-M09, once with each of two designs.

In the first design, the system keeps a running summary. After turn 12 the summary says: "Masonry building; tenant is a furniture retailer; roof replaced 2019; fire alarm monitored." The agent receives the summary and the submission. The submission says roof_age_years: null. The summary says the roof was replaced in 2019. The agent has two disagreeing inputs and nothing that says which one wins. A scripted agent may pick either. A model may pick the more specific one, which is the summary.

In the second design, the system keeps the twelve messages for audit, retrieves from them on request, and keeps the claim as a durable fact with source broker_statement, confidence 0.5 and an expiry of 2026-08-13. On day eight the agent receives the submission, still null, and the fact, marked as an unverified broker statement. The rule R-ROOF-02 fires as it should. The recommendation is request_info, and its reasons say "the broker states a 2019 replacement; no invoice has arrived". The underwriter sees both the gap and the claim. The model recommends; a person decides.

On day 31 the fact expires. A read no longer returns it. If the invoice had arrived, the intake step would have set roof_age_years from the document and stored the document as evidence, and the claim would no longer be needed.

Framework implementation#

Many agent libraries keep the conversation history for you, per thread, and offer helpers to trim or summarize it. Some also offer a separate long-term store for facts. What each named library keeps, and under which words, is read from its own documentation on Frameworks. This page only names the four ways and what each loses.

A test you can run on Monday#

Take one agent of yours and a conversation in which an important fact is stated early.

  1. Ask a question about that fact after the conversation has grown past your window or your summary threshold. Is the answer still correct?
  2. Find one claim in your summaries ("the customer has paid", "the roof was replaced"). Can you trace it to a message, a document, or a person?
  3. Ask a question whose answer is that something did not happen. Does retrieval alone get it right?
  4. Find two places that hold the same field. Which one is the source of truth, and does the code that reads both know it?
  5. Pick a stored fact. When does it expire, and what happens on that day?
Advanced: the cost and the risk of each way, at scale

Full history grows without bound. Its cost per call grows with the length of the thread, and its quality can fall before the size limit is reached, because the model must find one sentence among many. Teams usually discover this not as an error but as answers that get vaguer as threads get longer.

A window has a constant cost and a predictable loss: the oldest turns. That is acceptable when the oldest turns rarely matter, as in a chat about the current task. It is wrong for intake conversations, where the important facts are stated early.

Summaries are cheap to read and expensive to trust. They have no provenance per statement, so a wrong statement cannot be traced or corrected without re-reading the history. If summaries are kept, keep the history they came from, link each summary to the turn range it covers, and never let a summary write into a record that is a source of truth.

Retrieval quality depends on the index, the query and the ranking, all of which are covered on Retrieval. Its blind spot is structural: it finds what is present, not what is absent.

Durable facts move the cost to write time: extraction, a policy, provenance, expiry. That cost is paid once per fact, not once per call. It is the only one of the four ways that can be tested in isolation: given this message, should this fact be stored, with this source and this expiry?

The pragmatic architecture combines them. Keep the full history as an append-only record for audit. Retrieve from it on demand. Keep a summary for orientation, linked to its turn range. And promote to a durable fact only what later runs must rely on, through a write policy, with the source of truth for each field named.

Advanced: when two sources of truth disagree

A source of truth is per field, not per system. For the roof age the submission wins. For the decision the decisions table wins, because only a person writes it. For what the broker said, the email archive wins. Disagreement between a memory and its source of truth is not a conflict to resolve by recency or confidence. It is a signal that the memory is stale or the source was not updated. The repair is to go to the source, not to pick the more convincing text. Conflict between two memories, neither of them a source of truth, is the subject of conflict resolution on Advanced.

In one breath#

There are four ways to carry the past forward: keep all of it, keep a summary, retrieve from it, or store a durable fact. History loses nothing until it is cut, a summary loses what its writer did not foresee and turns claims into facts, retrieval cannot find what is absent, and a durable fact keeps one statement with its source, its confidence and its expiry. For every field, name the source of truth; a memory never overrules it.

The same idea for a coding agent: the session transcript is history, a compacted summary is a lossy copy of it, a search over the repository is retrieval, and a line in the project instruction file is a durable fact that a person is responsible for.

The insurance agent has kept its past for one submission. A coding agent does the same with plain files, and the next page uses that second example to show which file survives what: Files as memory in coding agents.