Newest Is Not the Same as Currently Effective
The first mistake in version-aware RAG is treating recency as authority. A legacy attachment may be uploaded after its replacement, while a newly approved policy may not take effect until a future date. File modification time, ingestion time, approval time, and effective time describe different events. Sorting by any one of them without a business rule can produce a confident answer from the wrong source.
Before designing retrieval, define what “current” means for the organization. It may mean approved and effective on today’s date, but validity often also depends on region, business unit, product, contract type, language, or user role. Two versions may both be current within different scopes. This is why the status cannot live only in a filename such as “final_v3_revised.” It must be represented as structured, queryable data whose meaning is agreed with the document owners.
Build a Document Model That Can Express Authority
Every document and every derived chunk should carry consistent version metadata. Chunks need to inherit document-level fields; otherwise, retrieval returns isolated text with no reliable way to tell whether it came from a draft, a withdrawn procedure, or a valid regional variant. When the source repository lacks clean metadata, the ingestion pipeline should maintain an explicit mapping or registry rather than asking a language model to infer status from filenames.
- document_id: A stable identifier shared by all revisions of the same logical document, allowing versions to be grouped correctly.
- version_id and version_order: The original version label plus a normalized sortable value, so values such as 10.0 and 2.0 are not compared as plain strings.
- status: Explicit states such as draft, approved, effective, superseded, and withdrawn, controlled by a workflow or authoritative source.
- valid_from and valid_to: The business validity interval, kept separate from creation and ingestion timestamps.
- scope and supersedes: Applicable region, product, department, permissions, and links showing which prior version or section has been replaced.
Version numbers alone are rarely sufficient. Date-based revisions, lettered amendments, emergency notices, and major or minor releases may follow different ordering rules. An active bulletin may temporarily override part of a formal manual without replacing the entire document. The data model therefore needs to express precedence and partial replacement. Embeddings cannot compensate for a candidate set that already mixes incompatible or invalid sources.
Filter for Validity Before Ranking for Relevance
A robust retrieval flow separates eligibility from relevance. First, structured filters use the query date, user identity, permissions, and operational scope to remove drafts, withdrawn records, expired revisions, and unrelated variants. Only then should the system apply vector similarity, keyword search, or hybrid ranking to the eligible chunks. This approach is more dependable than retrieving many similar passages and asking the language model to determine which one is current inside the prompt.
Temporal questions require a deliberate variation of the same rule. If a user asks what the procedure was last year, retrieval should evaluate validity at the requested date rather than at the present time. If location or product scope is missing, the assistant should ask a clarifying question or present the distinct applicable versions. It should not silently choose the highest version number. When metadata is inconsistent or two records claim authority over the same scope and period, the safer outcome is to expose the conflict and route it for ownership review.
Make Answers Traceable and Test Version Conflicts
Generation still needs safeguards after retrieval. Instructions should tell the model to answer only from sources marked eligible and to avoid combining conflicting revisions into a synthetic policy. Citations should expose the document title, version, effective date, and source link so users can verify that the answer fits their context. If an answer cites both a superseded document and its replacement as equal authorities, that should be treated as a retrieval or governance defect, not as a wording problem.
Evaluation sets should intentionally contain difficult version scenarios rather than only clean, single-version documents. Useful tests include an obsolete version whose wording more closely matches the question, a detailed draft competing with a shorter approved release, a future revision already present in the repository, simultaneous regional variants, and an emergency notice that overrides only selected sections. After synchronization changes, index rebuilds, or ranking updates, verify the eligible candidate set, the final citations, and the version named in the answer. In practice, trustworthy version resolution comes from an explicit document lifecycle, enforceable filters, and observable decisions—not from expecting the language model to guess which document the organization currently follows.