Memory types · Semantic
Semantic Memory in AI Agents
Semantic memory in AI agents holds general facts and learned knowledge — user preferences, product details, domain rules — independent of the specific conversation when they were learned.
Semantic
“User is vegetarian” · “API limit 100/min”
Episodic
“User asked about refund March 3”
Definition
What is semantic memory in AI agents?
Semantic memory is stable, generalized knowledge not tied to one event — preferences, policies, identity facts and domain rules the agent reuses across sessions.
Examples: “User is vegetarian”, “API rate limit is 100 requests/min”, “Refund window is 30 days.” Also called a fact store or knowledge memory. Tulving’s taxonomy: semantic = general knowledge; episodic = particular experiences.
Comparison
How semantic memory differs from episodic memory
Semantic facts are reusable generalizations; episodic records are timestamped events.
| Type | Example | Updates when |
|---|---|---|
| Semantic | “User prefers email support” | The fact changes (“now prefers chat”) |
| Episodic | “User called Tuesday about error 402” | A new event occurs |
A support bot stores semantic “user is on Pro plan” and episodic “ticket #8821 opened March 3.” → Episodic memory guide
Storage
Storage options for semantic memory
Vector embeddings for similarity search, knowledge graphs for relationships, or hybrid backends in production.
| Backend | Strength | Framework examples |
|---|---|---|
| Vector store | Fast semantic fact lookup | Engram, Mem0 |
| Knowledge graph | Relationships + temporal validity | Zep (Graphiti), Cognee |
| Hybrid | Keyword + vector recall | Custom + hybrid search |
→ Embeddings for memory · Knowledge graphs · Vector databases
Pipeline
How semantic memory is written and updated
Extract fact from conversation → dedup against existing → embed and store → invalidate or supersede on contradiction.
When a user says “I moved to Berlin” after “I live in Munich,” the semantic memory pipeline updates the location fact — Engram and Mem0 handle this via merge/replace on vector records; Zep uses temporal graph invalidation.
RAG
Semantic memory and RAG
RAG corpora are static and shared across users; agent semantic memory is dynamic and per-user.
RAG answers “What does the manual say?” Semantic memory answers “What does this user prefer?” Overlap is possible — keep org docs in the RAG index and user facts in a separate memory namespace. On LOCOMO, memory-centric systems outperform fixed-chunk RAG baselines in the 50s range (Chhikara et al., 2025).
FAQ
Frequently asked questions
What is an example of semantic memory in AI?
"User is vegetarian", "User prefers email support", "API rate limit is 100/min" — stable facts not tied to one conversation event. See definition above.
Semantic vs episodic memory — what's the difference?
Semantic = general facts ("user is on Pro plan"). Episodic = specific events ("user called Tuesday about error 402"). See episodic memory.
Is semantic memory the same as a RAG knowledge base?
No. RAG indexes static org documents shared across users. Semantic agent memory is dynamic, per-user and updated each session. See memory vs RAG.
Is a vector database enough for semantic memory?
Yes for most personalization use cases — embed facts, search by similarity. Graphs add relationship and temporal queries when facts link to entities that change over time. See vector databases.
When do you need a graph for semantic memory?
When facts have relationships, validity windows or conflict resolution — CRM timelines, policy versioning. Zep Graphiti is built for this. See knowledge graphs.
Does Engram store semantic memory?
Yes — Engram extracts and stores semantic facts per user on Weaviate-native stacks. Unified vector + memory on one platform. See Engram explained.
Does Mem0 store semantic memory?
Yes — Mem0 specializes in per-user semantic and episodic memory via vector extraction API. LOCOMO J 66.9 (Chhikara et al., 2025). See Mem0 alternatives.
What role does consolidation play in semantic memory?
Consolidation promotes durable facts from episodic events into stable semantic records — e.g. summarizing three preference mentions into one fact. See memory consolidation.
How do you update semantic facts when users correct them?
Dedup on write, then merge or invalidate the old fact. Zep uses temporal graph supersession; vector stores need explicit conflict handling. See conflicting memories.
Semantic memory for customer support bots?
Store stable prefs (language, plan tier) as semantic; ticket events as episodic. Combine both in retrieval. See customer support use case.