Course contentsShow
← Machine Learning and Deep Learning
Lesson 2038 of 3,53843. Retrieval-Augmented Generation: Advanced TechniquesFree lesson

Dealing with Outdated Information

Implement timestamp-aware retrieval, cache invalidation strategies, and recency-biased ranking for dynamic knowledge.

Dealing with Outdated Information

What you'll learn: How to keep your RAG system fresh by prioritizing recent information and invalidating stale data.

The Staleness Problem

Even when retrieval succeeds, the returned context might be obsolete—last quarter's pricing, deprecated API documentation, or superseded policies. Unlike traditional databases where updates replace old records, document stores often accumulate historical versions, and embeddings don't inherently understand "this is newer."

Three Core Strategies

Timestamp-Aware Retrieval

Store document timestamps as metadata alongside embeddings. During retrieval, filter or boost results based on recency. For example, exclude chunks older than 6 months for fast-changing domains like tech documentation, or apply exponential decay to similarity scores based on age:

adjusted_score = similarity_score * exp(-decay_rate * age_in_days)

Analogy: Like preferring this year's guidebook over a decade-old one when planning a trip.

Cache Invalidation Strategies

If your RAG system caches retrieved documents or generated responses, implement time-based or event-driven invalidation. Set TTLs (time-to-live) for cached entries, or trigger cache clears when source documents update. This prevents serving stale answers long after underlying data changes.

Recency-Biased Ranking

Beyond filtering, adjust your reranking stage to favor newer documents when relevance scores are similar. Add a temporal feature to your reranker or use a weighted combination:

final_score = alpha * relevance_score + beta * recency_score

Tune alpha and beta based on how critical freshness is for your domain (news: high beta; historical research: low beta).

Practical Considerations

Track document versions explicitly. When new versions arrive, either remove old embeddings or tag them as "archived" in metadata. For rapidly changing knowledge bases, schedule periodic re-indexing.

Key Takeaway: Outdated information undermines RAG reliability—use timestamp metadata, cache invalidation, and recency-weighted ranking to ensure your system surfaces current knowledge, not historical artifacts.