What it is used for

Large language models basically store nothing between two calls: the paper states that language models are stateless, meaning information does not persist after one call ends. An agent working through many steps needs memory of the steps already taken, and episodic memory is where that experience lives in the CoALA design.

Its first use is supporting reasoning while planning. During the planning stage of a decision cycle, stored episodes may be retrieved into working memory to support the agent's reasoning. Today's decision can then rest on what actually happened yesterday, not only on the instruction currently being received. Its second use is learning from experience: new experiences can be written from working memory into episodic memory, and the paper counts that act of writing itself as a form of learning. Stored episodes can later be retrieved again as examples and bases for reasoning or decision-making.

Its difference from the other two long-term memories shows in its contents. Semantic memory stores the agent's knowledge about the world and about itself, such as facts and conclusions. Procedural memory stores how to work: implicit knowledge inside the language model's weights and explicit knowledge written in the agent's code. Episodic memory stores events: the sequence of experiences the agent has passed through. Facts answer the question of what is true; episodic memory answers the question of what has happened to this agent.

How it is used

Within one decision cycle, episodic memory connects to working memory, the short-term memory that holds active information for the round in progress and serves as the central hub connecting the agent's components. The connection runs both ways. The first direction is retrieval: a retrieval procedure reads information from long-term memory into working memory, and for episodic memory that retrieval happens mainly at the planning stage, when the agent weighs its next step. The second direction is writing: after the agent lives through a new experience in working memory, that experience can be written into episodic memory as a form of learning, so it is available for later rounds.

The paper notes that retrieval can be implemented in various ways, including rule-based, sparse, and dense retrieval. Which way is used depends on the kind of information and the kind of memory. The paper also gives an access arrangement a designer can choose: in the design example it discusses, the agent is given read and write access to its episodic memory, so it can store new interactions, while its access to semantic and procedural memory is read-only, so it does not change its own knowledge and code.

One thing that sets episodic memory apart from procedural memory is its initial state. Episodic and semantic memory can start empty, and can even be absent entirely in a simple agent design. Procedural memory, in contrast, must be initialized by the designer from the start with proper code, because without it the agent cannot begin to work.

Real examples

The following examples were not invented for this article. Both are real systems analyzed inside the CoALA paper itself, in its memory section, its retrieval and learning action sections, and its case study chapter.

The first example is the generative agents of Park and colleagues, language agents grounded in a sandbox game that affords interaction with the environment and other agents. The CoALA paper books their arrangement in its case study table: these agents' long-term memory is episodic and semantic. Each agent has a long-term episodic memory that stores events in a list. Those events are retrieved through a combination of three scores: recency, which is rule-based; importance, which is reasoning-based; and relevance, which is embedding-based. The agents then use retrieval and reasoning to generate reflections on their episodic memory, for example a reflection reading "I like to ski now.", and those reflections are written into long-term semantic memory. This example shows the full arc of episodic memory: experience is stored as events, retrieved when needed, and part of the result graduates into knowledge.

The second example is Reflexion, by Shinn and colleagues. In its discussion of learning actions, the CoALA paper states that Reflexion uses a language model to reflect on failed episodes and stores the results as semantic knowledge to be attached to the model's context for solving later episodes; an example reflection result given by the paper reads "there is no dishwasher in kitchen". Here episodic memory plays the role of raw material: an episode of failure the agent lived through is not thrown away, but reflected on, and the lesson drawn from it is stored for later work. The paper also notes the same pattern from the reinforcement learning side: agents commonly store episodic trajectories of their experience, and experiences added to episodic memory may be retrieved later as examples and bases for reasoning.

Practitioner level

For an agent designer, episodic memory is one module in CoALA's four-module memory arrangement. Working memory holds active and readily available symbolic variables for the decision cycle in progress, including perceptual inputs, active knowledge produced by reasoning or retrieval, and core information carried over from the previous cycle such as the agent's active goals. Episodic memory stores experience from earlier cycles. Semantic memory stores knowledge about the world and the agent itself. Procedural memory stores the model's weights as implicit knowledge and the agent's code as explicit knowledge.

