Agent Memory & Context Graphs · 1 of 5
Episodic, Semantic, and Procedural Memory for Agents
Reliable agents need more than a big context window. They need three kinds of memory, each answering a different question and carrying a different trust.
A single model call has a limited view: whatever fits in its context window, the span of text it can consider at once. A real agent, though, works across turns, sessions, tools, and decisions, and it needs continuity that outlives any one call. That continuity is memory. But memory is not one thing. Borrowing from how cognitive scientists describe human memory, a capable agent benefits from three distinct kinds, each answering a different question and demanding a different level of trust. Get the distinction right and the agent grows more reliable over time; blur it and the agent grows more dangerous.
Memory is the substrate
Everything else an agent does rests on memory. Context engineering can only surface what memory contains. Tools can only act on what memory describes. The harness can only enforce what memory records as policy. And any learning loop is only as good as what gets written back.
So memory is not a convenience feature bolted on at the end. It is the substrate the rest of the system stands on, which is exactly why its structure matters so much.
Three kinds of memory
It helps to separate memory into three types that serve genuinely different purposes. Episodic memory stores events, what happened. Semantic memory stores facts, what is true. Procedural memory stores methods, how the work is done.
Keeping them distinct matters because they are trusted, updated, and used differently. Collapsing them into one undifferentiated store is how agents end up treating a stray observation as a durable fact.
Episodic: what happened
Episodic memory is the log of experience: a prior triage run, a past tool call and its result, a failed attempt, a human approval, a false positive with its evidence. Each entry is tied to a moment and a context.
Its value is that it lets an agent recall specific situations rather than reasoning from scratch every time. Its risk is that an episode is just something that happened, not something that is true; treated as fact, a single bad episode can mislead every later decision.
Semantic: what is true
Semantic memory holds facts and relationships that hold across situations: this service uses a particular framework, this repository centralizes output encoding, this endpoint modifies account data, this policy requires approval for privileged operations.
These are the durable truths an agent reasons over. Because they carry more authority, they deserve a higher bar to enter: a fact should be validated before it is trusted, not promoted straight from a passing remark.
Procedural: how the work is done
Procedural memory stores methods and playbooks: how to triage a finding, how to validate an issue, how to review a tool for excessive privilege, how to escalate a high-risk action, how to verify that a fix actually holds.
This is the agent's know-how. Its subtle failure mode is procedural drift: continuing to follow an old method after the tools or policies it assumed have changed. Procedures need versioning and review just like facts do.
Tiers: from working to long-term
Cutting a different way, memory also lives in tiers by how long it lasts. Working memory is what is in the model's context right now. Short-term memory spans a session. Long-term memory is durable across sessions. And procedural knowledge is the most stable of all, changing only when methods do.
Distinguishing tiers keeps the system honest about lifetime and trust: what is ephemeral should not silently become permanent, and what is permanent should not be rewritten by a single fleeting turn.
The learning loop that feeds memory
The three types connect through a loop. The agent observes an outcome, stores it as an episode, distills recurring episodes into semantic facts, and refines its procedures from what reliably works. Then it reuses all of it on the next task.
This loop is where an agent gets better with experience, and also where it can quietly get worse. Whether the loop improves the agent depends entirely on the discipline that governs what is allowed to move from episode to fact to procedure.
What a practitioner decides
Designing agent memory means deciding, deliberately, which store an item belongs in, how long it lives, and what bar it must clear to be trusted. An episode should not masquerade as a fact; a fact should not be set by a single turn; a procedure should not outlive the tools it assumed.
The question to ask of any remembered thing is not just do we have it. It is: what kind of memory is this, how much should we trust it, and how long should it last?
Key takeaways
- Memory is the substrate: context, tools, policy, and learning all depend on it.
- Separate episodic (events), semantic (facts), and procedural (methods) memory.
- An episode is something that happened, not something that is true; don't treat it as fact.
- Semantic facts deserve a higher bar to enter, and should be validated before trust.
- Procedures drift when tools or policies change; version and review them.
- Distinguish tiers by lifetime so the ephemeral never silently becomes permanent.
Glossary
- Episodic memory
- A store of specific events and experiences an agent has had, tied to a moment and context.
- Semantic memory
- A store of durable facts and relationships that hold across situations.
- Procedural memory
- A store of methods and playbooks describing how the agent does its work.
- Working memory
- What is in the model's context window right now, the most ephemeral tier.
- Long-term memory
- Knowledge that persists durably across sessions.
- Context window
- The finite span of text a model can consider in a single call.
- Procedural drift
- Following an outdated method after the tools or policies it assumed have changed.
- Distillation
- Turning recurring episodes into validated semantic facts.