techlist.io

Agent Memory

2 posts

Anthropic2026-11-064 min readCurated summary

The components of agent memory

# Dreaming: How Claude Builds and Maintains Agent Memory Anthropic's post argues that agent memory works best when split into two processes, like the human brain's division between fast encoding and offline consolidation. Claude captures salient events during work, and a separate "dreaming" phase later replays logs, corrects mistakes, and reorganizes memory into representations that future sessions can use. The authors report that dreaming improves memory accuracy, that stronger models judge what is worth saving better when given freedom rather than fixed rules, and that the value of structures like wikis depends on the task. ### Memory as Prediction - Agent memory is defined as knowledge Claude gains from experience and retains across sessions, excluding weight updates, in-context learning, and compaction. - Writing a memory note is a prediction that the pattern will be relevant later. - On the CL-Bench 1.0 database task, models differed in how well they closed a learning loop: recording failures, testing theories, and turning results into rules. Sonnet 4.6 only generated untested guesses, while Opus 5 was the first to consistently write validated rules, answers, and warnings about traps. Opus 5.5 and Sonnet 5.5 also closed the loop, scoring about the same as Opus 5 with memory. ### Judging Salience - In a Pokémon Red evaluation, Sonnet 3.7 wrote 413 memory files across 225 folders, earned one badge, and wasted steps reorganizing outdated records. - Fable 5 wrote nine files in two folders plus a single `global.md` dashboard, and earned four badges. - The better approach stored information that couldn't be read from the screen, such as strategy, plans, and tested rules. One example was a note that varying the timing of inputs helped catch a Magikarp after repeated failures. ### Steering Memory Writes - Telling Claude what memory is for works better than prescribing how to use it. General guidance was enough for Opus 4.7 and Opus 5 to gain a noticeable performance boost. - Fixed rules such as "record only failures" removed much of the benefit for stronger models. - Older models benefit more from steering. Prompting Sonnet 4.6 to read memory and explicitly test its theories nearly doubled its benchmark score. Sonnet 5 reads memory on its own in 9 of 10 cases, compared with fewer than half for Sonnet 4.6. ### Correcting Memory Through Dreaming - Because notes are written from in-session judgment, errors can persist and be trusted later. - In a Mt. Moon navigation case, Claude recorded the Pokémon Center's location incorrectly, leading it to walk off a one-way ledge three times. Dreaming checked the note against the transcript, fixed it, and let Claude reach Cerulean City. The uncorrected run never got there. ### Building New Representations - Wikis are linked collections of pages Claude writes about a subject, acting as a navigable map of its memory. - On a 350,000-file internal corpus, 128 dreaming sessions raised accuracy on 25 questions from 13% to 48%. - Wiki plus search reached 61%, compared with 53% for search alone and 48% for the wiki alone, while saving about 20,000 tokens per question. - On merger questions requiring multi-document reasoning, the wiki raised scores from 73% to 87%. For tasks where a single-document text search was enough, the wiki gave no clear gain. In one case the wiki grew larger than the source documents and abstracted nothing. ### Promoting Notes and Focusing Goals - Dreaming can promote important notes to a small top layer that is loaded into every session. That layer must stay compact, since injected memories consume tokens and incorrect notes propagate. Claude Code's `MEMORY.md` loads only its first 200 lines or 25 KB for this reason. - Instructions for dreaming can be tuned to a task. In a contract-analysis benchmark, concurrent agents overwrote a shared table and the brief covered only 72% of facts. After the instructions were revised to give each contract its own page with verbatim terms, all criteria could be met. - Dreaming across sessions can also fill gaps. A second pass resolved nine broken links and added three pages, including an index. ### Open Questions - When to write memory is a tradeoff. Writing in the moment captures salience at the source but distracts from the task, while dreaming moves the work to the background but may not be immediately accessible. - Keeping memory current requires compute. The authors suggest focusing dreaming on information likely to change, or tuning its cadence based on access frequency. - Transcript search may serve as a foundation, with representations layered on top, but maintaining those representations requires ongoing effort to prevent errors from accumulating. The authors conclude that dreaming lets Claude look backward, organize memory, and correct mistakes, while acknowledging that much about memory system design remains to be learned.

Cloudflare2026-04-173 min readCurated summary

Agents that remember: introducing Agent Memory

Cloudflare’s Agent Memory is a managed, retrieval-based service designed to give AI agents persistent memory without continuously expanding their context windows. It addresses context rot by extracting useful information from conversations, retaining it across sessions, and retrieving synthesized answers when needed. The service is intended for production agents that run for weeks or months, where fast ingestion, affordable retrieval, and durable knowledge matter more than benchmark performance alone. ## The Challenge of Agent Memory - Larger context windows—even beyond 1 million tokens—do not eliminate context rot; excessive context can reduce model quality. - Aggressive pruning creates the opposite risk: removing information the agent may need later. - Existing memory systems vary widely: - Managed services versus self-hosted frameworks - Raw database or filesystem access versus purpose-built APIs - Full-context approaches versus retrieval-based systems - Benchmarks such as LongMemEval, LoCoMo, and BEAM help compare systems but may encourage overfitting to clean datasets that do not reflect long-running production workloads. ## Cloudflare’s Retrieval-Based Approach - Agent Memory is a managed service with an opinionated API. - It extracts and retrieves relevant information instead of exposing agents directly to a filesystem or database. - This approach is intended to: - Reduce token usage and cost - Improve retrieval performance - Support temporal reasoning, supersession, and instruction following - Keep memory operations out of the agent’s main reasoning context - Cloudflare expects programmatic querying to be useful for specialized edge cases, but not as the default interaction model. ## Memory Profiles and Core Operations Memory is organized into named profiles that can be shared across sessions, agents, and users. - `ingest`: Processes a conversation and extracts memories, typically during context compaction. - `remember`: Stores one important fact explicitly, often through direct model tool use. - `recall`: Runs the full retrieval pipeline and returns a synthesized response. - `list`: Lists stored memories. - `forget`: Removes a specific memory. For example, an agent can ingest a conversation containing a user’s preference for pnpm and dark mode, explicitly remember an operational fact such as an increased API rate limit, and later recall that the user prefers pnpm over npm. ## Integration and Supported Architectures - Agent Memory is available through a binding in Cloudflare Workers. - Agents running outside Workers can use the REST API. - The Cloudflare Agents SDK integrates it with session compaction, memory creation, and retrieval. - It can support: - Individual coding or personal agents - Self-hosted frameworks and managed agent services - Autonomous background agents that must survive restarts - Custom agent harnesses - Shared knowledge between engineers, agents, and tools - Shared profiles can preserve coding conventions, architectural decisions, and other organizational knowledge that might otherwise be lost during context pruning. ## Practical Recommendation Agent Memory is positioned as a default persistent-memory layer for production agents: use ingestion during compaction, explicit remembering for critical facts, and retrieval when the agent needs historical context. Its private beta is particularly aimed at long-running, multi-session workloads where maintaining useful memory is more important than simply fitting more text into the context window.