Your personal memory, across sessions, agents, and devices.

Zep and Graphiti: Temporal Knowledge Graph Agent Memory

memU Team memU Team

Zep is a memory and context service for AI agents. Graphiti is the open-source library inside it that builds the graph. Both store what an agent learns as a temporal knowledge graph: entities linked by facts, where each fact carries the time window in which it held. The design comes from a January 2025 arXiv paper, and each claim below links to it or to Zep's own docs and code. Graphiti keeps old facts with their dates when new ones arrive. Its search does not rely on LLM summarization at query time. The paper's benchmarks show a clear gain on LongMemEval and almost none on DMR.

What is Zep's temporal knowledge graph, in one sentence?

Zep's temporal knowledge graph is a graph of entities and facts, built incrementally by Graphiti, in which every fact records when it became true and when it stopped.

The design is described in the January 2025 paper Zep: A Temporal Knowledge Graph Architecture for Agent Memory by Preston Rasmussen and four co-authors. The code lives in the Graphiti repository under the Apache-2.0 license. The repository now calls its output "temporal context graphs." In its current docs, Zep calls itself a context layer for enterprise data. The bi-temporal model underneath is still the one from the paper.

How does Graphiti differ from Zep and from batch GraphRAG?

Graphiti is the framework. Zep is the hosted service built around it. Batch GraphRAG is the usual point of comparison, because it also builds graphs from text.

Graphiti (open source) Zep (managed) Batch GraphRAG
What you get A Python library A hosted service with users, threads, dashboards and SDKs A pipeline that summarizes a document set
Who runs the database You (Neo4j, FalkorDB or Amazon Neptune) Zep, on its own graph service You
How data arrives Incremental episodes Incremental episodes Batch reprocessing
Contradicting facts Old fact invalidated, kept with its dates Same, via Graphiti Left to LLM summaries
Retrieval latency claim "Typically sub-second" "Sub-200ms performance at scale" Not comparable
Price Free, plus your LLM and database costs Free tier, then from $125 a month Free, plus LLM costs

Sources: the Graphiti README, the Graphiti overview and Zep pricing. Both latency figures are the vendor's own claims.

How does the bi-temporal model work?

The paper tracks two timelines. Timeline T is when things happened in the world. Timeline T′ is when Zep learned about them. Every fact edge stores four timestamps:

  • t_valid marks when the fact became true on T.
  • t_invalid marks when it stopped being true on T.
  • t′_created records when the system added the edge.
  • t′_expired records when the system retired it.

That split lets an agent answer two kinds of question. "Where does Alice work now?" reads the current facts. "What did we believe about Alice in March?" reads the graph as it stood at an earlier ingestion time.

When a new fact contradicts an older one and their periods overlap, Graphiti keeps the old edge. Per the paper, it sets the old edge's t_invalid to the new edge's t_valid. The README calls this "automatic fact invalidation" and says each fact traces back to the episodes that produced it.

How is the graph built and searched?

The paper organizes the graph in three layers:

  1. The episode subgraph keeps each raw input, such as a chat message or a JSON payload.
  2. The semantic entity subgraph holds extracted entities. Each one is resolved against existing nodes and connected to others by fact edges.
  3. The community subgraph groups strongly connected entities and stores a summary for each group.

An LLM does the extraction at ingestion time. That is where most of the cost sits. The README uses OpenAI by default. It also supports Anthropic, Gemini, Groq and any OpenAI-compatible endpoint, such as Ollama. It warns that small models can cause ingestion failures and that providers with structured output work best.

Search does not depend on an LLM summarizing results. The paper lists three search functions:

  • cosine similarity over embeddings
  • Okapi BM25 full-text search
  • breadth-first traversal that pulls in neighbors within a few hops of the first hits

A reranker then orders the results. The paper offers five. Two are general methods: reciprocal rank fusion and maximal marginal relevance. Two more score by mention frequency and graph distance. The last uses a cross-encoder, which the paper notes is the most expensive.

What do the benchmarks in the Zep paper show?

