Graphiti builds a knowledge graph from what an agent hears and records when each fact became true and when it stopped being true. We ran it with no key and no Docker, using a small local model and an embedded database. When the change was stated plainly, it marked the old fact invalid from the right episode. When it was stated casually, the small model missed the move and marked a still-true fact invalid. Removing that episode did not undo the mistake.
The agent proposes facts and dates. A person reviews the graph and corrects what is wrong.
What Graphiti is (checked on 2026-10-30)
Graphiti is an Apache-2.0 Python library from Zep for building temporal knowledge graphs. Each fact is an edge between two entities, with valid_at and invalid_at dates, so a new fact can close an old one instead of overwriting it. The approach is described in Zep's paper, and the docs cover the API.
We tested graphiti-core 0.31.2 from PyPI. It defaults to OpenAI and a graph database such as Neo4j. To stay local we used Ollama through its OpenAI-compatible endpoint and the embedded FalkorDB Lite option, which needs Python 3.12 or newer. The README marks the other embedded option, Kuzu, as deprecated, so we did not use it.
Based on Graphiti, by Zep and contributors.
The setup at a glance
- Trigger: the agent adds an episode (a message or document) with the time it happened.
- Permissions: writes to one local database file. With telemetry off, no network beyond the local Ollama server.
- Output: entities and dated facts, returned by
searchwith theirvalid_atandinvalid_atdates. - Human approval: a person reviews new and invalidated facts for a user, and fixes or removes wrong ones before the agent relies on them.
Step 1: Install and turn telemetry off
python3.12 -m venv .venv && . .venv/bin/activate
pip install "graphiti-core[falkordblite]==0.31.2" httpx
export GRAPHITI_TELEMETRY_ENABLED=false
export SEMAPHORE_LIMIT=2
ollama pull qwen2.5:3b && ollama pull nomic-embed-textThe qwen2.5:3b weights are under the "Qwen RESEARCH LICENSE AGREEMENT", for non-commercial use only; check the model card before any commercial use.
We had to add httpx ourselves: without it, import graphiti_core failed because the current openai package no longer installs it. Telemetry is on by default and goes to PostHog, per telemetry.py. With the default, our run made an outbound connection and wrote an ID file in the home cache folder. With it off, we saw no outbound connection.
Step 2: Connect local models and an embedded database
from graphiti_core import Graphiti
from graphiti_core.llm_client.config import LLMConfig
from graphiti_core.llm_client.openai_generic_client import OpenAIGenericClient
from graphiti_core.embedder.openai import OpenAIEmbedder, OpenAIEmbedderConfig
from graphiti_core.cross_encoder.openai_reranker_client import OpenAIRerankerClient
from graphiti_core.driver.falkordb_driver import FalkorDriver
from redislite.async_falkordb_client import AsyncFalkorDB
B = "http://localhost:11434/v1"
cfg = LLMConfig(api_key="ollama", model="qwen2.5:3b", small_model="qwen2.5:3b", base_url=B)
llm = OpenAIGenericClient(config=cfg)
db = AsyncFalkorDB(dbfilename="/path/to/graph.db")
g = Graphiti(
graph_driver=FalkorDriver(falkor_db=db, database="alice"),
llm_client=llm,
embedder=OpenAIEmbedder(config=OpenAIEmbedderConfig(
api_key="ollama", embedding_model="nomic-embed-text", embedding_dim=768, base_url=B)),
cross_encoder=OpenAIRerankerClient(client=llm, config=cfg),
)The api_key is a placeholder; Ollama ignores it. We ran a copy of qwen2.5:3b with its context window raised to 16k tokens. With FalkorDB, each group_id is stored as its own graph, so point the driver at the group you want to review or remove from. Our first remove_episode failed with "not found" until we did.
Step 3: Add episodes, search, review
from datetime import datetime, timezone
from graphiti_core.nodes import EpisodeType
await g.build_indices_and_constraints()
await g.add_episode(name="ep1", episode_body="Alice lives in Lisbon. She works at Acme as a designer.",
source=EpisodeType.text, source_description="chat",
reference_time=datetime(2026, 1, 10, tzinfo=timezone.utc), group_id="alice")
for e in await g.search("Where does Alice live?", group_ids=["alice"]):
print(e.fact, e.valid_at, e.invalid_at) # a person reads this, dates includedsearch returns invalidated facts too, sometimes first. Check invalid_at before the agent uses a fact.
What our test showed
| Check | Result |
|---|---|
| First episode: lives in Lisbon, designer at Acme | Two facts, both dated 2026-01-10. Successful episode adds took 16 to 36 seconds each on CPU; the failed json_object add below ran 40.0 seconds before its error |
"Moved to Porto last week, still works at Acme", json_object mode | Failed: the small model returned the schema instead of an answer. The README warns about small models |
Same episode, default json_schema mode (two runs) | No Porto fact. Lisbon stayed current. "Works at Acme as a designer" was marked invalid from 2026-10-20, though the message said she still works there |
| Our script removes that episode, standing in for a reviewer | Its new fact was removed. The designer fact stayed marked invalid |
| "No longer lives in Lisbon. Since 15 October 2026 she lives in Porto." | Lisbon marked invalid, "Alice lives in Porto since 15 October 2026" added, and a separate "Alice no longer lives in Lisbon" fact added and left current. All dated 2026-10-20 (the episode time), not 15 October |
| Search "Where does Alice live?" after that | The invalid Lisbon fact came back first, with its invalid_at date |
Telemetry default vs GRAPHITI_TELEMETRY_ENABLED=false | One outbound connection and an ID file vs none seen |
The 3B model is far smaller than the README recommends. A larger model may extract better; we did not test one.
Things to know
- The dates are the main reason to use Graphiti, and they come from the model. Have a person review invalidated facts, because a wrong invalidation hides a true fact.
- Removing an episode removes what it added, but did not restore facts it invalidated. Fixing those means editing the graph.
- Filter search results on
invalid_at, or the agent may quote an old fact. - Dates follow the episode's
reference_timeunless the model picks up a date from the text. Pass the real time each message was sent. - Use the most capable model you can run. Ours needed the default
json_schemamode to work at all. - Keep
SEMAPHORE_LIMITlow on a local server.
Takeaway
Graphiti runs locally with no key or Docker and keeps a dated history instead of overwriting facts. With a small model, the dates and invalidations are often wrong, so give a person a review step for invalidated facts and filter on invalid_at before the agent answers.
Next step: add two episodes for a test user, one fact and a plainly stated change, and check every valid_at and invalid_at before you connect a real agent.
How we check the tools we list is on our verification page.
Good setups, worth keeping. Request email updates on the home page, then confirm by email. No subscription starts until you confirm. Or find an agent for the job.
