# Agent memory works best as a small, checked map of experience

Anthropic separates in-session notes from offline consolidation and shows why more stored context can make an agent less effective.[1]

Agent memory is information an agent saves from earlier work and reads in a later session. Anthropic’s November 7 research separates that persistent memory from model weights, the current conversation and compaction.[1]

The strongest pattern is selective: save tested rules, current goals, decisions and recovery state, then keep raw transcripts as evidence. An offline consolidation pass can compare notes with those transcripts, correct mistakes, merge duplicates and build indexes or wikis.[1][2]

The research does not show that every agent needs a large memory system. Extra notes consume retrieval time, stale facts can mislead later sessions and consolidation costs money. Start with a small store, measure whether it improves completed tasks and retain a way to trace every important memory back to evidence.[1][2]

## What agent memory means

[Anthropic published its agent-memory research on November 7, 2026 [1]](https://www.anthropic.com/research/components-of-agent-memory). It defines memory as knowledge gained from user interactions or assigned tasks that persists between sessions. This excludes facts stored in model weights, information available only in the current conversation and compaction summaries that replace older turns.

A memory tool gives the model file operations while the application controls storage.[2] The same logical path must resolve to the same user or project store in a later session. That makes tenant isolation, authorization, encryption, retention and path validation application responsibilities.

Persistent memory should answer a practical question: what will a later session need that it cannot reliably recover from the environment? Current balances, file contents and live service state should usually be read again. Tested rules, decisions, unresolved blockers and the reason behind a choice can be worth saving.

## Save predictions about future work

Writing a memory predicts that a later task will need it. A useful note therefore includes a claim, its evidence, its scope and when it should be checked again. A bare conclusion such as ‘this API is broken’ can survive long after the incident ends.

Anthropic compared Claude models on Continual Learning Bench. Newer models increasingly recorded checked rules, corrections and warnings instead of a pile of untested guesses.[1] The useful behavior was a closed learning loop: observe a result, test an explanation, record the rule and preserve how the agent verified it.

Store failures together with the successful correction. Failure-only memory performed worse in Anthropic’s experiments because an agent still needs the rule that replaced the failed approach.[1]

## More memory can reduce progress

In Anthropic’s Pokémon Red comparison, Sonnet 3.7 wrote 413 files across 225 folders and earned one badge. Fable 5 kept nine files in two folders plus a global index and earned four badges.[1] The runs used different model generations, so the result does not isolate memory design, but it illustrates the cost of recording changing state that the game already displays.

The smaller store held strategy, plans and tested rules. It did not duplicate money, map position or every encounter. Around step 10,000, the larger store spent actions reorganizing memory instead of playing.[1]

Set a memory budget. Limit the injected index, cap file and retrieval sizes, expire notes that have not been used and move detailed evidence below the top layer. Claude Code follows this pattern by loading only the first 200 lines or 25 KB of its auto-memory file.[1]

## Dreaming checks and reorganizes memory

Anthropic calls its offline consolidation process dreaming. A dream reads a memory store and one to 100 session transcripts, then writes a separate output store.[2] The original store stays unchanged, so an operator can inspect the replacement before using it.

A useful consolidation pass checks claims against transcripts, merges duplicate notes, replaces contradicted entries and repairs indexes. In Anthropic’s Pokémon example, a stored landmark was wrong. The later pass found the contradiction in the transcript and corrected the note, which stopped the agent from repeating the same navigation loop.[1]

Dreaming remains a research preview and uses standard model token billing.[2] Managed Agent transcripts persist until deleted and the feature is not eligible for zero data retention or HIPAA use.[2] Teams should review those data-handling constraints before sending private sessions into a consolidation job.

## Knowledge wikis help with repeated, cross-document questions

A knowledge wiki turns many source files into linked pages with provenance. Anthropic built one over roughly 350,000 internal files. As it increased consolidation from two to 128 sessions, performance on 25 questions rose from 13% to 48% of graded criteria.[1]

The best result combined the wiki with source search. The aggregate score rose from 54% to 61% as the wiki grew, while search alone scored 53%. Using both also saved about 20,000 tokens per question.[1] These are Anthropic’s internal evaluation results, not a general promise for other corpora.

Wikis helped most when answers required several documents and judgment. They added little when one text search found the answer, and one generated wiki became larger than its source documents.[1] Build a wiki for a slow-changing corpus that receives repeated, cross-document questions. Keep direct search for exact wording and recent changes.

## A practical implementation plan

- Create separate stores for each user, team or project, and enforce that boundary in application code.
- Begin with three files: a short index, current goals and decisions, and a progress log with next steps.
- Require each durable claim to include a source, verification date and conditions under which it becomes stale.
- Read live state from the source system instead of copying it into memory when retrieval is cheap and reliable.
- Reject path traversal, encoded traversal and any memory operation outside the allowed root.
- Run consolidation into a new store, compare it with the old store and approve the change before switching future sessions.
- Test memory with paired runs: no memory, notes only, and notes plus consolidation. Grade completed tasks, retrieval cost and repeated errors.
- Track false memories, stale-memory reuse, missed retrievals, token cost and time spent maintaining the store.
- Keep raw transcripts or source references for audit, but apply a retention schedule and delete data that no longer has a valid purpose.

## Limitations and open questions

- Anthropic produced the research and evaluated Claude systems, so independent replication across models and agent harnesses is still needed.[1]
- Several comparisons use different model generations, which means memory organization is not the only variable.[1]
- A consolidation model can introduce a new error while trying to fix an old one. Separate output stores and source citations make review possible but do not guarantee correctness.
- Frequent consolidation costs tokens and delays updates. Infrequent consolidation leaves contradictions and stale notes in circulation.
- Memory stores contain user and task history. Access control, deletion, regional processing and incident response need the same care as the source systems.

## Frequently asked questions

- Is agent memory the same as a long context window? No. A context window holds one active request, while persistent memory can be retrieved in later sessions.[1][2]
- Should an agent save every conversation? Usually no. Keep transcripts under an explicit retention policy, then write a smaller set of useful notes and indexes.
- What should go in the top-level memory file? Current goals, durable rules, active constraints and links to detail. Keep it short enough for the agent to read every session.
- When is a knowledge wiki useful? Use one for a large, slow-changing corpus with repeated questions that combine several documents. Search alone may be better for direct single-document lookup.[1][3]
- Can dreaming be trusted automatically? Treat it as a proposed migration. Review the separate output store, test representative tasks and preserve evidence for important claims.[2]

## Sources

- [[1] Anthropic: The components of agent memory, November 7, 2026](https://www.anthropic.com/research/components-of-agent-memory)
- [[2] Anthropic documentation: Dreams research preview, accessed November 7, 2026](https://platform.claude.com/docs/en/managed-agents/dreams)
- [[3] Anthropic Claude Quickstarts: Knowledge wiki cookbook, accessed November 7, 2026](https://github.com/anthropics/claude-quickstarts/tree/main/managed-agents/knowledge-wiki)
- [[4] Anthropic documentation: Memory tool, accessed November 7, 2026](https://platform.claude.com/docs/en/agents-and-tools/tool-use/memory-tool)
