concept · concepts/Agent Memory.md
Agent Memoryauto-ingested
Knowledge an AI agent gains from experience (its work with users and on tasks) and keeps between sessions as readable context, such as a folder of notes. It is distinct from weight updates, in-context learning and compaction (Anthropic — The Components of Agent Memory).
Explanation
The core bind. An agent has to decide what is worth saving before it knows what comes next. Every note is therefore a prediction that the pattern will matter again and that a future session can trust it without re-checking.
The components (as Anthropic breaks them down):
- Notes written in-session: salient events tagged or written to a memory store as they happen. This works like the hippocampus's fast encoding.
- Offline consolidation: dreaming replays logs and transcripts to correct, restructure and prune notes.
- Representations: structures that make memory navigable, chiefly the Agent-Maintained Wiki.
- A hierarchy: a small top layer that is injected into every session (an index such as
MEMORY.md), with deeper layers read or searched only when needed. The top layer must stay small, because injected notes cost tokens, wrong ones spread into every session, and long instruction files reduce adherence.
Salience is the skill. The Pokémon comparison is the clearest evidence:
- Sonnet 3.7 hoarded 413 files and earned 1 badge. Its archive kept going stale, and it spent its time maintaining memory instead of playing.
- Fable 5 kept 9 files plus a
global.mddashboard and earned 4 badges.
The rule Fable 5 followed: store what exists only if you work it out (strategy, plans, tested rules). Don't store what the environment shows you every turn.
Closing the loop. Stronger models write entries that pair a rule with how they know it's true and warnings about traps, and they mark facts as confirmed or unconfirmed. That is provenance tracking inside the agent's own notes.
Steering. Tell the agent what memory is for, not how to use it. Fixed rules ("record only failures") cut the memory gain for strong models. Explicit procedures ("read memory first, test your theories") nearly doubled a weaker model's score.
Why it matters / where it shows up
- This wiki is a human-facing instance.
raw/corresponds to transcripts,wiki/to the representation,index.mdto the injected index, and LINT to dreaming. Its provenance states (active / draft / seed) do the confirmed-vs-unconfirmed marking that Opus 5 learned to do. See Method Reflection (T5). - Institutional memory for team agents. Personal vs Team Agents values agents that "retain company context." This page describes how that retention actually works, and how it fails when several agents overwrite one shared page.
- Do It Once, at the Right Place, applied to memory. Persist what was expensive to work out. Re-read what is cheap to observe.
Open questions
- When to write: in-session (immediate, but distracting) or offline (backgrounded, but delayed)?
- Keeping memory current: re-checking everything costs too much. Should checks focus on volatile notes, or on frequently accessed ones?
- Search vs. representation as the foundation: the source finds the two complement each other, but representations need upkeep and can accumulate errors.
- Does the "salience over hoarding" lesson apply to human note-taking, and to this wiki's habit of writing everything down?
Connections
- Distributions over Best Fits — a tension with salience: in scientific modeling the discarded alternatives carry the insight (Anthropic — Teaching AI to Build Scientific Models). Reconcilable under "persist what was expensive to work out": a ruled-out alternative is expensive knowledge, not clutter. See Method Reflection T5.
- Dreaming (Offline Memory Consolidation) — the offline half of the memory system.
- Agent-Maintained Wiki — the main representation evaluated.
- Metacognitive Strategies — "what memory is for, not how" sits alongside Willingham's cue-vs-capability point.
- Do It Once, at the Right Place — store what is costly to re-derive.
- Personal vs Team Agents — continuity and institutional memory.
- Claude Code —
MEMORY.mdauto memory, capped at 200 lines / 25 KB. - Agent Autonomy Spectrum — long-horizon autonomy depends on memory that survives across sessions.
Sources
- Anthropic — The Components of Agent Memory — definitions, CL-Bench and Pokémon evidence, the steering experiments, and the hierarchy.