Graphiti
Graphiti is a framework for building and querying temporal knowledge graphs for AI agents. It tracks how facts change over time, maintains provenance to source data, and supports both prescribed and learned ontology, solving the problem of static knowledge representation in dynamic environments. It is for developers building context-aware AI applications that require evolving, queryable data.
✨ Key features
- Temporal fact management with validity windows and automatic invalidation
- Episodes and provenance: every fact traces back to raw data
- Prescribed and learned ontology via Pydantic models
- Incremental graph construction without batch recomputation
- Hybrid retrieval combining semantic, keyword, and graph traversal
- Scalable with parallel processing and pluggable graph backends
🎯 Use cases
- Build personal AI assistants that track user preferences over time
- Create enterprise knowledge graphs from evolving documents and interactions
- Implement real-time context retrieval for production AI agents
- Query historical states of facts for audit or analysis
- Integrate with MCP servers to give AI assistants graph capabilities
📦 Installation
🧰 Requirements: Python 3.10+, a graph database (Neo4j 5.26, FalkorDB 1.1.2, Amazon Neptune, or Kuzu 0.11.2 deprecated), and an OpenAI API key (or alternative LLM provider).
pip install graphiti-core
or
uv add graphiti-core
For FalkorDB support:
pip install graphiti-core[falkordb]uv add graphiti-core[falkordb]pip install graphiti-core[falkordblite]uv add graphiti-core[falkordblite]For Kuzu support (deprecated):
pip install graphiti-core[kuzu]uv add graphiti-core[kuzu]For Amazon Neptune support:
pip install graphiti-core[neptune]uv add graphiti-core[neptune]Optional LLM providers:
pip install graphiti-core[anthropic]
pip install graphiti-core[groq]
pip install graphiti-core[google-genai]
🚀 Usage
# Example from quickstart (simplified)
from graphiti_core import Graphiti
graphiti = Graphiti(
driver=driver, # Neo4j, FalkorDB, etc.
llm_client=llm_client, # OpenAI or compatible
embedder=embedder
)
# Add an episode
graphiti.add_episode(
episode={
"text": "Kendra loves Adidas shoes.",
"group_id": "user-123"
}
)
# Search for relationships
results = graphiti.search("What shoes does Kendra like?")
For a complete working example, see the Quickstart Example.
⚠️ Good to know
Kuzu is deprecated and will be removed in a future release; the project is under active development and may have evolving APIs.
❓ FAQ
What graph databases does Graphiti support?
Graphiti supports Neo4j 5.26, FalkorDB 1.1.2, Amazon Neptune, and Kuzu 0.11.2 (deprecated).
Can I use LLM providers other than OpenAI?
Yes, Graphiti supports Anthropic, Gemini, and Groq, as well as OpenAI-compatible endpoints for other providers.
How does Graphiti handle changing facts?
Facts have validity windows; when new information arrives, old facts are invalidated but not deleted, preserving temporal history.
What is the default concurrency and how can I adjust it?
The default concurrency is set by the SEMAPHORE_LIMIT environment variable, defaulting to 10 to avoid rate limit errors. You can increase it for higher throughput.
📊 Repository
🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.