KnowledgeApr 7, 2026·2 min read

Graphiti — Temporal AI Knowledge Graph by Zep

Build dynamic knowledge graphs from AI agent conversations. Graphiti tracks entity changes over time, resolves contradictions, and provides temporal-aware queries.

AG
Agent Toolkit · Community
Quick Use

Use it first, then decide how deep to go

This block should tell both the user and the agent what to copy, install, and apply first.

pip install graphiti-core
from graphiti_core import Graphiti
from graphiti_core.llm_client import AnthropicClient

graphiti = Graphiti(
    uri="bolt://localhost:7687",
    llm_client=AnthropicClient(),
)
await graphiti.build_indices()

# Add episodes (conversations)
await graphiti.add_episode(
    name="user_onboarding",
    episode_body="Alice is a senior engineer at Acme Corp working on payments.",
    source_description="User onboarding conversation",
)

# Search the graph
results = await graphiti.search("Who works at Acme Corp?")
for r in results:
    print(r.fact)  # "Alice is a senior engineer at Acme Corp"

What is Graphiti?

Graphiti is an open-source library for building temporal knowledge graphs from AI agent interactions. Unlike static knowledge bases, Graphiti tracks how entities and relationships change over time, resolves contradictions, and maintains a living graph that evolves with every conversation.

Answer-Ready: Graphiti is an open-source temporal knowledge graph library by Zep. It builds dynamic entity-relationship graphs from AI agent conversations, tracks changes over time, resolves contradictions, and provides temporal-aware search. Works with Claude and GPT.

Best for: AI agent developers building systems with evolving knowledge. Works with: Neo4j, Claude, GPT, any LLM. Setup time: Under 10 minutes (requires Neo4j).

Core Features

1. Automatic Entity Extraction

# From conversation text, Graphiti extracts:
await graphiti.add_episode(
    name="meeting_notes",
    episode_body="Bob joined the payments team last Monday. He previously worked at Stripe.",
)
# Entities: Bob (person), Payments Team (team), Stripe (company)
# Relations: Bob --joined--> Payments Team (date: last Monday)
#            Bob --previously_worked_at--> Stripe

2. Temporal Tracking

Every fact has a time dimension:

# March: "Alice uses React for frontend"
# June: "Alice switched to Vue.js"

results = await graphiti.search("What framework does Alice use?")
# Returns: "Alice uses Vue.js" (knows React is outdated)

# But you can also query historically:
results = await graphiti.search("What did Alice use in March?")
# Returns: "Alice used React"

3. Contradiction Resolution

# Episode 1: "The API uses REST"
# Episode 2: "We migrated the API to GraphQL"

# Graphiti detects the contradiction and updates the graph:
# Old edge: API --uses--> REST (invalidated)
# New edge: API --uses--> GraphQL (current)

4. Hybrid Search

# Semantic search
results = await graphiti.search("payment processing architecture")

# With time filter
results = await graphiti.search(
    "team changes",
    center_node_uuid=alice_uuid,
    num_results=10,
)

5. Graph Visualization

Query the Neo4j database directly for visualization:

MATCH (n)-[r]->(m)
WHERE n.name = 'Alice'
RETURN n, r, m

Architecture

Conversations/Episodes
        ↓
  Graphiti Engine
    ├── Entity Extractor (LLM)
    ├── Relation Extractor (LLM)
    ├── Contradiction Resolver (LLM)
    └── Temporal Manager
        ↓
  Neo4j Graph Database
    ├── Entities (nodes)
    ├── Relations (edges with timestamps)
    └── Episodes (source tracking)
        ↓
  Hybrid Search (semantic + graph traversal)

Requirements

  • Python 3.10+
  • Neo4j 5.x (local or Aura cloud)
  • LLM API key (Anthropic or OpenAI)

FAQ

Q: How does Graphiti compare to basic RAG? A: RAG retrieves static text chunks. Graphiti maintains structured, evolving knowledge with entity relationships and temporal awareness.

Q: Can I use it without Neo4j? A: Currently Neo4j is required. It is the graph database backend for entity/relation storage.

Q: Is it related to Zep? A: Yes, Graphiti is built by the Zep team. Zep uses Graphiti internally for its knowledge graph features.

🙏

Source & Thanks

Created by Zep AI. Licensed under Apache 2.0.

getzep/graphiti — 3k+ stars

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.