Agent Memory Types: How AI Agents Remember What Matters

Agent Memory Types: How AI Agents Remember What Matters

Agent memory types are the different ways an AI agent stores and recalls information across a conversation or a task. A language model on its own is stateless: it remembers nothing between calls unless something outside the model keeps a record. The central question is therefore practical, not philosophical: which kinds of memory does your agent need, and what should each one remember? An agent that remembers everything drowns in context, while an agent that remembers nothing repeats its mistakes and asks the same questions twice.

The answer is that most useful agents combine several memory types. Short-term memory holds the current conversation, episodic memory recalls specific past events, semantic memory stores general facts, procedural memory keeps reusable skills, and long-term memory carries what matters across sessions. Each type solves a different problem, and each fails in a different way when it is used for the wrong job.

Key takeaways

  • Agent memory types split into short-term, episodic, semantic, procedural and long-term memory.
  • Short-term memory is fast and exact but limited by the context window.
  • Semantic and episodic memory trade exact recall for durable, searchable knowledge.
  • Procedural memory stores reusable skills and routines rather than facts.
  • The right design combines types, with clear rules for what gets written, kept and forgotten.

What is agent memory?

Agent memory is any information an agent keeps outside the model itself and brings back into later reasoning. When a user sends a message, the agent cannot see anything the model was not given in that call, so memory is the mechanism that bridges the gap between calls. It can be as simple as the transcript of the current chat, or as elaborate as a database of past decisions, user preferences and learned procedures.

Memory matters because agents take actions over time. A support agent that forgets a customer’s earlier complaint asks for the same details again, and a research agent that forgets which sources it already checked repeats work and may contradict itself. In each case the failure is not in the model’s reasoning but in what was available to reason about.

Think of memory as a system with three jobs: writing, retrieval and forgetting. Writing decides what gets recorded, retrieval decides what comes back, and forgetting decides what gets dropped or summarised, because keeping everything is not a strategy.

Short-term memory: the working context

Short-term memory, sometimes called working memory, is the record of the current conversation or task. It usually holds the recent messages in full, in order, so the agent can follow the thread of what is happening right now. This is the most common form of agent memory, and for many simple agents it is the only one. Best for: single-session conversations, short tasks and any situation where the last few turns contain everything the agent needs.

Its strength is fidelity: the raw messages are preserved, so the agent can quote them and follow the thread exactly. Its weakness is size. Every message consumes tokens, and long conversations eventually hit the model’s context limit. The usual fixes are a sliding window that keeps only the most recent turns, or summarisation that compresses older turns into a recap.

Keep the full transcript while the conversation is short, then switch to a window plus a running summary once it grows. The summary should capture decisions, open questions and preferences, not just topics. For more, see our guide to LLM conversation state management.

Episodic memory: remembering specific events

Episodic memory stores records of specific past events: what happened, when it happened and what the outcome was. An agent with episodic memory can answer questions such as what it did for a user last Tuesday, which approach failed on a similar task last month, or what a customer complained about in a previous session. Each memory is a distinct episode, usually stored with a timestamp and some context about the situation.

Episodic memory is retrieved by similarity or by time. When a new situation resembles a past one, the agent pulls the relevant episodes to guide its next move. This is powerful where the same problems recur, but retrieval needs ranking and filtering, not just similarity, or it will surface outdated episodes.

The main risk is over-generalising from one episode. A single past failure does not prove an approach is always wrong, so episodic memory should be presented as dated evidence, not as a rule. Best for: support histories, incident records and any agent that learns from concrete past cases.

Semantic memory: facts and knowledge

Semantic memory stores general facts and knowledge rather than specific events. It holds things such as the user’s name and preferences, product details, company policies and domain facts the agent should know. Unlike episodic memory, it does not care when a fact was learned; it cares whether the fact is true and still current. Best for: user preferences, product knowledge, policies and any stable facts the agent needs across many conversations.

Semantic memory is often stored as structured facts or text chunks in a vector store, retrieved by similarity to the current question. The hard part is maintenance: facts change, and a semantic memory without an update rule becomes a museum of stale facts the agent trusts blindly. Every fact should carry a source and a date.

Conflicts are the other hard part. When a new fact contradicts an old one, keep the latest verified fact as current and archive the older one with its date. Our guide to AI knowledge base architecture explains how retrieval systems organise facts so agents can find them reliably.

Procedural memory: skills and routines

Procedural memory stores how to do things rather than what is true. It holds reusable routines: the steps for onboarding a new customer, the checklist for triaging a support ticket, the approved way to format a report. An agent with procedural memory does not have to rediscover the process each time, and it follows the same process consistently. Best for: repeated workflows, standard operating procedures and any task where consistency matters more than improvisation.