The paper gives a complete design example that can be followed. In its example of a personalized retail assistant that helps users find items based on their queries and purchasing history, the modules judged necessary are semantic memory containing the set of items for sale, episodic memory about each customer's previous purchases and interactions, procedural memory defining functions to query those datastores, and working memory to track the dialogue state. Retrieval of episodic memory about interactions with a user is recommended so that the user's search intent can be weighed from their history, and writing can be deferred to the end of the interaction by summarizing the episode first before storing it in episodic memory. This example is named as it is: it is a design example imagined and worked out by the paper itself, not a report of a deployment already running.

Two design decisions that always accompany this module are also booked by the paper. First, access rights: episodic memory is usually read and write, because the module's value lies precisely in new experience being continually added, while other memories can be locked to read-only. Second, the retrieval method: adaptive and context-specific recall remains understudied in language agents, the paper says, so today's designer chooses their own combination of rules, reasoning scores, and embedding similarity to fit the agent's task, like the three-score combination in the generative agents example above.

Expert level

At the advanced level, the CoALA formulation of episodic memory reads as the direct heir of an older cognitive architecture tradition. In the same paper's body, in its discussion of the Soar architecture, episodic memory is stated to store sequences of the agent's past behaviors, citing Nuxoll and Laird 2007, while semantic memory stores facts about the world. In Soar, experiences can be written to episodic memory and that information can later be retrieved back into working memory when needed for decision-making. CoALA carries that division of memory over to language agents: what changes is the material, namely text and language model output, while the division of memory types is kept.

Its action arrangement gives episodic memory two official doors. The first door is the retrieval action, a procedure that reads information from long-term memory into working memory. The second door is the learning action, the writing of information to long-term memory; the paper's subsection for this door is titled exactly "Updating episodic memory with experience". Between the two stands the reasoning action, which reads from and writes to working memory and can turn retrieved episodic content into new conclusions, including conclusions later written to semantic memory, as in the generative agents and Reflexion patterns in the Real examples chapter. The documented names in the paper are kept as they are at this level: episodic memory, semantic memory, procedural memory, working memory, decision cycle, retrieval, reasoning, and learning.

One design tension booked by the paper is worth noting. Writing to procedural memory, that is changing the model's weights or the agent's code, is judged significantly riskier than writing to episodic or semantic memory, because it can easily introduce bugs or allow an agent to subvert its designers' intentions. Episodic memory sits on the safe side of that tension: its contents are experience data that can be inspected, added to, and retrieved, without changing the machine that reads them. At the other end of its learning spectrum, the paper notes that stored episodic trajectories can also be used to tune the model itself, as in the XTX example, which periodically fine-tunes a small language model on high-scoring trajectories stored in episodic memory; that use is an advanced use of the same material, not the basic formulation of this memory type.

Limits and risks

The standing of this article's sources is stated plainly: almost every formulation here comes from one framework paper by the proposing team itself. The CoALA paper is a survey and organization paper, reviewing existing work and proposing directions forward; it is not an experiment paper that measures episodic memory on a benchmark. This article therefore carries no performance numbers for episodic memory itself, and readers should not read its module arrangement as proof that the arrangement is the best one; it is a naming and design framework proposed by its authors.

The paper itself records the unfinished side. Adaptive and context-specific recall is stated to remain understudied in language agents, even though retrieval is episodic memory's main door; a completely stored memory is not automatically used correctly if retrieval picks the wrong episode. The paper also books that some agents run with no episodic memory at all: in its case study table, ReAct is recorded as lacking semantic and episodic memory, and therefore as having no retrieval or learning actions. This memory type is a design choice, not a mandatory component of every agent.

Content risk follows from its basic formulation. Episodic memory stores experience as it comes, including experience that failed, was wrong, or was unusual; such episodes can be retrieved and influence later reasoning, and a reflection drawn from an episode can graduate into wrong semantic knowledge if the reasoning is wrong. The paper installs no filtering mechanism for that inside this memory type's formulation. Finally, this formulation is a 2023 formulation revised in 2024 inside one named framework, CoALA; other frameworks may divide agent memory differently, and this article does not state CoALA's division as the only valid one.