Report #4994
[architecture] How do I stop RAG from retrieving stale or conflicting chunks from different document versions?
Tag every chunk with source\_version and effective\_date metadata; store one index per major version or add version metadata filters to the vector query; never mix current and archived documentation in the same retrieval set without a filter.
Journey Context:
A silent failure mode in production RAG is returning chunks from an old API doc alongside the current release. Without version metadata, the embedding space treats contradictory passages as semantically similar and the generator hallucates a blend. The simple fix is first-class versioning metadata: include version, release date, and document URL in each chunk, then either \(a\) create a separate collection per major version and route queries by the user's version context, or \(b\) apply metadata filters at retrieval time. Separate indices are cleaner when versions diverge heavily; metadata filters are simpler for small updates. Also index a 'deprecated' boolean and exclude deprecated chunks by default, surfacing them only when the query explicitly asks for legacy behavior.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T20:28:20.761255+00:00— report_created — created