Skip to content
audiotale.net
Sign in
AI learningExplainer

Anthropic's agent memory research: four layers, 'dreaming', and gains up to +0.32 on CL-Bench

Anthropic's new article defines agent memory in four layers and reports that an offline 'dreaming' pass corrects notes and lifts task scores, with gains that vary widely by model.

audiotale.net team

· 6 min read

Written by AI from the sources linked below. How we use AI

On this page
  1. Key points
  2. What happened
  3. The numbers
  4. Background
  5. How it works in Claude Code
  6. What it means
  7. What we don't know yet
  8. What to watch next
  9. Sources

Anthropic has published a research article, "The Components of Agent Memory", that sets out how an AI agent should remember things between sessions, and it comes with numbers: on one database task, giving its newest models a memory lifted their mean reward from between 0.56 and 0.66 to between 0.83 and 0.84. The piece is useful to anyone building or configuring a coding agent, because it explains why a small, well-kept memory beats a big pile of notes and why a background clean-up pass it calls "dreaming" matters. All results below are Anthropic's own, run on its own models and tasks, so treat them as the company's evidence, not an independent benchmark.

Key points

  • Anthropic defines agent memory as knowledge kept between sessions, and excludes weight changes, in-context learning within one conversation, and compaction.
  • It describes four layers: transcripts, memory notes, memory representations such as wikis, and a small injected context loaded into every session.
  • "Dreaming" is an offline pass that corrects notes against transcripts, builds representations and promotes material upward.
  • On the CL-Bench database task, every model it tested scored higher with memory; the smallest gain was Sonnet 4.6 (0.330 to 0.364), the largest Opus 4.7 (0.383 to 0.700).
  • Telling a model to "record only failures" reduced its memory gain for the models Anthropic tested.

What happened

On 6 November Anthropic published the article on its research site. It treats memory like human memory: capture quickly while working, then consolidate later offline. Its four layers, bottom to top, are:

  1. Transcripts, a searchable log of what the agent did.
  2. Memory notes, observations the model writes during a session, often as files in a folder.
  3. Memory representations, structured forms such as wikis, meaning linked pages the model maintains.
  4. Injected context, a small layer loaded at the start of every new session.

Dreaming is the process that moves information between those layers. Anthropic says it can fix notes that were wrong from the start or that went stale as the environment changed, build representations, and keep the top layer short by moving detail down and leaving links.

The numbers

On CL-Bench, a database task, Anthropic reports mean reward without and with memory:

Model Baseline With memory
Opus 5.5 0.655 0.838
Sonnet 5.5 0.644 0.833
Opus 5 0.564 0.828
Opus 4.7 0.383 0.700
Sonnet 5 0.306 0.610
Sonnet 4.6 0.330 0.364

The chart shows the gain, which we calculated by subtracting the baseline from the with-memory score.

Gain in CL-Bench mean reward from memory (our subtraction of Anthropic's figures)reward points
Gain in CL-Bench mean reward from memory (our subtraction of Anthropic's figures) (reward points)
reward points
Opus 4.70.317
Sonnet 50.304
Opus 50.264
Sonnet 5.50.189
Opus 5.50.183
Sonnet 4.60.034

Source: Anthropic, The Components of Agent Memory

Two readings follow. Newer models start higher, so their gain is smaller, and Sonnet 4.6 barely benefited. Anthropic says the difference is how well a model closes the learning loop: Sonnet 4.6 produced untested theories, Opus 4.7 consolidated notes and marked facts as verified, Sonnet 5 confirmed answers and wrote corrections, and Opus 5 was "the first of these models to close the loop". Sonnet 5 reads its memory before answering about nine times in ten, against fewer than half for Sonnet 4.6. Prompting Sonnet 4.6 to read memory and test its theories lifted it from 0.364 to 0.641.

Steering can backfire. Telling a model to "record only failures" cut the memory gain by 0.234 for Opus 5, 0.150 for Opus 4.7 and 0.020 for Sonnet 4.6. Anthropic's advice is to tell the model what memory is for rather than how to use it.

Pokémon Red. Sonnet 3.7 wrote 413 files across 225 folders over about 10,000 steps and earned one badge; its detailed state notes went stale, and once it spent 17 steps reorganising memory without playing. Claude Fable 5 wrote nine files in two folders plus a global.md and earned four badges, storing strategy rather than state such as money or location. Opus 5.5 kept a small folder of goal and next-step notes and beat the game. In one scene a wrong note put a PokéCenter on the wrong side of a mountain and the agent walked off a one-way ledge. After dreaming corrected the note it reached Cerulean City at action 1,935; the run with the uncorrected note fell back three times and the run with no memory never got there.

Wikis. On a corpus of about 350,000 files and 420 million tokens (25 questions), a wiki alone rose from 13% to 48% of graded criteria over 128 sessions. Wiki plus search went from 54% to 61%, against 53% for search alone, and saved about 20,000 tokens per question. On 24 merger questions needing reasoning across documents, the wiki scored 87% against 73% for search on the hardest items. On another task where single-document text search was enough, it showed no clear gain, and on a third the wiki grew to 1.77 times the corpus size, which Anthropic compares to a map so detailed it abstracts nothing.

Focused dreaming. When agents overwrote one shared contract summary table, 41 of 57 facts survived (72%). Giving each contract its own page with verbatim terms kept all 57. A gap-filling pass repointed nine links to a missing page and added three new ones.

Background

Keeping memory outside the context window is not new. The 2023 paper MemGPT: Towards LLMs as Operating Systems proposed "virtual context management", moving data between fast and slow memory tiers the way an operating system does, to work around limited context windows. Anthropic's piece is a newer, practical version of that idea, framed around what models now do well: judge what is worth keeping, and revise it.

How it works in Claude Code

The injected-context layer has a concrete counterpart in Claude Code. Its memory documentation describes two systems loaded at the start of every session: CLAUDE.md files you write, and auto memory that Claude writes itself, of which the first 200 lines or 25KB are loaded. The article says the same limit applies to the MEMORY.md index. The documentation also says Claude treats these as context, not enforced configuration; to block an action regardless of what Claude decides, use a hook.

What it means

For developers using coding agents. Keep always-loaded instructions short and specific. Anthropic's finding that long instruction files reduce adherence, and that detail belongs lower down behind links, matches that limit. If you let an agent write its own notes, review them occasionally: a wrong note can be worse than none, as the Pokémon example shows.

For people building agents. The results favour transcript search as the foundation, with wikis layered on top, and a scheduled clean-up pass for volatile facts. They also warn against over-prescribing memory behaviour for strong models. Fixed rules can hurt, the article says.

For readers of benchmarks. Memory gains depend heavily on the model, and the figures come from the vendor's own tasks.

What we don't know yet

  • Whether the gains hold on tasks outside CL-Bench, the Pokémon runs and the document corpora Anthropic used; no independent replication is cited.
  • How dreaming should be scheduled. Anthropic suggests tuning its cadence, perhaps by how often memories are accessed, but gives no recipe.
  • When to write memory, in the moment or in the background, and how to keep it current: Anthropic lists both as open questions.
  • What dreaming costs in compute; the article says representations need compute to avoid accumulating errors but we did not find a cost figure.

What to watch next

Whether dreaming appears as a product feature, whether other labs publish comparable memory benchmarks, and whether independent teams reproduce the wiki results.

Sources

Written by

audiotale.net team

The official account of the people who run audiotale.net: announcements, conversation starters and the newsroom's drafts. Posts written with AI say so. Every other account here is a real person.