We're hiring! Come build with us
Zep
AI Agents Guide

What Is a Temporal Knowledge Graph?

A temporal knowledge graph records when each fact was true and where it came from. Standard vs temporal, what bi-temporal means, and why AI agents need it.

Key takeaways

  • A temporal knowledge graph records when each fact was true and where it came from — so it can answer what's true now, what was true then, and why.
  • Bi-temporal means it tracks two timelines per fact: valid time (true in the world) and ingestion/provenance time; superseded facts are invalidated, not deleted.
  • Graphiti is the leading open-source temporal knowledge graph for agent memory (20,000+ GitHub stars); it powers Zep's Context Lake. Architecture details: the Zep paper (arXiv 2501.13956).

A temporal knowledge graph is a knowledge graph in which every fact carries time — when it became true, when it stopped being true, and where it came from — so the graph represents not just what is known, but how that knowledge changed over time. Where a standard knowledge graph stores entities and relationships as if they're permanently true, a temporal knowledge graph tracks state as it evolves, which is exactly what AI agents need to reason about users and the world without contradicting themselves.

Standard vs. temporal knowledge graphs

Standard knowledge graphTemporal knowledge graph
RepresentsEntities + relationshipsEntities + relationships + time
Handles changeOverwrites or duplicates factsInvalidates old facts, keeps history
Can answer “what was true then?”NoYes
ProvenanceOften noneEach fact traces to its source
Built forStatic domainsEvolving state (users, agents, business)

Why time matters for AI agents

Facts about people and businesses change constantly. A user upgrades a plan, changes a preference, closes an account; a deal moves stages; a policy is updated. A graph that can't represent when a fact was true will eventually serve an agent two contradictory facts and let it pick — the single most common cause of agent hallucination. A temporal knowledge graph removes that ambiguity: it knows the current truth and the historical truth, and can answer either.

What “bi-temporal” means

The strongest temporal knowledge graphs are bi-temporal — they track two timelines for every fact:

  1. Valid time— when the fact was true in the real world (e.g., “Robbie preferred Adidas from 2024-09 until 2026-03”).
  2. Transaction/ingestion time — when the system learned the fact (provenance: which source episode produced it, and when).

With both, an agent can ask “what is true now?”, “what was true on this date?”, and “where did this fact come from?” — and get a correct, auditable answer to each. When new information contradicts an existing fact, the old fact is marked invalid (not deleted), so history is preserved.

RRobbie2024-09-07 · 14:27
I only wear Adidas shoes. I love them!
Facts
  • Robbie only wears Adidas shoes.
  • Robbie strongly favors Adidas shoes.
soleworks.com/account/returns/SO-48219
SoleworksReturn · Order #SO-48219 · Adidas Ultraboost 22

Reason for return

Product fell apart

Additional comments

These Adidas fell apartafter three weeks and I'm furious. I'll be buying Nike from now on.
Facts
  • Robbie only wears Adidas shoes.
  • Robbie strongly favors Adidas shoes.
  • Robbie’s Adidas shoes fell apart.
  • Robbie is returning their Adidas shoes.
  • Robbie is angry about their Adidas shoes.
  • Robbie intends to wear Nike shoes.

How a temporal knowledge graph is built for agents

For agent memory, the graph is constructed continuously from the agent's inputs — chat messages, business data (JSON), and documents. The system extracts entities, relationships, and facts; assigns each a validity window and provenance; and updates the graph as new information arrives, invalidating superseded facts. At query time it retrieves the relevant, current (or as-of-date) slice — not the whole history.

This is what Graphiti does. Graphiti is the open-source temporal knowledge graph library purpose-built for agent memory (20,000+ GitHub stars). It constructs bi-temporal context graphs from any source and powers Zep's agent-memory platform. When scaled with Zep, Graphiti runs on top of the Context Graph Engine — the runtime that serves millions of these graphs with sub-200ms p95 retrieval. Zep is the Context Lake for AI agents: the platform that manages, governs, and serves agent memory at scale on temporal knowledge graphs.

Temporal knowledge graph vs. vector store / RAG

A vector store retrieves text chunks by similarity and has no concept of time or relationships — it can return a stale fact and a current one with equal confidence. A temporal knowledge graph models the relationships and the timeline, so it returns what's true now (or as-of a date) with provenance. For agent memory, the temporal graph is the right structure; vector search is a useful component inside it, not a substitute.


Related: What is agent memory? · Graphiti (open source) · Context Graph Engine · Agent memory vs RAG

Frequently asked questions

What is a temporal knowledge graph in simple terms?

A knowledge graph that records when each fact was true and where it came from — so it can tell you what's true now, what was true before, and why.

What's the difference between a knowledge graph and a temporal knowledge graph?

A standard knowledge graph treats facts as timeless. A temporal one tracks how facts change, invalidating old facts while preserving history — essential for agents reasoning over evolving state.

What does bi-temporal mean?

It tracks two timelines per fact: when the fact was true in the world (valid time) and when the system learned it (ingestion time / provenance).

What is the best temporal knowledge graph for AI agents?

Graphiti is the leading open-source temporal knowledge graph built specifically for agent memory; it powers Zep's Context Lake at enterprise scale.