A vector index answers a narrow question: which stored items are close to this query in the embedding space? That is a powerful discovery mechanism, but it is not a source of truth about ownership, freshness, or readiness.
This distinction becomes visible when documents change. Imagine a user replaces a policy file. The old passages may remain in the vector index while the new version is still processing. A similarity search can return an old passage with a convincing score. Similarity says the wording is relevant; it does not say the content is current.
The same problem appears in queued ingestion. A message can be delayed or delivered more than once. If the message itself chooses which account or document version to update, an old retry could overwrite newer state. The queue should carry work forward, while durable application records decide which work is authorized.
Keep authority in a durable record
In K2 Chat, the tenant-owned document record and its authorized object metadata establish the current document and version. The ingestion consumer checks those records before it processes an object. Queue fields do not get to redefine the tenant or choose a version.
That gives each passage a useful identity: tenant, document, and version. Search can return candidates, then the application can compare their metadata with the current ready record. The gate is conceptually small:
function isCurrentReadyPassage(passage, activeDocument) {
return Boolean(activeDocument) &&
passage.tenantId === activeDocument.tenantId &&
passage.documentId === activeDocument.id &&
passage.versionId === activeDocument.versionId &&
activeDocument.status === "ready";
}
The check is deliberately independent of the relevance score. A high-scoring passage from another account or an older version is still ineligible. Search narrows the work; authority decides what can cross into the answer.
This also explains why version metadata must survive the path from ingestion through retrieval and citation. If one stage drops it, later stages cannot distinguish current evidence from stale evidence. Metadata should be validated at boundaries rather than assumed because an earlier component handled it correctly.
Cached answers need the same discipline
Caching introduces another form of old state. A cached response can be textually useful long after the document version that supported it has changed. A time-to-live limits how long an entry stays around, but elapsed time does not prove that its citations are current.
For a cached answer with private citations, the system checks the cited document versions against current ready records. If one no longer matches, the cached response is discarded and the request is regenerated. A cache hit is an optimization, not an exception to the evidence rules.
The key detail is that validating a citation is not enough if the answer itself depends on it. If a supporting source is stale, returning the cached prose without that citation would hide the same problem. The safer response is to regenerate the answer from currently eligible context.
Make stale data visible in tests
Tests should construct plausible but invalid candidates: a passage from a prior version, a document still building, a deleted record, and a vector belonging to a different tenant. They should verify both that those candidates do not become citations and that stale cached answers are not replayed. These cases catch boundary failures that ordinary happy-path retrieval cannot expose.
Operationally, this boundary also improves diagnosis. When a result is rejected, logs can record a reason category—such as version mismatch or non-ready state—without copying private passage text into telemetry. Teams can then distinguish a relevance miss from a freshness rejection and focus investigation on the stage that needs attention.
The design principle is simple: retrieval ranks candidates, durable records establish authority, and citations carry the evidence relationship into the user-facing response. Keeping those roles separate makes stale data a routine validation case instead of a source of confident, quietly outdated answers.