Graphiti

Active
GitHub Python Apache-2.0

Description

Graphiti is a temporal knowledge-graph engine for agent memory, helping systems continuously accumulate long-term context.

Key Features

  • Temporal fact management — Each fact has a validity window; old facts are invalidated, not deleted. Query what's true now or at any point in time
  • Provenance & lineage tracking — Every entity and relationship traces back to raw data episodes, full lineage from derived fact to source
  • Hybrid retrieval — Combines semantic embeddings, keyword BM25, and graph traversal for low-latency high-precision queries without LLM summarization
  • Incremental graph construction — New data integrates immediately without batch recomputation; graph evolves in real-time as episodes are ingested
  • Prescribed & learned ontology — Define entity/edge types via Pydantic models or let structure emerge from data automatically
  • MCP Server integration — Provides MCP Server for Claude, Cursor and other clients to use temporal context graph memory

Use Cases

💡 AI Agent long-term memory — Provide evolving structured context for conversational agents, replacing flat document chunks
💡 Customer relationship tracking — Auto-build and update temporal knowledge graphs of customer preferences and interaction history
💡 Enterprise knowledge management — Integrate structured and unstructured enterprise data into a unified queryable graph
💡 Real-time decision support — Provide agents with decision basis from latest facts and historical change trends
💡 Compliance auditing — Track information changes through complete fact timelines to support compliance audits

Quick Start

pip install graphiti-core

from graphiti_core import Graphiti
import asyncio

async def main():
    # Connect to Neo4j
    client = Graphiti(
        "bolt://localhost:7687",
        "neo4j",
        "password"
    )
    await client.build_indices_and_constraints()

    # Add data
    await client.add_episode(
        name="conversation",
        body="Kendra loves Adidas shoes",
        source_description="user conversation"
    )

    # Search
    results = await client.search("What brand does Kendra like?")
    print(results)

asyncio.run(main())

Related Projects