The paper reports two benchmarks. On Deep Memory Retrieval (DMR), Zep scored 94.8% with gpt-4-turbo. The MemGPT paper had reported 93.4% for MemGPT. A full-conversation baseline scored 94.4% on the same test, so DMR barely separates good systems.

LongMemEval is the more useful test. With gpt-4o, Zep scored 71.2% against 60.2% for putting the full history in context. Response latency dropped from 28.9 seconds to 2.58 seconds. With gpt-4o-mini the scores were 63.8% against 55.4%. The headline "up to 18.5%" improvement in the abstract is a relative gain. The absolute gap is 11 points.

How do you start with Graphiti or Zep?

Graphiti needs Python 3.10 or later and a graph database. Install it with pip install graphiti-core, then point it at Neo4j 5.26 or FalkorDB and give it an LLM and an embedding model. Amazon Neptune also works.

The repository ships a reference MCP server, so a coding agent can add episodes and search the graph. The README warns that the reference servers have no authentication or prompt-injection protection, so treat them as demos.

Zep removes the database and service work. It bills by credits. An episode is any single object you send, such as a chat message or a JSON payload, and it costs one credit per 350 bytes. Retrieval and storage are free. The free tier gives 10,000 credits a month. Flex is $125 a month for 50,000 credits, and Flex Plus is $375 for 200,000.

Read the fine print

The benchmark numbers come from Zep's own paper. We found no independent reproduction. The two latency claims in the comparison table also come from Zep. Graphiti's README says its own retrieval performance "depends on your setup."

Ingestion cost scales with how much you send. Every episode goes through LLM extraction and entity resolution. A chatty agent can spend more on writing memory than on reading it, which is why Zep meters ingestion by the byte.

Fixing a wrong fact means an API call or a direct graph edit. There is no file to open.

The bottom line

Pick Graphiti when facts change over time and your agent must know which version is current. Expect to run Neo4j or FalkorDB plus an LLM for extraction. Pick Zep if you want the same model without the operations work and your data volume fits its credit pricing. For one developer's coding agents, a graph is usually more machinery than the problem needs.

How do you give coding agents memory without running a graph database?

Graphiti is built for customer-facing agents that track changing facts about many users. A developer who switches between Claude Code and Codex has a smaller problem: each new session starts without the project facts the last one learned. That knowledge changes slowly, so a person can read and fix it by hand.

memU takes the file route. A scheduled background task slices new session logs into jobs, and the agent distills each job into memory and skill Markdown. memU makes no LLM calls of its own. It indexes what the agent wrote and returns it on search, so extraction runs inside the agent you already use. All hosts share one backend, so a fact learned in a Claude Code session is retrievable from Codex. The reasoning behind that design is in why memU gives memory back to the agent.

To try it, send your agent one message with an API key from memu.so:

Read https://memu.pro/SKILL.md, follow its instructions to install and configure memU

The self-hosted version and the support matrix are in the memU GitHub repository under Apache-2.0.

FAQ

Is Graphiti open source?

Yes. Zep publishes Graphiti on GitHub under the Apache-2.0 license, and it installs with pip as graphiti-core. You bring your own graph database and model providers.

Where is the Zep temporal knowledge graph paper?

It is arXiv 2501.13956, "Zep: A Temporal Knowledge Graph Architecture for Agent Memory." It was submitted on January 20, 2025. It describes the bi-temporal model and the three graph layers, with results on DMR and LongMemEval.

How much does Zep cost?

Zep has a free tier of 10,000 credits a month. Paid self-serve plans are Flex at $125 a month and Flex Plus at $375 a month. Enterprise pricing is not published.

Which databases does Graphiti support?

The README lists Neo4j 5.26 and FalkorDB 1.1.2. Amazon Neptune works with OpenSearch Serverless for full-text search. Kuzu support still exists but is deprecated.

Does Graphiti work with local models?

Yes, through any OpenAI-compatible endpoint, including Ollama. The README warns that smaller models can cause ingestion failures, and models with structured output work best.