SuperAPIAI Directory

graphiti

github.com · AI developer platforms

Graphiti is an open-source Python framework from Zep for building and querying temporal context graphs for AI agents. Unlike traditional static knowledge graphs, it records the validity periods and change history of facts, preserves data provenance, and supports predefined or learned ontologies. The framework can incrementally integrate user interactions, structured and unstructured enterprise data, and external information, providing hybrid retrieval combining semantic, keyword, and graph traversal, enabling precise historical queries without full graph recomputation. Users must provide their own graph database, LLM, and embedding model, and build ingestion, multi-tenancy, access control, and operations services themselves.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux

About this tool

Graphiti is an open-source Python framework for building and querying temporal context graphs for AI agents, developed and maintained by the Zep team. Its core goal is to provide agents with a graph-structured context that can continuously evolve with interactions and whose historical states are traceable and queryable, rather than flat document chunks or raw event streams.

Purpose and Positioning Graphiti targets AI applications that need to handle dynamic, frequently updated data. Traditional retrieval-augmented generation (RAG) approaches often rely on batch processing and static data summaries, making them less efficient for changing data. Graphiti addresses these challenges through incremental graph construction, temporalized fact management, and hybrid retrieval. It is itself a graph construction framework, not an agent memory product; users must provide their own graph database, LLM, and embedder, and build ingestion, multi-tenancy, access control, and operations services on top of it. Zep, by contrast, is an enterprise-grade unified context layer built on Graphiti, offering managed or BYOC deployment.

Key Capabilities

  1. Temporalized fact management: Each fact has a validity period, recording when it became true and when it was superseded; when information changes, old facts are marked invalid rather than deleted, allowing queries of what is currently true or what was true at any historical point in time.
  2. Episodes and provenance: Every entity and relationship can be traced back to the raw data (episodes) that produced it, achieving complete lineage from derived facts to source data.
  3. Predefined and learned ontologies: Entity and edge types can be predefined via Pydantic models, or structure can emerge naturally from the data, supporting starting simple and evolving gradually.
  4. Incremental graph construction: New data is integrated immediately upon ingestion without batch recomputation, and the graph evolves in real time as episodes are ingested.
  5. Hybrid retrieval: Combines semantic embeddings, keywords (BM25), and graph traversal to achieve low-latency, high-precision queries without relying on LLM summaries.
  6. Scalability: Supports parallel processing and pluggable graph backends, targeting enterprise-grade workloads.

Usage Environment requirements include Python 3.10 or higher; graph database options include Neo4j 5.26, FalkorDB 1.1.2, Amazon Neptune Database Cluster or Neptune Analytics Graph with Amazon OpenSearch, and Relate (embedded, requires Python 3.11+, no separate server needed). OpenAI is used by default for LLM inference and embeddings, requiring OPENAI_API_KEY to be set; it also supports Anthropic, Gemini, Groq, as well as hosted services such as DeepSeek, Together, and OpenRouter via OpenAI-compatible endpoints, or local servers such as Ollama, vLLM, llama.cpp, and LM Studio. During installation, additional dependencies can be selected per graph backend, for example the extras for FalkorDB, Amazon Neptune, or Relate.

Concurrency control is adjusted via the SEMAPHORE_LIMIT environment variable, defaulting to 10 concurrent operations to reduce the risk of 429 rate limiting from LLM providers; if throughput allows, it can be raised to improve episode ingestion performance. An official Quickstart example is provided, demonstrating connecting to a database, initializing indexes and constraints, adding text and structured JSON episodes, hybrid searching of relationship edges, reranking results by graph distance, and using preset search recipes to find nodes. Neo4j or FalkorDB services can also be started quickly via Docker Compose.

Reference implementations and limitations The mcp_server and server directories in the repository provide reference implementations of an MCP server and a FastAPI-based REST service, respectively, to demonstrate how to place Graphiti behind a protocol. These reference servers have no authentication, authorization, or prompt injection protection, and the example Docker Compose uses default database credentials, so they explicitly should not be exposed to untrusted networks. For production deployments, it is recommended to build your own service directly using the graphiti-core library and add authentication, authorization, tenant isolation, and input controls, or to adopt the Zep managed service/BYOC built on Graphiti.

Use cases Suitable for AI applications that require real-time interaction, precise historical queries, and context awareness, such as long-term memory for agents, enterprise data context integration, and tracking of facts that evolve over time. Best results are achieved with LLMs that have strong structured output capabilities (such as OpenAI, Anthropic, Gemini); smaller or local models may produce output schema errors or ingestion failures due to unreliable structured output, which can be adjusted via configurations such as structured_output_mode.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools