Long-Term Episodic & Semantic Memory
Persist what the agent learned from past tasks in stratified stores: episodic (what happened), semantic (what is true), procedural (how to do things).
This page is the complete instruction page for one pattern called "Long-Term Episodic & Semantic Memory." It explains the problem this pattern solves, the idea behind the solution, when you should (and should not) use it, and what happens afterward — both the good effects and the costs.
This matters because building AI agents is not just about making them clever. It is also about making them safe and predictable. Following a well-tested pattern like this one helps avoid common mistakes, and shows you exactly which safety rules and regulations it connects to, listed under "Standards Mesh" on this page.
Context
Agents that treat every task as new cannot improve, cannot personalise, and cannot accumulate institutional knowledge. A single flat "memory" blurs these distinct needs.
Problem
Monolithic memory conflates facts, events, and skills — none retrievable cleanly.
Forces
- Recall accuracy vs storage cost
- Privacy of stored episodes vs utility of recall
Solution
Stratify long-term memory: episodic store for task histories, semantic store for consolidated facts, procedural store for reusable skills. Each has its own retention policy, retrieval mechanism, and access control. Write-path includes reflection summarisation; read-path uses hybrid retrieval.
Applicability
- Agents serving recurring users
- Knowledge-work agents
- Agents with learning requirements
Anti-Patterns
- One vector store used for everything
- No retention policy on episodic data
Consequences
- +Clean retrieval semantics
- +Targeted retention by data type
- −Architectural complexity
- −Consolidation pipeline required