Agent memory consolidation checks and reorganizes information that an AI agent retains across sessions. An agent is a language-model system that uses tools to carry out tasks. Consolidation can correct notes, combine information across sessions, build linked reference pages, and select context to load automatically. Its usefulness depends on whether those changes improve later work.
Anthropic's report, The components of agent memory, calls background consolidation dreaming. It presents experiments with database questions, document collections, and Pokémon. These are vendor-reported evaluations of particular tasks, rather than proof that every agent benefits from the same memory design.
The broader memory map covers storage, retrieval, provenance, and restoration. Consolidation connects those components by revising what the agent will encounter next.
Four layers of retained information
Anthropic describes four layers with different jobs:
| Layer | Contents | Function |
|---|---|---|
| Transcripts | Searchable records of sessions | Preserve material that later summaries can be checked against |
| Memory notes | Observations, plans, and learned rules | Capture information judged useful during a task |
| Memory representations | Linked pages, indexes, and other organized views | Connect information and guide navigation |
| Injected context | A small selection loaded into each new session | Make selected information available before any search |
Information can move between layers in either direction. A background pass might discover that a note contradicts a transcript. It might also move detail out of the automatically loaded layer and leave a link to a fuller reference.
This differs from context compaction, which replaces part of an ongoing conversation with a shorter representation. In the report's terminology, consolidation maintains information across sessions without changing the model's trained parameters. A system can use both mechanisms.
The report credits sleep-time compute, proposed by researchers at Letta and UC Berkeley, as an antecedent: use time between interactions to reorganize context for future work. The resemblance to human sleep is an analogy for when processing happens, not evidence that the mechanisms are biologically equivalent.
Learning rules requires testing them
In a database task from Continual Learning Bench, each question began in a fresh session. The model could retain files, and it received the correct solution after answering.
Anthropic reports that Sonnet 4.6 accumulated untested explanations for its mistakes. Opus 4.7 distinguished checked facts from unconfirmed ones. Opus 5 went further: its notes included rules, evidence supporting those rules, earlier answers, and warnings about discovered traps.
The distinction appeared in measured performance. Sonnet 4.6 scored 0.330 without memory and 0.364 with it. Instructions to read its memory before answering and test its theories increased the score to 0.641. Those numbers are mean rewards on this particular database task.
Instructions could also make memory worse. Telling stronger models to record only failures removed much of their benefit from memory. This finding argues against treating a mistake log as a complete learning system: successful procedures and confirmed facts can also help future work.
Correcting a plausible but wrong note
The Pokémon example shows how a small memory error can redirect many later actions. An agent incorrectly recorded which side of Mt. Moon contained a Pokémon Center. It then treated that landmark as evidence that it had crossed the mountain and repeatedly returned to an earlier route.
A consolidation pass checked the note against the original session record and corrected the location. In the reported continuation, the corrected-memory run reached Cerulean City. The raw-memory and no-memory runs did not reach it within the evaluation.
This example demonstrates a possible repair mechanism. It does not establish a general success rate for background correction. A transcript can help recover what happened in a session; checking a real-world claim may still require a tool, an external source, or a new experiment.
Linked references and search
Anthropic also built wikis over roughly 350,000 internal documents from Stainless, totaling about 420 million tokens. Here, a wiki means generated subject pages connected by links. Agents expanded and revised the wiki across 128 background sessions, checking claims and merging duplicates.
On an evaluation with 25 questions, the report gives these results:
| Available information | Reported score |
|---|---|
| Search alone | 53% |
| Wiki alone, after the largest preparation run | 48% |
| Wiki plus search, after the largest preparation run | 61% |
The percentages measure aggregate graded criteria met, rather than the percentage of questions answered entirely correctly. Search remained available alongside the generated pages in the highest-scoring setup.
The report also estimates a saving of about 20,000 tokens per question when using the wiki with search. That answer-time saving must be considered alongside the preparation work: the figure shows up to 128 million dreaming tokens. Whether the trade pays off depends on subsequent query volume, model prices, and maintenance needs.
Task structure affected the benefit. In a merger-document evaluation, a wiki helped with questions that combined several documents. In a legal-brief task where most required facts were searchable in one document, it showed no clear gain. Another generated wiki grew to 1.77 times the size of its source text, adding considerable material without achieving useful compression.
Ownership errors can look like memory errors
A brief generated from one legal-document wiki initially included only 41 of 57 graded facts. Several agents had written to a shared contract-terms table, overwriting one another's work. Their summaries also failed to preserve important terms.
A revised process assigned one agent to each contract and gave each contract its own page. The pages quoted terms verbatim. All 57 graded facts could then be met, compared with 41 before the change.
The intervention changed both write ownership and representation, so it does not isolate their individual effects. It does show why evaluating only the model's summarization ability would miss part of the failure: the write process itself lost information.
Interpretation: choosing what to maintain
Co's reading of these experiments is that consolidation should be judged by the decisions it improves and the evidence it preserves. Several design choices follow from that interpretation:
- Keep original evidence accessible. Derived pages can guide retrieval without becoming the only surviving account.
- Separate verified rules from hypotheses. A plausible explanation for a failure should remain provisional until tested.
- Give concurrent writers distinct ownership. Reconciliation should combine their work deliberately rather than depend on overlapping saves.
- Keep automatically loaded context selective. Every injected note consumes attention and can repeat an error across sessions.
- Test with and without the derived representation. Include questions requiring several sources and questions answered directly by one source.
These choices complement routing-based memory, which selects where to look when a request arrives. Consolidation improves the available material; routing determines whether the agent finds and uses it. The failure guide covers additional risks such as generated false state, truncated loading, and destructive edits.
Limits of the evidence
The report contains several experiments with different tasks and evaluation methods. Its Pokémon comparison between Sonnet 3.7 and Fable 5 changes the model as well as the memory strategy. Better progress therefore cannot be attributed to smaller memory folders alone. The 25-question Stainless evaluation also provides limited evidence about performance on other organizations' documents.
Memory maintenance has continuing costs. Facts change, indexes accumulate errors, and notes selected for automatic loading may stop being relevant. Anthropic leaves the cadence of consolidation and the division between in-session note-taking and background work as open questions.
For implementation examples, Anthropic provides a dreaming cookbook and a wiki example.