Graphiti is a Python framework that builds and queries temporal knowledge graphs for AI agents, with incremental updates, provenance, and hybrid retrieval.
Overview
Graphiti helps developers construct context graphs that track entities, relationships, and facts over time instead of freezing a one-shot summary. Each fact can carry a validity window: when it became true and when a newer fact superseded it, while older states remain queryable.
Ingested episodes—the raw messages, documents, or structured records—feed incremental graph updates without full recomputation. Entities gain evolving summaries; edges represent triplets with temporal metadata; custom node and edge types can be prescribed through Pydantic models or learned from data.
Retrieval mixes semantic embeddings, keyword BM25 search, and graph traversal so agents can ask what is true now or what held at a past time. The framework plugs into several graph databases, including Neo4j, FalkorDB, Amazon Neptune variants, or an embedded Relate store, and expects an LLM plus embedder for extraction and search pipelines.
You operate the database, ingestion, tenancy, and serving layer yourself. Reference MCP and REST servers illustrate protocol exposure but are not hardened for production. Docker Compose examples exist for common graph backends during development.
Key features
- Bi-temporal fact invalidation
- Episode-level provenance
- Custom Pydantic ontologies
- Incremental graph updates
- Hybrid semantic and BM25 search
- Multiple graph database backends
- Parallel ingestion pipelines
- Reference MCP and REST servers
Use cases
- Agent memory with history
- Evolving enterprise knowledge
- Time-aware RAG backends
- Contradiction-safe fact storage
- Interactive context-aware apps