What we built
A query-level cache in front of retrieval to cut cost and latency. The cache key was a hash of the normalised question. Hit rate was excellent.
What broke
The policy corpus was re-indexed after a change to parental leave rules. The cache did not know. For eleven days, anyone who asked a question someone else had already asked got the old answer, with a confident citation to a document that no longer said that.
Why nobody noticed
Retrieval recall on the golden set stayed perfect, because the golden set was built from the old corpus. Latency dashboards looked better than ever. There was no metric for "answer freshness".
What we changed
Every index build writes a version. The version is part of the cache key. A re-index invalidates everything, which is the correct trade.
We also added a freshness metric that tracks the age of the newest source passage behind each answer, plotted against corpus age.
The lesson
A cache in front of a knowledge base stores answers that were true for one corpus version. Put that version in the key.
Key takeaways
- Cache keys must include the corpus version as well as the query.
- Staleness is invisible without a freshness metric on answers.
- The fix was ten lines, but detecting the problem took eleven days.
Terms in this piece
About this failure story
- Format
- Failure story
- Level
- Practitioner
- Read
- 1 min read
- Published
- Sep 20, 2026
- Disciplines
What failed and why: the most useful kind.
More on these topics
Explainer · · 4 min read
What RPO and RTO mean, and how to set targets you can meet
RPO is how much data you can lose and RTO is how long you can be down. What decides each one in practice, and how to test them before an outage does.
Decision note · · 2 min read
We chose Azure AI Search for retrieval because ingestion and filtering stay simple
Why our retrieval runs on Azure AI Search: our Databricks ingestion pipelines feed it directly, filtering is simple, and several semantic configurations share one index.
Checklist · · 12 checks
RAG production-readiness checklist
Twelve checks to pass before a retrieval system answers a real user. Tick them locally; progress stays in your browser.
Discussion