Last updated: 3/7/2026
What is episodic, semantic, and procedural memory in LLM applications?
Cognitive science classifies long-term memory into distinct types based on what is stored and how it is accessed. These categories translate directly into AI agent architecture decisions.
Episodic memory
Episodic memory records events: what happened, when, and in what context. For an AI agent, episodic memories are timestamped interaction records. 'On Tuesday, the user reported a deployment failing. We identified the issue as a missing environment variable. They resolved it.' This is an episode. Episodic memory enables agents to answer questions like 'what did we discuss last week?' and detect patterns over time — like noticing a user repeatedly encounters the same class of error.
Semantic memory
Semantic memory stores facts about the user divorced from any specific event. 'User prefers TypeScript over JavaScript.' 'User is building a B2B SaaS for healthcare.' 'User's production environment runs on AWS us-east-1.' These facts are true regardless of when they were learned. In AI systems, semantic memory is stored as discrete key-value-like facts with update semantics — when the user migrates from AWS to GCP, the semantic entry is overwritten in place, without touching episodic history.
Procedural memory
Procedural memory encodes how to do things: sequences of steps, workflows, agent behaviors. For AI agents, procedural memory often lives in the system prompt and tool definitions — the rules an agent follows that do not need dynamic retrieval. 'When reviewing a PR, always check for missing test coverage before style issues.' Unlike episodic and semantic memory, procedural memory is rarely retrieved via vector search; it is baked into the system prompt at design time or loaded conditionally by task type.
How they coexist in Mem0
| Memory type | Example | Storage pattern | Retrieval |
|---|---|---|---|
| Episodic | 'User reported login bug on March 3' | Timestamped summary | Recency + semantic similarity |
| Semantic | 'User uses FastAPI, prefers async' | Discrete fact with update semantics | Semantic similarity to query |
| Procedural | 'Always validate inputs before external API calls' | System prompt / rule store | Task-conditional loading |
Mem0 stores semantic and episodic memories in its hybrid vector and graph store. Procedural memory is typically managed by the developer as system prompt instructions, separate from the retrieval layer.
Ready to add memory to your AI?
Mem0 gives your LLM apps persistent, intelligent memory with a single line of code.
Get Started with Mem0 →