ModelRefs / Long-Term Memory (Agents) — AI Glossary

Long-Term Memory (Agents) — AI Glossary

Persistent storage of information an agent accumulates across sessions, retrievable in future interactions.

Overview

Long-term agent memory persists beyond context window limits using vector or key-value stores. Agents write important facts, user preferences, and past task outcomes to long-term memory and retrieve relevant entries at the start of new sessions. Enables personalization, user preference learning, and continuity across multi-session workflows.

Reference details

Topicagents
Last reviewed2026-06-24

How it works

  1. A write policy decides what survives the session, because storing everything makes retrieval noisy and storing nothing makes the agent amnesiac.
  2. Entries are written as self-contained statements with a timestamp and a source, since a note that only parses inside its original conversation cannot be used later.
  3. At session start, or per turn, relevant entries are retrieved and placed in context — so the context window is still the working surface and this is what refills it.
  4. Updates must supersede rather than accumulate: a changed preference has to overwrite the old entry or both will be retrieved.
  5. Nobody curated any of it, which is why provenance and expiry matter more here than in a corpus someone authored.

Example: Why a write policy is the design, not the store

An agent with 200 turns a week writing every turn accumulates 10,400 entries a year. Retrieving the top 5 from that store means 5 of 10,400, so precision depends entirely on the embedding and most entries are never read again — they are cost and noise. Writing only durable facts, perhaps 2 a week, gives about 104 entries, where the top 5 is a meaningful fraction and a human could audit the lot. The store is the same technology in both cases; the policy is what made one usable.

Commonly confused with

The counterpart to working memory: this is what persists once the context window is gone. It is not RAG — a RAG corpus is documents you supplied, while this accumulates from the agent's own interactions, which means nobody curated it and stale entries stay retrievable until something removes them. Episodic and semantic memory are the two forms it usually takes.

When to use it

Reach for it when:

  • Facts about a user or task must persist across sessions for continuity or personalisation.
  • Re-stating the same background every session is wasting context and the user's patience.
  • The agent's own interactions are the source of knowledge nobody else will author.

Reach for something else when:

  • The knowledge is authoritative and should be curated as a corpus rather than accumulated.
  • Everything needed fits in the context window for the task's duration.
  • No write policy or supersede rule exists, in which case the store grows into noise.

Continue your research

Use these connected ModelRefs sections to compare alternatives, inspect implementation paths, and review the evidence and governance boundaries relevant to Long-Term Memory (Agents) — AI Glossary.

Frequently asked questions

What is Long-Term Memory (Agents)?

Persistent storage of information an agent accumulates across sessions, retrievable in future interactions.

What concepts are related to Long-Term Memory (Agents)?

Closely related concepts include memory store, working memory, retrieval pipeline.