A Temporal Context Graph construction and query framework for AI Agents, providing incremental memory evolution with time-windowed facts and hybrid retrieval capabilities.
Graphiti is an open-source core engine developed by Zep Inc., specifically designed to address the lack of structured, temporal memory in long-term AI Agent interactions. Unlike traditional flat vector-based RAG approaches, Graphiti transforms unstructured text and semi-structured JSON into a Temporal Knowledge Graph. Its core highlight is "Temporal Fact Management": all extracted facts and relationships are bound to a validity time window. When information changes, old facts are marked as invalid rather than deleted, enabling precise retrospective queries of "what was true at any given point in time."
Regarding graph construction, Graphiti supports incremental updates where new data ingestion triggers real-time graph evolution without full batch recomputation. The system features built-in data provenance tracking, meaning every node and edge can be traced back to the original Episode that generated it. It supports prescribing domain ontologies via Pydantic models or allowing structures to emerge entirely from the data. On the retrieval side, Graphiti implements a hybrid search strategy combining semantic vectors, BM25 keywords, and graph structure traversal, augmented by a cross-encoder for reranking.
As infrastructure, Graphiti is highly pluggable. The underlying graph storage can seamlessly switch between Neo4j, FalkorDB, Kuzu, or Amazon Neptune, while the LLM inference side is compatible with multiple providers including OpenAI, Anthropic, and Gemini. For external interfaces, besides the Python SDK, it natively provides a FastAPI REST service layer and an MCP Server implementation. This allows it to directly empower MCP clients like Claude and Cursor, or deeply integrate with Agent frameworks like LangGraph, making it suitable for complex scenarios such as personalized assistants, enterprise knowledge management, and multi-source autonomous reasoning.
Core Graph Components: Entities (node entities), Facts/Relationships (time-windowed edges), Episodes (raw data input and provenance units), Communities (auto-clustered entity groups), Custom Types (Pydantic-based domain ontology definitions).
Prerequisites: Python 3.10+, graph database backend (Neo4j 5.26 / FalkorDB 1.1.2 / Kuzu 0.11.2 / Amazon Neptune), OpenAI API Key.
Installation: pip install graphiti-core
Basic Usage:
from graphiti_core import Graphiti
from graphiti_core.driver.neo4j_driver import Neo4jDriver
driver = Neo4jDriver(uri="bolt://localhost:7687", user="neo4j", password="password")
graphiti = Graphiti(graph_driver=driver)
Unconfirmed Information: The exact access link for the associated paper "Zep: A Temporal Knowledge Graph Architecture for Agent Memory" is not directly provided in the README; production performance benchmark data (claimed sub-200ms latency) has no public report.