What is Graphiti?
Graphiti is an open-source library for building temporal knowledge graphs from AI agent interactions. Unlike static knowledge bases, Graphiti tracks how entities and relationships change over time, resolves contradictions, and maintains a living graph that evolves with every conversation.
Answer-Ready: Graphiti is an open-source temporal knowledge graph library by Zep. It builds dynamic entity-relationship graphs from AI agent conversations, tracks changes over time, resolves contradictions, and provides temporal-aware search. Works with Claude and GPT.
Best for: AI agent developers building systems with evolving knowledge. Works with: Neo4j, Claude, GPT, any LLM. Setup time: Under 10 minutes (requires Neo4j).
Core Features
1. Automatic Entity Extraction
# From conversation text, Graphiti extracts:
await graphiti.add_episode(
name="meeting_notes",
episode_body="Bob joined the payments team last Monday. He previously worked at Stripe.",
)
# Entities: Bob (person), Payments Team (team), Stripe (company)
# Relations: Bob --joined--> Payments Team (date: last Monday)
# Bob --previously_worked_at--> Stripe2. Temporal Tracking
Every fact has a time dimension:
# March: "Alice uses React for frontend"
# June: "Alice switched to Vue.js"
results = await graphiti.search("What framework does Alice use?")
# Returns: "Alice uses Vue.js" (knows React is outdated)
# But you can also query historically:
results = await graphiti.search("What did Alice use in March?")
# Returns: "Alice used React"3. Contradiction Resolution
# Episode 1: "The API uses REST"
# Episode 2: "We migrated the API to GraphQL"
# Graphiti detects the contradiction and updates the graph:
# Old edge: API --uses--> REST (invalidated)
# New edge: API --uses--> GraphQL (current)4. Hybrid Search
# Semantic search
results = await graphiti.search("payment processing architecture")
# With time filter
results = await graphiti.search(
"team changes",
center_node_uuid=alice_uuid,
num_results=10,
)5. Graph Visualization
Query the Neo4j database directly for visualization:
MATCH (n)-[r]->(m)
WHERE n.name = 'Alice'
RETURN n, r, mArchitecture
Conversations/Episodes
↓
Graphiti Engine
├── Entity Extractor (LLM)
├── Relation Extractor (LLM)
├── Contradiction Resolver (LLM)
└── Temporal Manager
↓
Neo4j Graph Database
├── Entities (nodes)
├── Relations (edges with timestamps)
└── Episodes (source tracking)
↓
Hybrid Search (semantic + graph traversal)Requirements
- Python 3.10+
- Neo4j 5.x (local or Aura cloud)
- LLM API key (Anthropic or OpenAI)
FAQ
Q: How does Graphiti compare to basic RAG? A: RAG retrieves static text chunks. Graphiti maintains structured, evolving knowledge with entity relationships and temporal awareness.
Q: Can I use it without Neo4j? A: Currently Neo4j is required. It is the graph database backend for entity/relation storage.
Q: Is it related to Zep? A: Yes, Graphiti is built by the Zep team. Zep uses Graphiti internally for its knowledge graph features.