← Knowledge

Persistent Agent Memory

How an agent preserves useful state across conversations without treating the entire past as equally relevant.

Persistent agent memory is information stored across conversations so that an agent can use prior experience in later behavior. It is not equivalent to retaining a complete transcript. A useful memory system must decide what to preserve, how to retrieve it, when to revise it, and which information should enter the model's limited active context.

The Agent Memory subject map places persistence inside a larger lifecycle of storage, routing, compaction, provenance, observability, and restoration.

Memory layers

Active context contains the information directly available to the model during an inference. Searchable memory stores material that can be retrieved when relevant. Archival history preserves a fuller record for provenance, recovery, or later analysis without implying that every event should shape the current response.

MemGPT formalized this as a memory hierarchy managed partly by the agent. Current systems such as Letta Code also use versioned files and context repositories so memory can be inspected and changed through ordinary computer tools.

Retrieval and routing

Storage answers whether information still exists. Routing answers whether the agent loads the right information at the right time. Many apparent memory failures are routing failures: the relevant fact is present but no retrieval trigger activates it.

Similarity search is one routing method, but the nearest text is not always the most useful context. Names, projects, relationships, dates, and recurring concepts often need explicit routes to canonical sources. Routing-based agent memory combines store selection, semantic search, ownership maps, indexes, and task-specific retrieval rules.

Compaction and external memory

Context compaction reduces older interaction history to a smaller working representation. This keeps the current prompt bounded but can discard provenance, uncertainty, and open obligations. Durable external memory and raw history remain necessary when later work needs exact evidence rather than the summary's interpretation.

Revision and provenance

New evidence can append a new event, correct an old claim, or change the current state. Those operations should remain distinguishable. Silently rewriting memory makes later behavior difficult to audit; endlessly appending contradictions makes current truth difficult to retrieve. Version history and canonical ownership let a system revise while preserving what changed and why.

Memory portability supports agent identity and continuity across models and runtimes. Portability requires more than an export: the restored agent must recover the structure that tells it which memory is current, which is historical, and when each source should be loaded.

Sources

  1. MemGPT
  2. Letta agent memory
  3. What does good AI memory feel like?

Connections

Related

Linked here

Suggest a correction ↗