The components of agent memory
Anthropic reveals how they built Claude's memory using brain-inspired "dreaming" - agents use idle time to validate, reorganize, and consolidate memories, just like human brains during sleep.
Read OriginalMy Notes (1)
Sonnet 3.7’s approach was a problem mainly because the game state of Pokémon changes constantly—Sonnet 3.7’s detailed record was continuously going out of date. As a result, as Claude progressed, it had to spend more time and resources combing through its memories rather than playing the game. Around step 10,000, for example, Sonnet 3.7 started its fourth folder of “master” memory files. Over the next 17 steps, it created six files, deleted nine others, and took no actions in the game itself
Summary used for search
TLDR
• Advanced models like Opus 5 now close learning loops autonomously - recording failures, generating theories, testing them, and writing validated rules to memory without being told how
• Judging salience matters more than storing everything: Fable 5 beat Pokémon with 9 memory files vs Sonnet 3.7's 413 files (which spent so much time managing memory it stopped playing)
• "Dreaming" (offline reflection on transcripts) catches errors that in-session memory misses - like when Claude incorrectly noted a PokéCenter's location and dreaming corrected it by checking the transcript
• Prescriptive memory rules hurt stronger models: telling Opus 5 to "record only failures" cut its performance gains in half vs letting it judge what's salient
• Building wikis through iterative dreaming scaled performance from 13% to 48% on a 420M token corpus, with the biggest gains on multi-document reasoning tasks
In Detail
Anthropic's approach to agent memory mirrors how human brains work: the hippocampus captures experiences in real-time, then offline consolidation during sleep integrates them into long-term knowledge. Claude uses a similar division - writing memory notes during sessions (capturing salience in the moment) and "dreaming" during idle time to validate, reorganize, and build representations from those notes.
The evolution across Claude models shows how capability changes what works. Sonnet 3.7 wrote everything to memory indiscriminately, creating 413 files while playing Pokémon and eventually spending more time managing memory than playing. Fable 5 kept just 9 files focused on non-obvious knowledge (strategy, tested rules, plans) and progressed 4x further. On CL-Bench, Opus 4.7 generated theories about failures but didn't test them; Opus 5 closed the loop entirely, marking facts as confirmed and writing corrections. Stronger models benefit from freedom to judge salience - prescriptive rules like "record only failures" cut Opus 5's performance boost in half.
Dreaming serves multiple functions beyond validation. It builds navigable representations like wikis (scaling performance from 13% to 48% on 350K documents as dreaming sessions grew from 2 to 128), promotes critical notes to the top of the memory hierarchy for automatic context injection, fills gaps left by individual sessions (like creating missing wiki pages that multiple sessions linked to), and can be tuned toward specific goals. The key tension: in-session memory captures salience immediately but can be wrong from the start; dreaming validates against transcripts and builds structure but requires compute and isn't immediately available. The frontier isn't just bigger models - it's giving them the right cognitive architecture to learn from experience.