
The Four Types of Agent Memory
AGAI 203 · Context Window and Memory Foundations
Explore in-context, episodic, semantic, and procedural memory, and learn what each type is useful for in practical agent systems.
Key terms
in-context = visible working memoryepisodic = remembered eventssemantic = retrievable knowledgeprocedural = reusable processLearning objectives
- Describe the four major types of agent memory.
- Match memory types to practical agent use cases.
- Explain how multiple memory types work together in one system.
- Identify privacy, staleness, and reliability tradeoffs for memory.
Agent memory is not one feature. It is a set of design patterns for storing and retrieving information. Different tasks require different types of memory, and confusing them leads to brittle systems.
A practical taxonomy includes four major memory types:
- In-context memory — information currently visible in the prompt.
- Episodic memory — records of past interactions or events.
- Semantic memory — durable knowledge, facts, and documents.
- Procedural memory — reusable processes, workflows, and habits.
These categories overlap, but they provide a useful engineering vocabulary.
In-context memory
In-context memory is the information the model can see right now. It may include the current conversation, a task summary, tool results, retrieved documents, and explicit state.
Example:
Current task summary:
The user is comparing Pinecone, Weaviate, and Chroma for a small RAG application. They care most about ease of setup, cost, and local development.
This memory is fast and simple. The model does not need to retrieve it because it is already present. But it is limited by the context window and must be carefully curated.
Use in-context memory for:
- Current task state
- Recent conversation turns
- Active constraints
- Tool results needed immediately
- Output format requirements
Avoid using in-context memory as a dumping ground for every past detail.
Episodic memory
Episodic memory stores what happened. It is event-based.
A customer support agent might store:
{
"type": "support_episode",
"user_id": "user_123",
"date": "2026-06-04",
"summary": "User reported delayed order ORD-7711. Agent checked shipping status and created refund request draft.",
"outcome": "refund request pending approval"
}
Episodic memory helps agents maintain continuity. If the same user returns tomorrow, the agent can know that the refund request was already drafted.
Use episodic memory for:
- Prior conversations
- Completed tasks
- User feedback
- Past tool actions
- Decisions made in earlier sessions
Be careful with privacy. Not every event should be stored. Sensitive information should be minimized, access-controlled, and deletable.
Semantic memory
Semantic memory stores knowledge. It answers the question: what does the agent know about the world, a domain, a company, or a project?
Examples:
- Product documentation
- Company policies
- API references
- Research papers
- User-provided knowledge bases
- Project architecture notes
- Stable user preferences
Semantic memory is often implemented with retrieval systems. A document is split into chunks, embedded into vectors, stored in a vector database, and retrieved when relevant.
Example semantic memory record:
{
"doc_id": "policy_refunds_2025",
"chunk_id": "chunk_004",
"text": "Refund requests for delayed deliveries may be submitted when delivery is more than five business days past the promised date.",
"metadata": {
"source": "refund_policy",
"updated_at": "2025-11-12"
}
}
Use semantic memory for factual retrieval, documentation Q&A, research assistants, and enterprise knowledge systems.
Procedural memory
Procedural memory stores how to do things. It is memory for processes rather than facts.
Example:
{
"procedure_name": "triage_failed_build",
"steps": [
"Read the build error summary",
"Identify the first failing test",
"Inspect related files",
"Check recent dependency changes",
"Suggest minimal fix",
"Run tests again"
]
}
Procedural memory is useful for agents that repeatedly perform workflows: support triage, code review, incident response, report generation, compliance checks, or research synthesis.
This memory should often be explicit and versioned. If a procedure is wrong, the agent can repeat the wrong process many times.
How memory types work together
A single agent may use all four memory types.
Imagine a technical support agent:
- In-context memory tracks the current conversation.
- Episodic memory recalls the user’s prior ticket from yesterday.
- Semantic memory retrieves the official troubleshooting guide.
- Procedural memory follows the standard escalation workflow.
The combined flow might be:
User asks for help
→ Retrieve recent support episodes
→ Retrieve relevant troubleshooting guide
→ Follow support triage procedure
→ Keep current task state in context
→ Create final response or escalation
Each memory type has a distinct role.
Memory type tradeoffs
In-context memory: fast, direct, limited, expensive at scale
Episodic memory: good for continuity, can become sensitive or stale
Semantic memory: powerful for knowledge retrieval, depends on retrieval quality
Procedural memory: improves consistency, can preserve bad habits if unmanaged
The best memory system is intentional. Do not store everything. Do not retrieve everything. Do not assume old memory is correct.
Practical takeaway
Memory design starts by asking what kind of information the agent needs. Does it need current task state? Past events? Domain knowledge? Reusable procedures?
Once you know the memory type, you can choose the right storage and retrieval method. Treat memory as an application architecture decision, not a vague intelligence feature.
Sign in to track your progress.
Ask your AI guide
Ask anything about Memory & Context Management — The Four Types of Agent Memory, or choose a suggested question below.
AI responses are educational and may not be perfectly accurate. Press Enter to send, Shift+Enter for new line.