Ask a document assistant "What's our refund window?" and it says thirty days. It cites the policy and sounds sure. It is wrong. The window changed to fourteen days last spring, and the old edition simply had more words in common with the question.

Most RAG systems treat a document collection as facts that are all true at once. Real collections change. Policies get replaced, prices move, and a retrospective written in 2024 describes a trip from 2012. A system that can't tell when something was true will mix eras and quote old figures, and it will sound confident while doing it.

Temporal RAG fixes this by asking "when was that true?" before "what matches?".

What broke

The assistant answered questions from one owner's archive: almost twenty years of versioned policies and price lists next to journals, reviews and recorded talks. Textbook RAG demoed well, then failed on real questions:

  • "What's the current price?" returned an old edition.
  • "What happened in 2021?" mixed in 2019 and 2023.
  • "When did I first…?" was answered from a later look-back.
  • "Did the 2015 notes mention the merger?" got a yes, because a 2024 document did.

The model wrote good sentences from bad evidence. Every failure came from retrieval treating dates as ordinary words.

How it works

Two paths share two stores. Ingest dates every passage and writes to the edition registry and the hybrid index. Each question is planned, then searched one period at a time. Retrieval and the optional hop read both stores.

Eight ideas carry the design:

  1. Give every passage three dates: when it was written, what period it is about, and the years it only mentions in passing.
  2. Work out "current" at query time. Keep editions and their in-force dates in a small registry. Never store "is current" on the vectors.
  3. Plan before searching. Decide the question's shape, its periods and which date to filter on. Use rules first and a small model second. "Now" counts as a period.
  4. Search each period separately, so a busy year can't crowd out a quiet one.
  5. Rerank on the topic, not the date. Rerankers read "2017" as a word, so they miss a passage that says "CFO from 2014 to 2019".
  6. Decide found or not found for each period. "Nothing from 2015 mentions it" is a real answer, not a failure.
  7. Hop when the date is hidden. For "which policy applied when the deal closed?", find the date of the event, then the edition in force that day.
  8. Label the evidence. The answer model sees passages grouped by period, with look-backs marked as look-backs.

Results

On a 30-question benchmark over a synthetic test corpus:

MeasureTextbook RAGTemporal RAG
Cited passages from the right period68%100%
Point-in-time answers mixing in other years44%0%
"Current" questions answered with an old figure29%0%
Required facts in the answer84%96%

That suite soon got too easy, so we grew it to about 120 harder questions with counting, arithmetic, trends and multi-hop questions. Scores dropped, which was the point. Most of the lessons came from the harder set.

What surprised us

  • Look-backs are the hardest passages. "Looking back at 2012", written in 2024, is about two periods at once.
  • Middle years vanish. Ask about 2018 to 2024 and the answer quietly skips 2020.
  • The future gets answered with the present. Asked for the 2027 price, almost every model we tested gave today's price. Only one said the documents don't state it.
  • "Yes" is the dangerous word. Wrong answers to "did X mention Y?" usually start with "Yes" and then quote a later document.

Build your own

Time is the dimension most RAG systems ignore and most users rely on. You don't need a new model to handle it, only retrieval that asks when something was true.

Technology

  • Temporal RAG
  • Hybrid search
  • Query planning
  • Cross-encoder reranking
  • Edition registry
  • Temporal evals