Procedural memory can live in prompts, tool definitions or a library of skills. The form matters less than the discipline: procedures should be versioned and tested, so improvements do not vanish and broken steps are caught before production.

The risk is rigidity. An agent that follows a routine blindly applies it where it does not fit, so good procedures state when to use them, when to stop and when to ask a person.

A tidy desk with labelled folders and a notebook, representing organised agent memory
Memory works best when each type has a clear job: the conversation stays short-term, facts stay searchable, and routines stay reusable.

Long-term memory: persistence across sessions

Long-term memory is the umbrella term for anything that survives beyond a single session. It is not a separate storage technology but a property: episodic, semantic and procedural memories all become long-term memory when they are persisted and carried into future conversations. The question is not whether to have long-term memory but which memories deserve to persist. Best for: returning users, ongoing projects and agents that work with the same people over weeks or months.

Persistence brings responsibility. Memories that cross sessions can include personal details, so users should be able to see what an agent remembers about them, correct it and ask for it to be deleted. Retention rules should be set before the first memory is written, not after a user asks an awkward question.

Memories can be scoped to a user, a team, a project or the whole system. Mixing scopes by accident leaks information between users, so scope should be part of the memory record itself, checked on every read. For a production view, see our guide to AI agent memory architecture.

Comparing agent memory types

Memory type What it stores How long it lasts Main strength Main risk
Short-term The current conversation, in full One session Exact and immediate Fills the context window
Episodic Specific past events and outcomes Weeks to years Learns from real cases Outdated or misleading cases
Semantic General facts and preferences Until superseded Searchable and reusable Stale facts trusted blindly
Procedural Routines and skills Until revised Consistent execution Rigid when context changes
Long-term Anything persisted across sessions Across sessions Continuity for returning users Privacy and scope mistakes

Most agents need at least two types. A support agent typically combines short-term memory for the live conversation with episodic memory for past tickets and semantic memory for product facts. A research agent may need little episodic memory but a great deal of semantic memory.

How to choose the right memory mix

Start from the user’s experience, not the storage technology. Ask what the agent should remember about a returning user after a week away, and what it should forget. If the answer is nothing, short-term memory is enough; if it includes preferences or ongoing projects, you need durable memory with clear rules.

Next, decide how each memory will be retrieved. A memory that is written but never retrieved is dead weight, and one retrieved at the wrong time is noise. Test retrieval with realistic questions before you trust it in production.

Then set the forgetting rules: how long each memory type lives, what triggers summarisation or archiving, and who can delete a memory. Forgetting is part of the design, not a failure mode. State management is closely related, and our guide to AI agent state management covers how agents remember, resume and stay safe.

Memory design checklist

  • Each memory type has a clear purpose and a named owner.
  • Short-term memory uses a window or summary before the context window fills.
  • Episodic memories carry dates, so the agent can weigh how fresh they are.
  • Semantic facts carry a source and a date, and conflicts have a resolution rule.
  • Procedures include when to use them, when to stop and when to escalate.
  • Long-term memories are scoped to a user, team or project, and scope is checked on read.
  • Users can view, correct and delete what the agent remembers about them.
  • Retrieval is tested with realistic questions, not just with the examples used to build it.
  • Forgetting and archiving rules are written down before the first memory is stored.
  • Memory failures are logged, so bad recall can be traced to a write, a retrieval or a rule.

Frequently asked questions

What are the main agent memory types?

The main types are short-term memory for the current conversation, episodic memory for specific past events, semantic memory for general facts, procedural memory for reusable routines, and long-term memory for anything persisted across sessions.

Do all agents need long-term memory?

No. Agents that handle one-off tasks, such as answering a single question or summarising a document, work well with short-term memory alone. Long-term memory is worth the extra complexity only when users return and expect continuity.

How is agent memory different from a context window?

The context window is the model’s short-term working space: whatever is placed in it is visible to the model right now. Agent memory is the system that decides what goes into that window, what stays in storage, and what gets retrieved later. Memory manages the context window; it is not the same thing.

Can an agent have too much memory?

Yes. Too much retrieved context distracts the model, increases cost and can surface stale or irrelevant information. Good memory design is selective: it retrieves a small amount of relevant material and leaves the rest in storage.

How should an agent forget?

Forgetting should be a rule, not an accident. Common approaches are time-based expiry, summarising old detail into a short record, archiving memories that are no longer retrieved, and deleting personal data on request. The rule should be written down and applied consistently.

Is vector search the same as agent memory?

No. Vector search is a retrieval technique, not a memory type. It is often used to retrieve episodic and semantic memories by similarity, but the memory itself is the stored record and the rules around it, not the search index.

Latest articles

Scroll to Top