跪拜 Guibai
← All articles
Agent · AI Programming · AIGC

Anthropic's Agent Memory: Four Layers, a Dreaming Pass, and the Pokémon Proof That Writing Less Wins

By ENCI ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Agent builders now have a concrete, tested design for what to persist and how to reconcile it, with hard numbers on the costs: token consumption, accuracy ceilings, and the extra review burden. The lesson that recording less is more directly changes how you structure any agent's memory store, and the 48% ceiling warns that offline consolidation alone won't make a model reliable.

Summary

Anthropic's new engineering write-up lays out a four-layer memory architecture for agents: raw conversation logs, distilled memory notes, cross-session wiki pages, and resident context that loads at the start of every session. The layers form a pipeline, with logs as raw material and notes as semifinished products, and the whole thing gains an undo by never modifying the input store—dreaming outputs a fresh store that can be discarded.

The standout evidence is a Pokémon Red experiment. Claude Sonnet 3.7 wrote 413 memory files and earned 1 badge; Claude Fable 5 wrote 9 files and earned 4. The difference came from deciding what not to record: screen-readable facts like money and location wasted attention, while strategy, plans, and verified rules carried value. Dreaming runs as an asynchronous batch task that extracts notes, synthesizes wiki entries, and promotes the most reliable items to resident context, fixing errors like the Mt. Moon navigation failure by checking notes against the raw logs.

On distributed-scale tests, wiki answer accuracy rose from 13% at session end to 48% after 128 dreaming runs, and to 61% with retrieval added—but that still leaves 52% wrong. The design remains in research preview, costs tokens linearly, and introduces audit overhead from versioned memory stores. Memory acts as an amplifier: strong models gain, weak models barely move, and you can't fix base-model judgment with a bigger memory system.

Takeaways
— Agent memory is organized into four layers: raw logs, memory notes, wiki knowledge, and resident context, with logs never modified to preserve an undo.
— In the Pokémon experiment, a model writing 413 memory files got 1 badge; one writing 9 files plus a global.md got 4 badges.
— The value of a memory entry is predictive: write down only what the environment won't reveal on its own next time.
— Adding a 'only record failures' rule reduced memory gains on strong models; weak models benefited more from explicit prompts to read memory before answering.
— Dreaming runs on 1 to 100 sessions, takes minutes to hours, and outputs a wholly new store; instructions guide synthesis but can't line-edit.
— Wiki answer accuracy went from 13% at session end to 48% after 128 dreaming runs, to 61% with retrieval; retrieval alone gave 53%.
— Single answers after dreaming consumed about 20,000 fewer tokens than browsing raw files.
— Dreaming is currently limited to Claude Managed Agents research preview and requires a beta header.
— An early wrong rule can persist in the wiki if no later experience contradicts it, which is why dreaming works best where feedback is immediate.
Conclusions

The 'decide what not to record' principle is a general filtering problem, not just a memory-system quirk; any system that stores derived state should ask whether the source is re-readable at use time.

Dreaming is reconciliation against ground truth, not autonomous reflection; without raw logs to check against, it degrades into the model guessing again.

Memory amplifies model strength, so teams treating a complex memory stack as a cure for a weak base model will burn money for near-zero gain.

The 48% ceiling after 128 runs shows consolidation has limits; error compounding can calcify misinformation, and the versioned-store audit cost is a real operational burden hidden behind the token savings.

Accessibility being locked to a research preview means most third-party frameworks and standard API users can't replicate these results without Anthropic's managed tier.

Concepts & terms
Dreaming
An asynchronous offline task in Claude's agent memory system that extracts new notes from recent sessions, synthesizes wiki entries, and promotes the best entries to resident context. It never modifies the original logs; it outputs a new store, giving an undo.
Memory notes
The second layer of agent memory: distilled observations, corrections, and behavioral rules derived from raw session logs. Writing a note is a prediction that future sessions will re-use that pattern without rechecking.
Resident context
The fourth layer of memory: the most reliable notes and wiki entries promoted to the top and auto-loaded at the start of each session, avoiding the need for retrieval.
Sleep-time compute
A concept from a Letta and UC Berkeley paper (arXiv:2504.13171) that offline, post-hoc processing of agent memories—like Anthropic's dreaming—can improve performance without changing weights, by consolidating and validating stored knowledge.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