An AI agent that starts each task again without remembering the previous one makes the same mistakes. How to give it a reliable memory? THE November 6, 2026Anthropic has published a detailed study, signed by Lance Martin, on the components of agent memory. The company describes how its Claude models retain knowledge from one session to the next, quantifies the gains obtained and details the errors to avoid.
What are we talking about when we talk about an agent’s memory?
An AI agent is a program based on a language model that chains actions to accomplish a task. By default, each new session starts from scratch. Anthropic defines an agent’s memory as the knowledge he draws from his experience and which he retains between sessionsin text form that he can read again later.
This definition deliberately excludes two mechanisms: the modification of the model itself by new training, and the simple context of a conversation in progress, which disappears at the end of the session.
A memory organized in layers
Anthropic describes an organization on several levels, from the most detailed to the most synthetic:
| Layer | Role |
|---|---|
| Session logs | The full log of what the agent did, searchable |
| Memory Notes | What the agent considers useful to remember, written during the task |
| Representations, like wikis | Linked pages that serve as a map for orientation |
| Context loaded in each session | A small set of notes read systematically at startup |
The top layer should remain shortinsists the study: each note loaded in each session consumes resources, and an incorrect note contaminates all subsequent sessions. Details should be relegated to lower levels, with links to find them. In Claude Code, Anthropic’s programming tool, the automatic memory only loads the first 200 lines or 25 KB of its main file, which serves as an index.
Net gains on recent models
To measure the effect of memory, Anthropic used a test called CL-Bench, in which the agent answers questions on a database. Each question opens a new session, and a memory folder is the only link between them. After each response, the agent learns the correct solution and can note what it remembers.
| Model | Score without memory | Score with memory |
|---|---|---|
| Claude Opus 5.5 | 0.655 | 0.838 |
| Claude Sonnet 5.5 | 0.644 | 0.833 |
| Claude Opus 5 | 0.564 | 0.828 |
| Claude Opus 4.7 | 0.383 | 0.700 |
| Claude Sonnet 5 | 0.306 | 0.610 |
| Claude Sonnet 4.6 | 0.330 | 0.364 |
The gap between generations is due to the way of taking notes. According to Anthropic, Sonnet 4.6 made assumptions without verifying them. Opus 5 is the first of these models to “close the loop”: his notes state a rule, the way in which he established it and the pitfalls to avoid. Sonnet 5 rereads his memory before responding nine times out of ten without being asked, compared to less than one time out of two for Sonnet 4.6.
Know what is worth remembering
Taking notes is like making a bet: writing a rule is like predicting that it will be used again. Anthropic illustrates this with the Pokémon Red video game. After about 10,000 actions, the old Claude Sonnet 3.7 model had accumulated 413 files in 225 folders, almost a million characters, and had only earned one badge. He spent his time updating outdated information. A more recent model made do with around ten files, around 43,000 characters, and won four badges. Claude Opus 5.5 completed the game by maintaining a small file on his objective and his next steps.
The lesson also applies to instructions. Impose a rigid rule on a recent model, such as note only failuresgreatly reduces the benefit of memory: the gain falls by 0.234 points for Opus 5. Conversely, an older model like Sonnet 4.6 benefits from precise instructions: invited to read its memory before responding and to explicitly test its hypotheses, it goes to 0.641.
The “dream”, to correct one’s memories
The most striking idea of the study is the so-called phase of ” dream “ (dreaming). Like the brain during sleep, the agent takes advantage of periods of inactivity to reread its histories, check its notes against what really happened, correct errors, build wikis and decide which notes are worth loading at each session.
Anthropic gives a concrete example. In Pokémon, a wrong note placed a healing center on the wrong side of a cave. The agent, convinced he had completed the stage, fell from the same ledge three times and never reached the next town. After a dream phase which corrected the rating based on the histories, he reached it in 1,935 actions.
Wikis to navigate large volumes
Anthropic also tested wikis built by Claude from a company’s internal documents, around 350,000 files. By multiplying the dream sessions from two to 128, the share of criteria met on 25 test questions increased from 13% to 48% with the wiki alone. Combined with a classic search in documents, the wiki achieves 61%compared to 53% for search alone, while saving around 20,000 text units per question.
On legal files involving company mergers, the wiki increases the success rate from 73% to 87% for questions that involve several documents. On the other hand, it does not bring no net gain when the information is in a single document. In one case, the wiki produced was even 1.77 times larger than the original documents.
Recognized limits
The study does not present memory as a miracle solution. Anthropic lists several difficulties:
- a note can be wrong from the start or become obsolete, and continue to be used;
- maintaining memory costs time and computing power, including the dream phase;
- taking notes during the task distracts the agent;
- uploading a note does not guarantee that the agent respects it, and instructions that are too long are less well followed;
- Wikis can grow beyond sources and accumulate errors.
Most experiments are also based on a single execution, without measuring variability, and on tests designed by Anthropic. The results indicate trends more than they provide guarantees.
Practical advice for developers
For those designing AI agents, the study provides several concrete recommendations:
- explain what memory is used for rather than dictating how to use it, and letting recent models judge what is worth retaining;
- for older models, explicitly ask to reread the memory before acting;
- keep what is loaded in each session very short;
- rely first on a historical search, and only add a wiki if the questions cross several documents;
- When several agents work together, give them separate pages rather than a shared table, where information gets lost.
These mechanisms are accessible to developers through Claude Managed Agents, Anthropic’s hosted agent service, which offers a memory folder and documentation dedicated to the dream. The study does not specify either the price or the availability status of this function.
Towards agents who learn as they work
Memory has become a field of competition between laboratories: Meta had made it the argument of its Muse Wonder model, presented in October 2026. The Anthropic study shows that the question goes beyond storage capacity: it is a question of knowing what to remember, how to verify what has been remembered and how to organize it. Anthropic acknowledges that there are still open questions, including when to create a note and how to keep it up to date. For companies, the issue is concrete: an agent who truly learns from its mistakes becomes more reliable with each task, provided that its memories are regularly checked.

