Frontier Foundry

Agent Memory

The Library · Context Engineering & Memory

Letting agents keep and recall information across sessions.

Also called: long-term memory, memory system, episodic memory, memory layer, persistent memory, memory tool. In the glossary.

Agent Memory is cooling this week (×0.4 against the eight weeks before). What is moving.

How it works, as a machineThe Handover Station · memory notes

Follow one memory note from a moment in one session to the start of the next session, in a hospital ward's handover station at shift change.

  1. Write the memory note
  2. File the note
  3. Check it against the log
  4. Link the notes
  5. Pin it to the index
  6. Load the index
Play Agent Memory

Agent Memory in plain words

Agent memory lets an agent keep information between sessions. Notes are written to a store outside the model, and the relevant ones are brought back into context when a later task needs them. The agent stops starting from zero each time, and stale or wrong notes become a new way to fail.

An analogy

A detective's notebook. The detective forgets each case overnight, but the notebook does not, so every morning begins with yesterday's pages. A wrong entry made on Monday is believed again on Friday unless somebody crosses it out.

How Agent Memory connects

11 typed relations in the knowledge graph

Builds on

  • Context Engineering: The index is the always-loaded layer of what a session starts with; its size is a context budget.
  • Continual Learning: Corrected notes and a rebuilt profile are learning outside the weights.

Built on by

  • Agent Harness: What survives a session and is loaded on the next.
  • ARC-AGI: The notes folding press is the memory the harness keeps, drops or folds.
  • Context Engineering: The archive wing is memory across sessions: write after, load before, retire what is stale.
  • Embeddings: A memory store is pins of this kind, and it moves between devices only while the same embedding model is kept.
  • Knowledge Graphs: A memory kept as a graph is built at this desk and walked at the wall.
  • Long-Horizon & Background Agents: The log, the entries and the ranked recall are what an agent memory is made of.
  • Sycophancy: The history drawers are the agent memory that is retrieved into the prompt and pulls the reply toward the user.

Makes possible

An alternative to

Often in the same sources

Long-Horizon & Background Agents, AI Agents

See Agent Memory in the knowledge graph

Who is behind Agent Memory

people, labs, products and models

People

  • Andrej Karpathy (popularized): The 'LLM Wiki': an agent-maintained personal knowledge base.
  • Harrison Chase (champions): Promotes wiki-style memory and an open standard for agent memory.

What the sources say

3 parts · 13 sources · updated 2026-11-27

Agent memory is what an agent keeps from experience between sessions: notes written in the moment, corrected and linked by a background pass called dreaming, and a small top layer loaded into every new session. The sources agree that what is saved must be judged and checked, since a wrong note is believed again later; they differ on whether a dedicated memory system beats searching raw history.

Writing a note while the work is going on

While a session runs, the agent decides what is worth keeping before it knows what comes next, and writes it as a note in a store that outlives the session. A log of what happened is only evidence; it becomes memory when a lesson is turned into context the agent will read later.

  1. The chart table is where the watch officer jots what seems worth keeping, before knowing what the next watch will need.
  2. The note drawers keep each jotting as a filed note, scoped and stripped of secrets, in a store that outlives the watch.
