Skip to content

Explainer

The 4 types of AI agent memory: semantic, episodic, procedural & working

AI agents borrow their memory model from human cognition. Understanding the four types — and which are long-term — is the key to building agents that don't start from zero every session.

By the OctaMem teamPublished 7 min read

AI agents use four types of memory adapted from human cognition: semantic memory (facts and knowledge), episodic memory (past events and interactions), procedural memory (learned skills and behaviors), and working memory (the transient state of the current task). The first three are long-term and must be stored outside the model; working memory is short-term and lives in the context window. This taxonomy is formalized for language agents in the CoALA framework (Cognitive Architectures for Language Agents).

1. Semantic memory — facts and knowledge

Semantic memory holds general facts, independent of when or how they were learned. For a human, that’s knowing Paris is the capital of France. For an agent, it’s the durable facts about a user, domain, or entity: the customer is on the Enterprise plan, this codebase uses TypeScript, the company’s fiscal year starts in April. Semantic memory answers the question “what is true?”

2. Episodic memory — events and experiences

Episodic memory records specific events tied to a time and context. Where semantic memory stores the fact, episodic memory stores the moment: on March 3, the customer asked to downgrade after a billing issue. This is what lets an agent say “last time we spoke, you mentioned…” instead of treating every conversation as the first. Episodic memory answers “what happened?”

3. Procedural memory — skills and behavior

Procedural memory is knowing howto do something — the agent’s learned behaviors, workflows, and tool-use patterns. For a human it’s riding a bike without thinking about it. For an agent it’s the accumulated know-how of how this team formats a release note or which steps a refund requires. Procedural memory answers “how do I do this?”

4. Working memory — the current context

Working memory is the short-term scratchpad: the current conversation, the task at hand, whatever is in the model’s context window right now. It is fast and immediate but transient — when the session ends or the context window fills, it is gone. Working memory is nota substitute for long-term memory, and confusing the two is the most common reason agents “forget.”

The four types at a glance

Memory typeStoresExampleLifespan
SemanticFacts & knowledgeCustomer is on the Enterprise planLong-term
EpisodicEvents & interactionsOn Mar 3 they asked to downgradeLong-term
ProceduralSkills & behaviorHow this team writes release notesLong-term
WorkingCurrent task stateThe active conversationShort-term (context window)
The three long-term types must be stored outside the model and retrieved back into working memory when relevant.

How agents use memory

The three long-term types live outside the model. At query time, the relevant memories are retrieved into working memory (the context window), the LLM responds, and new facts are captured back — a loop that lets the agent compound knowledge over time.

Why typed memory matters

Many memory systems store everything as one undifferentiated pile of embeddings and rely on similarity search to guess what is relevant. Keeping the types separate — a typedmemory model — makes retrieval more precise (you can ask specifically for facts vs. events), and it makes memory auditable: you can see what an agent knows, where each memory came from, and remove it on request. That last point matters most in regulated industries, where “prove the agent forgot this” is a real requirement.

This is the model behind OctaMem’s memory layer: semantic, episodic, and procedural memory stored as typed records with provenance, retrievable across sessions, models, and tools. If you want to try it in practice, see how to add persistent memory to Cursor and Claude.

Frequently asked questions

What are the types of memory in AI agents?

AI agents draw on four memory types adapted from human cognition: semantic memory (facts and knowledge), episodic memory (past events and interactions), procedural memory (learned skills and behaviors), and working memory (the transient, in-context state of the current task). Semantic, episodic, and procedural are long-term; working memory is short-term and lives in the model's context window.

What is the difference between semantic and episodic memory?

Semantic memory stores general facts independent of when they were learned ('the customer is on the Enterprise plan'). Episodic memory stores specific events tied to a time and context ('on March 3, the customer asked to downgrade'). Semantic answers 'what is true'; episodic answers 'what happened'.

Is the context window the same as memory?

No. The context window is working memory — it holds only the current conversation and is lost when the session ends or the window fills. Long-term memory (semantic, episodic, procedural) must be stored outside the model and retrieved back into context when relevant. That is what a persistent memory layer provides.

How do agents store long-term memory?

Long-term memory is stored in an external system — a database, vector store, knowledge graph, or a dedicated memory layer — and retrieved into the model's context at query time. Systems differ in whether memory is inferred automatically by an LLM or written as explicit typed records with provenance.

Give your agents memory that lasts.

Start free with 2 GB of persistent memory and full SDK access — no sales call required.