AI agents have an old problem: every time a new session starts, they don’t remember what they did last time. Anthropic recently published “The components of agent memory,” which is about how to make an agent’s memory reliable, and the most interesting part is a mechanism called Dreaming.

Memory Isn’t About More, It’s About Layers

Anthropic breaks agent memory into four layers. At the very bottom are raw logs, where the whole conversation and every action live. Above that are curated notes Claude jots down as it works. Above that is structure it organizes and links up on its own, like a Wiki. At the very top is a small index that gets loaded automatically at every startup.

They stress that the top layer has to be small. Every word you put in there costs tokens on every single run, and wrong content gets dragged into every run too.

What Dreaming Actually Does

Between tasks, Dreaming goes back through the history, fixes the notes, deletes outdated ones, merges duplicates, and then distills new lessons from several tasks. At the next startup, it only needs to load that short index and look things up as needed, instead of rereading the whole history from scratch.

The key point in the research: it can catch mistakes because it still has the raw logs to check against. Notes are guesses; logs are evidence.

The article has a concrete example. Claude was playing Pokémon Red, and one note had the Pokémon Center’s location backwards. As a result, it fell off a cliff near Mt. Moon three times, and that round never even made it to the next city. After dreaming fixed that note, it re-entered the cave and made it to Cerulean City. A single wrong note can keep an agent going in circles for a long time.

Two Experiments, Two Slightly Counterintuitive Results

The first is the document experiment. They took Stainless’s internal documents, about 350,000 documents and 420 million tokens, and had Opus 5 run 128 rounds of reading, building a Wiki, merging, and cross-checking. On 25 questions, search alone scored 53%, and search plus the grown Wiki scored 61%, saving about 20,000 tokens per question on average.

But the point isn’t the 61. On questions that need several contracts synthesized to answer, the Wiki scored 87% and search alone scored 73%. On questions where the answer sits in a single document, the Wiki didn’t help noticeably. For one task, the Wiki even grew larger than the raw data, which the article itself describes as “almost nothing was abstracted.”

The second is Pokémon. The older Sonnet 3.7 took roughly ten thousand steps, wrote 413 memory files, and earned just 1 badge, with a lot of those files being state that was already visible on screen and went stale quickly. The newer Fable 5, also at around ten thousand steps, kept only 10 files and earned 4 badges, and what it recorded was strategy and verified rules.

The difference isn’t how much you remember. It’s whether you can tell what’s worth saving and what you can just look at again anytime.

Wrapping Up

Overall, the study’s conclusion is that the point of agent memory isn’t storing a lot, but telling what’s worth storing and regularly checking it against the raw logs. Bloated memory buries important information, and a wrong note gets carried into every later task.

That said, this is an evaluation Anthropic ran itself, with limited samples: the Stainless experiment had only 25 questions, the Pokémon run was a single attempt, the article doesn’t give any variance range, and Dreaming itself costs compute. The article also admits that when to write memory and how to keep it up to date are still unanswered.

Source: Anthropic Research — The components of agent memory