Graph Memory for Personal AI
Table of content
Vector databases find similar content. Knowledge graphs understand how things connect. If you’ve ever asked an AI “who told me about that tool?” and gotten useless results, you’ve hit the wall where vector similarity breaks down. Graph memory solves this by storing relationships, not just embeddings.
The Problem with Flat Memory
Standard RAG pipelines store chunks of text as embeddings and retrieve by similarity. This works for static documents. It fails for personal knowledge where:
| Scenario | Vector Retrieval | Graph Retrieval |
|---|---|---|
| “What project did Sarah and I discuss last month?” | Returns all mentions of “Sarah” | Traverses Sarah → meetings → projects → time filter |
| “Has my opinion on TypeScript changed?” | Can’t track temporal evolution | Shows preference nodes over time |
| “Who introduced me to Kubernetes?” | Finds Kubernetes content | Finds person-to-concept introduction edge |
Vector search returns content. Graph search returns context.
How Graph Memory Works
Graph memory stores three types of elements:
| Element | What it represents | Example |
|---|---|---|
| Entity nodes | People, projects, concepts, tools | “Sarah”, “ProjectX”, “Kubernetes” |
| Temporal nodes | Events, sessions, decisions | “Meeting on Jan 15”, “Architecture decision” |
| Edges | Relationships with timestamps | “Sarah MENTIONED ProjectX AT 2026-01-15” |
Retrieval becomes traversal. Instead of “find similar text,” you ask “follow these relationships.”
Zep’s Temporal Knowledge Graph
Zep’s Graphiti architecture stores episodic, semantic, and community subgraphs. Their January 2025 paper on arXiv (2501.13956) describes a dual-timestamp model that tracks both when events happened and when they were recorded.
Event time: When Sarah mentioned ProjectX (Jan 15)
Ingestion time: When Claude stored this (Jan 15, 3:47 PM)
This distinction matters for correcting outdated information. If you learn on Jan 20 that the meeting actually happened on Jan 14, the graph can update event time while preserving ingestion time for audit trails.
Zep’s retrieval benchmarks show:
| Approach | Query Speed | Temporal Handling |
|---|---|---|
| Semantic RAG | Fast (ms) | None |
| Microsoft GraphRAG | Slow (seconds) | Limited |
| Zep | Fast (ms) | Full temporal tracking |
The practical difference: Zep updates the graph as new data arrives. Microsoft’s GraphRAG and similar approaches require reprocessing the entire corpus when anything changes.
When to Choose Graph Over Vector
Not everything needs graph memory. Decision criteria:
| Use Graph Memory | Use Vector Memory |
|---|---|
| Multi-hop questions (“who knows someone who…”) | Single-hop similarity (“find similar code”) |
| Temporal reasoning (“how has X changed”) | Static document retrieval |
| Entity relationships (“connections between…”) | Content-based search |
| Contradiction detection (“conflicting information”) | Semantic deduplication |
| Personal knowledge with evolving facts | Reference documentation |
For personal AI, graph memory handles life complexity that vector stores miss. Your relationships with people change. Facts you learned last month get outdated. Context from session 12 matters in session 47.
Graph + Vector Hybrid
The best architectures combine both. Use vectors for initial candidate retrieval, graphs for relationship traversal:
Query: "What did Sarah say about the API migration?"
Step 1 (Vector): Find chunks mentioning API migration
Step 2 (Graph): Filter to Sarah's statements
Step 3 (Graph): Add temporal context (when, what project)
Step 4 (Graph): Include related decisions
Zep calls this assembled context. The graph organizes what the vectors find.
Building Personal Graph Memory
For a personal AI OS, you need to define what goes in the graph.
Entity types: people (colleagues, contacts), projects, tools, concepts, and events like meetings or decisions.
Relationship types connect them: KNOWS links people, WORKS_ON links people to projects, USES links projects to tools, LEARNED_FROM tracks where you got knowledge, CONTRADICTS flags conflicting facts.
Temporal attributes matter most. Every node needs created_at (when added) and optionally valid_from/valid_until (when the fact was true). A confidence score helps when information is uncertain.
Implementation with Graphiti
Zep’s open-source Graphiti library (22k+ GitHub stars) provides the graph layer. Basic setup:
from graphiti import Graphiti
graph = Graphiti()
# Add an episode (conversation, session, event)
graph.add_episode(
name="meeting_2026_01_15",
content="Discussed API migration with Sarah. She prefers REST over GraphQL for this use case."
)
# Query with relationship awareness
results = graph.search(
query="Sarah's API preferences",
include_edges=True,
temporal_filter={"after": "2026-01-01"}
)
Graphiti extracts entities and relationships from unstructured text automatically. Each new episode adds to the existing graph.
Memory Compression in Graphs
Graph structure is inherently compressed. Instead of storing full conversation text, you store:
| Raw (400 tokens) | Graph (50 tokens) |
|---|---|
| “In our meeting yesterday, Sarah mentioned that she’s been researching API approaches and thinks REST makes more sense than GraphQL for the current migration because…” | Sarah --[PREFERS]--> REST Sarah --[CONTEXT]--> api_migration timestamp: 2026-01-14 |
See AI Memory Compression for compression strategies that work alongside graph storage.
Practical Applications
Cross-Session Continuity
# Session 1: Learn preference
graph.add_episode("Sarah prefers async communication over meetings")
# Session 47: Query that preference
results = graph.search("how should I contact Sarah?")
# Returns: Sarah --[PREFERS]--> async_communication
Contradiction Detection
# Old fact
graph.add_episode("API rate limit is 100/minute", timestamp="2025-12-01")
# New fact
graph.add_episode("API rate limit increased to 500/minute", timestamp="2026-01-15")
# Graph query
graph.search("API rate limit")
# Returns both with timestamps, flags temporal succession
Relationship Queries
# Multi-hop traversal
graph.query("""
MATCH (me)-[:LEARNED_FROM]->(person)-[:EXPERT_IN]->(topic)
WHERE topic.name = 'Kubernetes'
RETURN person
""")
# Returns: the person who taught you about Kubernetes
Tradeoffs
Graph memory is not free:
| Advantage | Cost |
|---|---|
| Relationship awareness | Schema design required |
| Temporal reasoning | More storage overhead |
| Multi-hop queries | Slower than vector similarity |
| Contradiction detection | Entity resolution challenges |
For personal AI with a few thousand facts about your life and work, these tradeoffs are worth it. For searching millions of documents by keyword, stick with vectors.
Tools and Frameworks
| Tool | Type | Best For |
|---|---|---|
| Zep | Commercial + OSS | Production agent memory with temporal graphs |
| Graphiti | OSS | Building custom graph memory layers |
| Neo4j | Database | Self-hosted graph infrastructure |
| FalkorDB | Database | Redis-compatible graph queries |
| LangGraph | Framework | Agentic workflows with state |
For personal AI, start with Graphiti if you want to self-host, or Zep if you want managed infrastructure.
Related Concepts
- AI Memory Compression - How to compress observations before storing in graphs
- Alex Newman’s claude-mem - Vector-based memory with progressive disclosure
- Building a Memory System - Practical memory implementation guide
- Context Window Management - Why memory retrieval matters for context limits
Next: Personal Search
Get updates
New guides, workflows, and AI patterns. No spam.
Thank you! You're on the list.