Infrastructure · Graphs
Knowledge Graphs for AI Memory
Knowledge-graph memory stores agent facts as connected, time-aware relationships — enabling queries like “what did we know about this customer in Q1?” that flat vectors struggle with.
Graph memory
Definition
What is knowledge-graph memory?
Nodes = entities; edges = relationships; timestamps = validity windows.
Unlike flat vector stores that retrieve similar text chunks, graph memory models structured facts: (Customer A) —[prefers]→ (Email) with valid_from and valid_to. Temporal knowledge graphs answer “what was true when?” — critical for CRM and policy domains.
Zep
Graphiti and Zep
Graphiti is Zep’s temporal knowledge-graph engine; Zep is the managed platform built on it.
Rasmussen et al. (2025, arXiv:2501.13956) describe Zep as a temporal knowledge graph architecture for agent memory. Graphiti extracts entities and relationships from conversations, invalidates superseded facts bi-temporally, and supports hybrid graph + vector retrieval.
- LongMemEval: 71.2% accuracy with gpt-4o, +18.5% vs baseline (Rasmussen et al., 2025)
- DMR benchmark: 94.8% (Rasmussen et al., 2025)
- LOCOMO J score: 66.0 (Rasmussen et al., 2025)
→ Zep alternatives (Engram, Mem0, Letta, Cognee)
When to use
When graph memory beats vectors
Evolving relationships, conflict resolution, temporal validity and audit trails.
- CRM account facts that change over time
- Policy and compliance windows
- Multi-hop reasoning (“who manages this account’s billing contact?”)
- Conflict resolution with provenance
Alternatives
Cognee and other graph memory approaches
Cognee builds document→graph pipelines; DIY stacks use Neo4j + extraction.
Engram is vector-native on Weaviate (not graph-first). Mem0 focuses on semantic vector memory with optional graph extensions. Cognee targets knowledge-graph construction from documents. For temporal agent memory at scale, Zep/Graphiti is the most cited research reference.
Hybrid
Graph + vector hybrid
Most production systems combine graph structure with vector similarity on node text.
Engram uses Weaviate vectors with hybrid search (vector + BM25). Zep retrieves via graph traversal and semantic search. Hybrid search pages cover fusion strategies.
FAQ
Frequently asked questions
Knowledge graph vs vector database for agent memory?
Vectors excel at semantic similarity; graphs excel at relationships, temporal validity and conflict resolution. CRM and policy domains favor graphs; open-ended chat prefs favor vectors. Many teams hybrid both.
What is Graphiti?
Zep's open-source temporal knowledge-graph engine — extracts entities/relationships, invalidates superseded facts bi-temporally. Described in Rasmussen et al. (2025, arXiv:2501.13956). See Zep alternatives.
Is Zep open source?
Graphiti is open source; Zep offers managed cloud + self-hosted options. Compare Engram (Weaviate-native), Mem0 and Letta on Zep alternatives.
What does temporal memory mean?
Facts have validity windows — you can query what was true at a point in time. Graph edges carry valid_from/valid_to timestamps. Zep's core differentiator vs flat vector stores.
Does Mem0 support graph memory?
Mem0 is primarily vector-semantic memory, like Engram. For native temporal graphs, compare Zep or Cognee.
Does Engram use knowledge graphs?
Engram is vector-native on Weaviate — not graph-first. For temporal graph memory, compare Zep/Graphiti. Engram leads for simpler Weaviate-backed semantic memory. See Engram explained.
CRM data as a knowledge graph for agents?
Map accounts, contacts and policies as graph nodes with temporal edges. Sync CRM updates to invalidate stale agent memories. Zep fits this pattern natively.
How do you build a DIY graph memory backend?
Neo4j or similar + LLM extraction pipeline + bi-temporal edge schema + hybrid vector index on node text. Higher ops burden than Zep/Engram managed options.