Glossary
Episodic memory
Episodic memory in AI is an agent’s record of specific past events, each tied to a time and context, such as what a user asked last week and how it was resolved.
Episodic memory in AI is the record of specific events an agent has taken part in or observed, each tied to a time and a context: what happened, when, who was involved and how it turned out. An agent with episodic memory can recall that a user reported a billing error last Tuesday, that a deployment failed after a particular configuration change, or that a customer turned down a proposal in March. The term comes from cognitive psychology, where Endel Tulving separated memory for personal experiences from memory for general knowledge in 1972. In agent design it sits beside semantic memory, which holds what is true in general, and procedural memory, which holds how to do things.
Episodic memory answers questions that start with “when did”, “what happened” and “last time”. It is the part of an agent’s long-term memory that keeps experience in sequence, so the agent can reason about change over time instead of only the latest state of the world.
How episodic memory differs from other kinds of memory
Most agent architectures borrow four categories from psychology. They overlap in practice, and a single conversation usually feeds more than one of them, but the distinctions help decide what to store and how to retrieve it.
Type | What it stores | Example | Typical form |
|---|---|---|---|
Episodic | Specific events with time and context | “On 4 May the user asked to move the launch to June” | Timestamped records, logs, summaries of sessions |
General facts and preferences | “The launch is in June” | Facts, profiles, knowledge graph entries | |
How to do things | “Run the migration before the deploy” | Prompts, rules, tools, code | |
What the agent is using right now | The current plan and the last few messages | Context window contents |
The line between episodic and semantic memory is the one people blur most often. “The user moved to Berlin in April” is an episode. “The user lives in Berlin” is the semantic fact it supports. An agent needs the fact to answer most questions quickly, and the episode to answer questions about history, to explain why it believes the fact, and to notice when a newer episode should replace it. The episodic vs semantic memory entry compares the two side by side, and the episodic vs semantic memory for AI agents post looks at how the split plays out in production.
Episodic memory is also distinct from short-term memory. Short-term memory holds the current session in the prompt. Episodic memory holds earlier sessions outside the model, so they can be retrieved selectively when they become relevant again.
What an episode contains
An episode is more than a line of transcript. The records that prove useful later tend to carry five things.
Time. When the event happened, and ideally when it was recorded, since the two can differ. Without a timestamp an agent cannot tell an old complaint from a new one, and it cannot answer “what changed since last month”.
Participants and context. Who was involved, which account or project it concerned, and which channel it came through. This is what lets the agent scope recall to the right user or tenant, and it is where entity resolution matters: “Sam”, “Samantha Lee” and the sender of an email may be the same person.
Content. What was said or done, in a form compact enough to retrieve. Full transcripts are rarely the right unit. A sentence or two that states the event plainly is easier to search and cheaper to put back into a prompt.
Outcome. What resulted: whether a refund was issued, a bug fixed, an offer accepted. Outcomes are what make episodes useful for planning, because they let an agent avoid repeating a step that failed. A record of an agent’s own choices and their results is often called a decision trace.
Source. Where the record came from, so the agent or a person can check it. Source attribution also helps when an episode turns out to be wrong and has to be corrected or removed.
How agents store and retrieve episodes
The simplest approach is to keep every conversation thread and search it later. That works for small volumes but scales badly. Threads are long, mostly small talk and tool output, and a search over raw text returns passages that resemble the query rather than the event the agent needs.
A more common design extracts events as they happen and stores each one as a short, timestamped record. Each record is indexed for search, usually with an embedding for meaning and a keyword index for names, codes and dates, which is the pattern described under hybrid search. At query time the agent searches for episodes related to the current task and places the best few in its prompt.
Plain relevance is not enough for episodes, because time matters. The influential generative agents research from Stanford in 2023 scored each memory on three signals: relevance to the current situation, recency, and importance. Recency weighting favours recent events, so last week’s complaint outranks one from two years ago when both match. Importance scoring favours events that changed something, so a cancelled contract outranks a routine status check. Many production systems now combine some version of these signals with reranking and query expansion to improve the shortlist.
Retrieval also has to respect scope. An agent serving many customers must only see episodes from the customer it is talking to. This is a storage question as much as a search question, and it is why isolation is usually enforced per user or per tenant rather than with a filter on every query.
From episodes to facts
Episodes accumulate quickly. A support agent might record thousands of events per customer over a year, and most of them only matter for what they imply. Turning many episodes into a smaller set of current facts is called memory consolidation. Ten conversations in which a user asks for metric units become one preference. Three episodes describing a plan upgrade become one fact about the current plan, with the episodes kept as history.
Some agents go further and periodically review recent episodes to draw higher-level conclusions, a step usually called reflection. A coding assistant that has seen the same test fail after five different changes might record that the test is flaky. Reflection is useful, but every inferred conclusion is a new opportunity for error, so it helps to keep a link from each conclusion back to the episodes that support it.
Consolidation is also where conflicts surface. If one episode says the user prefers email and a later one says they switched to Slack, the agent needs a rule for which wins. Usually the newer statement supersedes the older, while the older stays in the record so the agent can explain the change. The contradiction resolution entry covers the approaches, and memory drift describes what happens when nobody handles it.
Where episodic memory goes wrong
Volume without selection. Storing every event gives the agent more to search and more noise in each result. The case against storing every conversation sets out why selective capture tends to beat total recall.
Old episodes treated as current. A search that ranks only by similarity can surface an event from two years ago as if it describes today. Timestamps, recency weighting and consolidated facts all help the agent tell history from the present.
Fragmented identities. If the same person or project is recorded under different names, their history splits into pieces and recall looks incomplete. Resolving entities at write time is cheaper than reconciling them at read time.
Retention and privacy. Episodes often contain personal details. Teams need a data retention policy for how long they are kept and a way to delete them on request, which is the subject of the right to be forgotten in AI memory.
Poisoned records. An episode written from untrusted content, such as an email containing instructions, can mislead the agent every time it is retrieved. Memory poisoning describes the risk and the controls that reduce it.
A worked example
A customer support agent for a software company handles a user who writes in three times over six weeks. In the first conversation the user reports that invoices are being sent to the wrong address, and the agent updates the billing contact. Two weeks later the user asks about adding seats. Four weeks after that, the user writes: “The invoice problem is back.”
Without episodic memory the agent starts from nothing and asks the user to explain the invoice problem again. With it, the agent searches for earlier events related to invoices for this account and retrieves the first conversation: the date, the original problem, and the fix it applied. It can reply that the billing contact was changed on a specific date, check whether the change was reverted, and escalate with the full history attached. The seat conversation is not retrieved, because it is unrelated, even though it was more recent.
Over time the agent also consolidates. The episodes support a semantic fact (“billing contact is finance@example.com, changed 12 March”) and a pattern worth flagging (“invoice address issue has recurred twice”). The episodes remain available if a person later needs the timeline. Agents of this kind are described under customer support agents.
Episodic memory and RAG
Retrieval augmented generation and episodic memory both fetch stored text at query time, which is why they are often confused. RAG usually searches a shared document collection that changes on its own schedule. Episodic memory searches a record of what happened to this agent and this user, written by the agent as it works. The data has a different owner, a different shape and a different lifecycle. The RAG vs agent memory entry covers the distinction, and memory vs context window explains why simply keeping old sessions in the prompt is no substitute.
Where Exabase fits
Exabase Memory gives agents a long-term store that covers both episodic and semantic memory without a separate pipeline for each. Send a conversation or a piece of text to the Memory API and the M-1 engine extracts facts, preferences and events automatically, then organises them: it resolves contradictions when facts change, consolidates related memories and keeps a tree of concepts that evolves as new information arrives. Every memory has creation and modification timestamps, so the history of how a memory changed is available. The about memories guide describes the model.
Retrieval through the memory search endpoint is hybrid semantic and keyword search with recency bias, with optional query expansion and reranking controlled by three parameters. That means a query about an invoice problem returns the relevant event with recent memories ranked above stale ones. Memories can be scoped per user, project or agent with Bases, as the memory scoping guide explains, so one customer’s episodes never surface for another. When you need a record to stay exactly as written, the immutable flag stops the self-organising process from modifying or consolidating it.
M-1 is state of the art on LongMemEval and on BEAM at every scale evaluated, two benchmarks that test recall of events and facts across long histories; the results are on the research page. Exabase is the memory substrate: deciding what your agent should do with an episode, such as escalating a repeat issue, remains your application’s logic. The agent memory solution page covers the wider pattern, and Exabase vs Zep compares it with another approach to conversational memory.
Frequently asked questions
What is episodic memory in AI?
It is an agent’s record of specific past events, each tied to a time and context, such as what a user asked on a given day and how the request was resolved.
How is episodic memory different from semantic memory?
Episodic memory stores events (“the user moved to Berlin in April”), while semantic memory stores general facts (“the user lives in Berlin”). Agents usually derive semantic facts from episodes and keep the episodes as history.
Do AI agents need episodic memory?
Agents that work with the same users or projects over time usually do. It lets them answer questions about history, avoid repeating failed steps and explain why they believe something. Single-turn tools often do not need it.
How should episodes be stored?
As short, timestamped records with participants, content, outcome and source, indexed for both meaning and keywords. Raw transcripts are harder to search and more expensive to place back in a prompt.
How do agents choose which episodes to recall?
By combining relevance to the current query with recency and importance. Reranking and query expansion can improve the shortlist, and scoping by user or tenant keeps unrelated history out.
What is the difference between episodic memory and a chat log?
A chat log is raw material. Episodic memory is a selected, structured record of the events in it, with time, context and outcome, built so the right event can be found later.
Does Exabase support episodic memory?
Yes. Exabase Memory extracts events along with facts and preferences, timestamps every memory, and retrieves with recency bias, scoped per user or project with Bases.
Related pages: semantic memory, episodic vs semantic memory, procedural memory, working memory, long-term memory, memory consolidation, agent memory solution, episodic vs semantic memory for AI agents, long-term memory use case, Generative agents, Reflection