R147 · Agent architecture › Memory and context

Anthropic's components of agent memory: notes, dreaming, wikis, injected context

Read the original

Authors Lance Martin, Anthropic, Elvis Saravia (shared)

agent-memorycontext-engineeringevalsknowledge-managementharness-config

TL;DR

Anthropic's The components of agent memory (Lance Martin, 6 Nov 2026), surfaced by Elvis Saravia's LinkedIn post, splits agent memory into four layers: transcripts, notes the agent writes, derived representations such as wikis, and a small injected layer loaded every session. An offline pass called dreaming reads transcripts to correct notes, build wikis, and promote or demote what gets injected.

The findings that matter for builders:

Saravia's own take: keep memory "extremely basic" (folders and files plus some episodic layer), and expect to keep upgrading it.

The memory hierarchy and dreaming

Memory here means knowledge Claude gains from experience and keeps between sessions as readable context. It excludes weight updates, in-context learning and compaction.

Dreaming replays transcripts to fix, build and prune each layerSessionClaude at workInjected contextLoaded every session; a small indexMemory representations (wikis)Linked pages, a map used beside searchMemory notesWritten in-session: rules, plans, trapsTranscriptsSearchable event log; the ground truthDreamingoffline passbetween sessionsloadedread on demandwritesloggedpromotes, prunesbuildscorrectsreplayed
agent memory hierarchy · 4 layers, 1 offline pass

The session writes notes and logs transcripts; only the top layer is loaded automatically, the rest is read or searched when needed. Dreaming, borrowed from sleep-time compute (Letta and UC Berkeley) and the hippocampal replay analogy, runs offline and does four jobs: correct notes against transcripts, build representations such as wikis, promote a few items into injected context while pushing detail down, and fill gaps no single session could see (dangling links, duplicates, a missing index). It can also be aimed at a goal, for example organizing memory around the person an assistant serves.

Evidence

Each experiment isolates one layer or one dreaming job. Numbers are from the article's figures and alt text.

ExperimentSetupResultWhat it shows
CL-Bench 1.0 database taskFresh session per question, Claude Managed Agents, one persistent memory directory; correct answer revealed after each questionMean reward, baseline to memory: Opus 5.5 0.655 to 0.838, Sonnet 5.5 0.644 to 0.833, Opus 5 0.564 to 0.828, Opus 4.7 0.383 to 0.700, Sonnet 5 0.306 to 0.610, Sonnet 4.6 0.330 to 0.364Opus 5 was first to close the loop: rule plus how it knew, answers, traps. Sonnet 4.6 left untested guesses
Steering rules on CL-BenchOne fixed rule per run vs "a memory folder is available""Record only failures": Opus 5 gain -0.234, Opus 4.7 -0.150, Sonnet 4.6 -0.020. Read-first and test-theories prompting took Sonnet 4.6 to 0.641Fixed rules hurt strong models; explicit procedure helps weak ones. Sonnet 5 read memory first 9/10 times unprompted
Pokemon Red, salienceMemory folder, about 10,000 steps inSonnet 3.7: 413 files, 225 folders, 978K chars, 1 badge. Fable 5: 10 files, 43K chars, 4 badges. Opus 5.5 beat the game with a small rewritten folderDon't store what the environment shows every turn; store plans and tested rules. A global.md dashboard held goal, plan and memory rules
Pokemon, dreaming as correctionA wrong note about which side of Mt. Moon the PokeCenter sat onCorrected run reached Cerulean at action 1,935; raw-memory run fell off the ledge 3 times and backtracked; no-memory run never arrivedThe transcript is ground truth; a wrong trusted note is worse than none
Stainless corpus wikiAbout 350,000 files (420M tokens), 25 questions, Opus 5 dreaming over 128 sessions with a shared logWiki alone 13% to 48% of criteria as dreaming grew from 2M to 128M tokens; wiki + search 54% to 61%; search alone flat at 53%; about 20K tokens saved per questionA wiki is a map that augments search, not a replacement
Merger questions and Harvey LAB briefsWiki vs direct file search87% vs 73% on 24 cross-document questions; no gain on a LAB task answerable from one memo; one wiki reached 1.77x its corpus (68 pages, 203 KB from 115 KB)Wikis earn their keep on multi-document synthesis and judgment; on lookup they are overhead
Goal-shaped dreaming (LAB contracts)Four agents writing one shared provisions page, then instructions rewritten by a reflect-and-rebuild loop41 of 57 graded facts survived concurrent writes; one page per contract, quoted verbatim, kept 57 of 57Concurrent writers to one page lose facts; tell the dreamer what matters
Gap-filling second passA second dreaming pass over a built wiki9 dangling links repointed, 3 pages added (one an index); 38 to 41 entries, 225 to 278 linksCross-session passes fix what each session can't see

Tradeoffs and failure modes

The article is candid that the design questions are open. The ones a builder has to decide:

Review checklist

Questions to ask of any agent memory design:

  1. Are raw transcripts kept and searchable? They are the ground truth every other layer is checked against.

  2. Is the injected layer bounded (lines or bytes) and written as an index that points down, not as content?

  3. Does memory guidance state the purpose and leave salience to the model, with procedure added only for weaker models?

  4. Does each stored rule say how it was verified, and are unconfirmed facts marked as such?

  5. Is there an offline pass that checks notes against transcripts, and is it targeted at volatile notes rather than everything?

  6. Is anything stored that the environment re-reveals every turn (state on screen, file contents, positions)? Drop it.

  7. Does any derived representation (wiki, graph) sit beside search rather than replace it, and is its size tracked against the source?

  8. Is the representation justified by the workload: cross-document synthesis, judgment or arithmetic, rather than single-document lookup?

  9. Does each shared page have one writer, with source terms quoted rather than summarized when exactness is graded?

  10. Is there a second pass for dangling links, duplicates and a missing index?

  11. Is the build and refresh cost compared against tokens saved per query at realistic volumes?

Sources:

Cited in field guides

Connections

See R147 on the knowledge map

Part of the Research notes on nowucca.com. Figures and claims are the source's own unless the summary says otherwise.