What is this?
A Python framework for building and querying temporal knowledge graphs for AI agents. Instead of static RAG, it continuously folds new data into a graph that tracks how facts change over time.
Is this a library I code against, or a service I deploy?
Primarily a Python framework you call from code, but the repo also ships an MCP server for AI assistants and a FastAPI REST service, so you can run it as a self-hosted API.
How do I get it running?
Install the Python package (needs Python 3.10+), start Neo4j or FalkorDB with the bundled Docker Compose files, set your OPENAI_API_KEY, then work through the quickstart example that builds a graph and runs hybrid searches.
Do I need my own graph database and an API key?
Yes. Bring a graph database — Neo4j 5.26, FalkorDB 1.1.2, Amazon Neptune, or Kuzu (deprecated) — plus an LLM key: OpenAI by default, with Anthropic, Gemini, Groq and any OpenAI-compatible endpoint, including local servers like Ollama and vLLM.
Any gotchas before I start?
LLMs without Structured Output can break ingestion with wrong schemas, especially smaller models. Ingestion concurrency is deliberately low by default (SEMAPHORELIMIT=10) to avoid 429 rate-limit errors.
What can the MCP server do?
It exposes Graphiti to AI assistants over the Model Context Protocol: adding, retrieving and deleting episodes, entity and relationship management, semantic and hybrid search, group management, and graph maintenance. It deploys via Docker with Neo4j.
How does search work at query time?
Hybrid retrieval combines semantic embeddings, BM25 keyword search and graph traversal for low-latency, high-precision results without relying on LLM summarization. The quickstart also covers reranking by graph distance and predefined node search recipes.
Can I define my own entity types?
Yes — you can prescribe entity and edge types upfront via Pydantic models, or let structure emerge from your data (learned ontology), starting simple and evolving as patterns appear.
What is an episode?
The raw data you ingest — text or structured JSON — that the graph is built from. Every entity and fact traces back to its source episodes, giving full provenance from derived facts back to the ground-truth stream.
What are similar projects?
RuVector, SimpleMem, agentmemory, m_flow, semantica, hindsight, MemoryBear, txtai
Which topics is it in?
graph, llms, knowledge-graph, semantic-search, fastapi, embeddings, agent-memory, memory, real-time, rag, rest-api, agents