413 files vs 9 files
Memory files written by two models about 10,000 steps into the same game: one saved everything and earned one badge, the other saved only what the screen did not show and earned four (the lab's own comparison) Anthropic
9 of 10 vs under half
How often a newer and an older model read their memory before answering a database question without being told to (the lab's own test) Anthropic
  • Agent memory is knowledge gained from experience that is kept between sessions as context to read later; it is not weight changes, in-context learning or compaction. Anthropic
  • An agent can tag salient events in a session log as they happen, or write them to a memory store such as a folder of notes; the open question is how it can know what is salient before it knows what comes next. Anthropic
  • Writing down a rule is a prediction that the pattern it describes will matter again; a verified fact written down is a prediction that a later session can lean on it without checking. Anthropic

The pass in the dark: checking, linking, forgetting

Between sessions a background pass, called dreaming, rereads the logs, tests notes against what really happened, merges and links them, and prunes. It fixes notes that were wrong from the start or have drifted, at the cost of compute and of notes that are not ready the moment they are needed.

  1. The night mate reads each note against the deck log and corrects what the log does not bear out.
  2. The cross-reference wall links notes about one subject into pages that point to each other.
13% → 48%
Share of graded criteria met on 25 questions about a company's 420M-token document set as agents built a wiki over more and more sessions (2 to 128), answering from the wiki alone (the lab's own test) Anthropic
54% → 61% vs 53%
Score with wiki plus search tool as the wiki grew, against a search tool alone Anthropic
1.77 times
Size of a wiki built from 10 documents (203 KB from 115 KB), which grew larger than the raw files it summarised Anthropic
about 5x less compute
Cut in the compute needed to serve the dreaming-based memory to free users, which is what let it reach them (the lab's own report) OpenAI
  • Agents can use idle time between sessions to reorganise their context and memory, reflecting on logs to fix mistakes or write new notes; the process is called dreaming. Anthropic
  • Dreaming tests a note against the original transcript, and the transcript gives a ground truth to validate memory against. Anthropic
  • With the corrected note the agent went back into the cave and reached the next city at action 1,935; the run with the uncorrected note and the run with no memory never got past the mountain. Anthropic

When it breaksMt Moon is behind me. A game-playing agent wrote down, wrongly, which side of a cave entrance a landmark stood on, then declared the cave finished and updated its notes. It walked off a one-way ledge three times, gave up, and never reached the next city. A dreaming pass that checked the note against the session transcript caught the error and rewrote it, and the next run went back into the cave. Anthropic

The next session reads the board

What gets promoted to the top of the memory hierarchy is loaded into every new session, so it must stay small and right. Below it, notes and logs are searched when needed. The result is judged by whether the next session acts better, and its outcome becomes the next jotting.

  1. The bridge board holds the few lines pinned for every new watch; it is read whole, so it must stay small.
  2. At dawn the new watch reads the board before it takes the helm, and acts on what it says.
200 lines or 25 KB
How much of an auto-memory index file one coding agent loads into every session Anthropic
4,000 vs 1,000 tokens
Length of the running profile one assistant adds to every chat, against another's; the longer one is updated every few days and the shorter every 24 hours (an outside researcher's reverse-engineering) Shlok Khemani
84.0% vs 14.4%
Share of indirect questions answered when the decisive memory sits in context, against the best of six memory systems that had to retrieve it Hugging Face
0.330 → 0.641
A weaker model's mean reward on a database task: no memory, then a memory folder alone (0.364), then a folder plus instructions to read it first and test its theories Anthropic
20 min → 2 min
Time one team reports for an agent to gather context, before and after its experience was kept Sparsh Jain
  • Dreaming can float notes to the top of the memory hierarchy, and the harness loads them into every session, so the agent need not search for them or know there is anything to search for. Anthropic
  • Promoting memory into every session must be done carefully: injected notes use tokens, an incorrect note can be carried into every session, and longer instruction files reduce adherence. Anthropic
  • The top layer stays small by moving details down the hierarchy and leaving links behind; the index file shows the agent what it knows and where to find it. Anthropic

Open questionIs a dedicated memory system worth building over searching the raw history?

  • Many dedicated memory systems underperform naive retrieval over the raw history, because the way memory reorganises facts can remove or hide evidence: a memory tax. Hugging Face
  • A typed multi-agent memory with a provenance index was the most accurate of the systems compared on four of five question-answering benchmarks. Hugging Face

Sources

13 in all

More in Context Engineering & Memory

The Library: the whole area
  • Context EngineeringDeciding what goes into a model's limited context window, when, and in what form.
  • Long ContextModels that read very long inputs (hundreds of thousands to millions of tokens).
  • Retrieval-Augmented GenerationFetching relevant documents at question time and putting them in the prompt.
  • EmbeddingsVectors that place similar meanings near each other, used for search and clustering.
  • Prompt EngineeringWriting instructions and examples that steer a model's behavior.
  • Prompt CachingReusing computation for repeated prompt prefixes to cut cost and latency.
  • Knowledge GraphsStoring facts as linked entities so agents can traverse relationships.