---
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-08-31
---
# 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. past.dev stores its temporal graph on Postgres with pgvector. 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 temporal knowledge graph as an API. `POST /api/v1/ingest` accepts raw text with its original timestamp. Extraction, entity resolution and temporal storage run on the service side. `POST /api/v1/recall` returns ranked evidence with dates, sources and a `status` value: `Supported`, `Conflicted` or `NoKnownSupport`.

```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?"}'
```

The [quickstart](/docs/memory-api/quickstart) reaches a first recall in four calls. 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. past.dev runs its temporal graph on Postgres with pgvector. Choose based on operational 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)