--- title: "What is a temporal knowledge graph?" description: "A temporal knowledge graph stores entities, relationships and facts with the time each fact was valid. Definition, structure, uses in agent memory, and how to query one." canonical: https://past.dev/glossary/temporal-knowledge-graph last-updated: 2026-10-15 --- # Temporal knowledge graph Source: https://past.dev/glossary/temporal-knowledge-graph A temporal knowledge graph records when each fact became valid, when it stopped being valid and which fact replaced it. It supports current-state queries, historical queries and change tracking from the same stored facts. Agent memory systems can use this structure for information that changes over time. ## How a temporal knowledge graph is structured Entities represent people, organizations, projects and other subjects. Facts and relationships connect them, such as employment, ownership, prices and deadlines. Each fact also has temporal fields. - **Event time.** When the fact became true in the world, taken from the source record's own timestamp. - **Validity window.** The period during which the fact was the current value. An open window means the fact is current. - **Supersession link.** A pointer from the new fact to the fact it replaced, so the history stays connected. See [fact supersession](/glossary/fact-supersession). Storage varies by implementation. Zep's open-source [Graphiti](https://help.getzep.com/graphiti/getting-started/welcome) runs on a dedicated graph database. Other systems expose only a service contract. Temporal behavior depends on the data model rather than the database product. ## Temporal knowledge graph vs plain knowledge graph | Question | Plain knowledge graph | Temporal knowledge graph | | --- | --- | --- | | What is the budget? | One stored value | The current value, with the date it became current | | What was the budget in March? | Not answerable after an update | Answerable from the validity windows | | The budget changed. What happens? | The old value is overwritten | The old window closes, a new fact opens, both remain queryable | | Two sources disagree. What happens? | One value wins silently | Both facts are retained and the conflict is reportable | The [knowledge graph for LLMs](/knowledge-graph-for-llm) guide covers the non-temporal baseline in more detail. ## Why agent memory uses temporal knowledge graphs Activity data contains changing owners, prices, deadlines and decisions. Similarity retrieval ranks text without determining whether each statement is current. A temporal graph records validity periods so current-state queries can select open validity windows. Validity periods support historical queries for audits and investigations. The graph can also retain conflicts when credible sources disagree. [What is agent memory?](/what-is-agent-memory) compares temporal graphs with other memory structures. ## Querying a temporal knowledge graph through past.dev past.dev exposes a JSON memory API. `POST /api/v1/ingest` accepts raw text with its original timestamp. Once ingestion completes, `POST /api/v1/recall` returns ranked documents with dates and source excerpts for the requested identity. ```bash curl -X POST https://api.past.dev/api/v1/recall \ -H "Authorization: Bearer $PAST_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "What is the Meridian budget?", "identity": "demo-user"}' ``` The [quickstart](/docs/memory-api/quickstart) shows how to ingest, wait until ingestion completes, and recall. The [benchmarks page](/benchmarks) documents how recall quality is measured. ## Frequently asked questions ### Is a temporal knowledge graph the same as a bitemporal database? They share the core idea. A bitemporal system tracks two timelines: when a fact was true and when the system learned it. A temporal knowledge graph applies that model to entities and relationships extracted from text. See the bitemporal memory entry for the two-timeline model. ### Do I need a graph database to run one? No. Different storage engines can implement a temporal schema. Graphiti uses a graph database; other products expose the behavior through an API. Choose based on operational and contract requirements. ### When is a temporal knowledge graph unnecessary? Use plain retrieval for static documentation, fixed research corpora, and catalogs with rare updates. Use a temporal model when facts change and queries require the current or previous value. ## Related - [Bitemporal memory](https://past.dev/glossary/bitemporal-memory) - [Fact supersession](https://past.dev/glossary/fact-supersession) - [Point-in-time recall](https://past.dev/glossary/point-in-time-recall) - [What is agent memory?](https://past.dev/what-is-agent-memory) - [Knowledge graph for LLMs](https://past.dev/knowledge-graph-for-llm) - [Quickstart](https://past.dev/docs/memory-api/quickstart)