Understanding Agentic AI Memory
Learn how memory enables AI agents to retain context, recall past interactions, access knowledge, and execute complex tasks across sessions. Explore working, episodic, semantic, procedural, retrieval, and shared memory patterns used in modern agentic AI systems.
Types of Agentic Memory š§
Agentic memory is typically divided into several categories based on what is stored, how long it is retained, and how it is used during reasoning.
Memory Hierarchy in Agentic Systems
graph TD
A[Agent Memory]
A --> B["Short-Term Memory š¾"]
A --> C["Long-Term Memory š¢"]
C --> D["Episodic Memory š
"]
C --> E["Semantic Memory š"]
C --> F["Procedural Memory š"]
D --> G["Retrieval Layer š"]
E --> G
F --> G
G --> H["Vector Database ā"ļø]
Real Agent Memory usage
graph TD
A["User Query ā"]
A --> B["Working Memory š¾"]
B --> C["Reasoning Engine š§ "]
C --> D["Retrieval Layer š"]
D --> E["Vector Database āļø"]
D --> F["Knowledge Graph š"]
D --> G["Document Store š"]
E --> H["Semantic Memory š"]
F --> H
G --> H
C --> I["Episodic Memory š
"]
C --> J["Procedural Memory š"]
H --> C
I --> C
J --> C
C --> K["Tool Calls š§°"]
C --> L["Agent Response š¬"]
1. Short-Term Memory š¾ : Working Memory
Stores information needed for the current task or conversation.
Characteristics
- Session-scoped
- Fast access
- Temporary
- Usually stored in context window
Use Cases
- Chatbots
- Task execution
- Multi-turn conversations
Examples
User: Book a flight to Berlin
Memory:
- Departure: Munich
- Date: 15 July
- Airline preference: Lufthansa
2. Long-Term Memory š¢
An umbrella category that includes:
- Episodic memory
- Semantic memory
- Procedural memory
Typically, stored externally:
- Vector DB
- Knowledge Graph
- SQL Database
- Object Storage
Examples
- User preferences
- Historical interactions
- Enterprise documents
- Learned workflows
2.1 Episodic Memory : Past Experiences š
Stores past experiences and interactions.
Inspired by human memory.
Characteristics
- Experience-based
- Time-oriented
- Helps personalization
- Learns from previous interactions
Use Cases
- Personal assistants
- Customer support agents
- Learning agents
Examples
Episode:
User asked about Kubernetes
Agent recommended EKS
User preferred self-hosted cluster
Later:
Agent remembers:
"Last time you preferred self-managed Kubernetes."
2.2 Semantic Memory : Knowledge š
Stores facts and knowledge.
Characteristics
- Fact-based
- Not tied to specific events
- Usually stored in:
Vector databasesKnowledge graphsKnowledge bases
Use Cases
- RAG systems
- Enterprise knowledge assistants
- Search agents
Examples
Berlin is the capital of Germany.
Docker is a container platform.
TensorRT optimizes LLM inference.
Episodic vs Semantic Memory
| Episodic | Semantic |
|---|---|
| "User asked about Java yesterday" | "Java was released in 1995" |
| Experience | Fact |
| Event-based | Knowledge-based |
| Personalized | General knowledge |
2.3 Procedural Memory š : Process / Skill
Stores how to perform tasks.
Characteristics
- Skill-based
- Process-oriented
- Often encoded as workflows or plans
Use Cases
- Workflow automation
- Multi-agent orchestration
- Business process agents
Examples
How to deploy Kubernetes:
1. Create cluster
2. Configure networking
3. Deploy workloads
4. Monitor health
or
Workflow:
Validate input
ā Query API
ā Format result
ā Return response
3. Retrieval Memory š : RAG
Memory retrieved dynamically when needed.
RAG + Agents
RAG systems provide external memory.
Agentic systems add:
- planning
- reasoning
- dynamic retrieval
- adaptive execution
A modern research agent may:
- Generate search queries
- Retrieve documents
- Rank relevance
- Summarize findings
- Detect knowledge gaps
- Retrieve additional context
- Revise conclusions
This creates recursive information acquisition loops.
Flow
graph TD
A[User Query]
B[Generate Embedding]
C["Vector Database āļø"]
D[Similarity Search]
E[Top-K Retrieved Memories]
F[Context Assembly]
G[LLM Agent]
H[Response]
A --> B
B --> D
D --> C
C --> E
E --> F
A --> F
F --> G
G --> H
Example
User:
What's my favorite programming language?
Retrieve:
"User prefers Java and Spring Boot."
This is the foundation of most RAG-based agents.
4. Shared Memory š : Multi-Agent Systems
Used when multiple agents collaborate.
All agents can access and update the same state.
graph TD
SharedMemory["Shared Memory š"]
Research["Research Agent š¤"]
CodingAgent["Coding Agent š¤"]
ValidationAgent["Validation Agent š¤"]
Research --> SharedMemory
CodingAgent --> SharedMemory
ValidationAgent --> SharedMemory
Example
{
"customer_id": 123,
"issue": "payment failure",
"status": "investigating"
}
Exam Tip
Which memory type stores facts and knowledge?
Semantic Memory
Which memory type stores previous interactions?
Episodic Memory
Which memory type stores workflows and skills?
Procedural Memory
Which memory type holds current conversation context?
Working (Short-Term) Memory
Which memory type enables personalization from previous user interactions?
Episodic Memory
