IKSResearch & insights

Give Retrieval a Snapshot Contract

Keep retrieved passages, document versions, permissions, and citations consistent by defining a snapshot contract for every retrieval-augmented answer.

An answer quotes the current handbook but links to yesterday's paragraph. Both components are individually valid: the retriever found a relevant chunk, and the citation service returned a real document. Their combination is false because the chunk and document came from different revisions. Increasing retrieval recall will not repair this failure. The system needs a consistency contract spanning ingestion, retrieval, generation, and citation rendering.

Treat every answer as a read against a named corpus state. This does not require copying the whole corpus for every request. It requires making version boundaries explicit and retaining enough information to determine whether the evidence shown to a reader is the evidence supplied to generation. Without that boundary, an answer can be irreproducible before it finishes streaming.

Identify the versions that actually matter

A document identifier alone is insufficient. Store its revision identifier, content digest, parser version, chunking policy, embedding space identifier, and access-policy version. These fields answer different questions. The content digest identifies bytes; the parser determines extracted text; the chunker determines boundaries; the embedding space determines how a query can be compared with indexed vectors.

Use stable document identity for lifecycle operations and immutable revision identity for evidence. A revision might contain many chunks, each with offsets in a specific extracted-text representation. Avoid offsets into a mutable HTML view unless that view is itself versioned. A minor navigation change can move byte positions while leaving the visible paragraph unchanged.

The retrieval response should carry a manifest: query identifier, corpus generation, selected chunk revision identifiers, retrieval configuration, and authorization context reference. The manifest is an evidence envelope, not a log of every internal operation. It should be small enough to retain with the answer and precise enough to resolve every citation later.

Stage ingestion before advertising availability

Suppose a collection contains 10,000 documents. A policy update changes 600 of them. Publishing each document immediately as it finishes embedding produces a mixed collection during the update. That may be acceptable for unrelated documents, but it is hazardous when a new policy cross-references an updated exception table that has not arrived yet.

Define the consistency unit around the content's dependencies. Some collections need a full release generation. Others need only a document family or customer workspace to advance together. The ingestion process writes a staged generation, validates completeness, and then changes a small active-generation pointer. Readers pin that pointer for their retrieval session rather than repeatedly asking what is current.

Figure 1 — Incremental publication exposes a mixed update; generation activation delays freshness to preserve the chosen release boundary. Illustrative model — not measured data.

The pointer switch does not magically make distributed storage transactional. Before activation, confirm that every referenced object is readable through the actual serving path. A vector index reporting ingestion completion may still differ from the citation store's visibility. Activation needs a readiness condition across the components that serve the request, plus a rollback pointer to the prior usable generation.

Permissions must remain live

Snapshot consistency and authorization freshness are different requirements. Pinning content must not pin permission to disclose it forever. A user whose access is revoked while generation is running should not receive a delayed answer merely because the retrieval began earlier. Check permissions at retrieval and again before disclosing sensitive output, using a policy appropriate to the delivery channel.

This creates a deliberate asymmetry. Content evidence can remain historically stable, while authorization must reflect the current disclosure decision. Store the authorization decision reference for audit, but do not treat it as a permanent bearer capability. Long-running jobs need explicit expiry and reauthorization rules.

Caches must respect the same separation. A cache key containing the query and corpus generation can still leak information across tenants or roles. Include the relevant authorization scope or cache only evidence candidates and reapply access checks before use. When permission equivalence is difficult to prove, prefer a narrower cache boundary even if it reduces hit rate.

Budget storage with a retention equation

Versioning has a cost, but the dominant term is often more manageable than an unbounded “keep everything” design suggests. Consider a hypothetical corpus with 20 million chunks and a stored footprint of 2 kilobytes per chunk, for text only in this simplified calculation; embeddings and index structures are excluded. The base footprint is 40 gigabytes using decimal units.

If one percent of chunks change daily, retaining thirty days of superseded versions adds approximately 12 gigabytes before replication, index overhead, and compaction effects. The estimate is 20 million multiplied by 0.01, multiplied by 30, multiplied by 2 kilobytes. Actual storage engines need their own measurements, but this establishes the variables that deserve attention.

Figure 2 — Corpus text history grows with change rate and retention; per-answer evidence bundles add storage proportional to retained answers. Embeddings, replication, and index overhead are excluded. Illustrative model — not measured data.

Retain the exact evidence used by important answers independently from general corpus retention when policy allows. This can be a compact evidence bundle rather than an entire old index. However, deletion requirements and access revocation still apply. The retention policy should explicitly state when an answer remains visible but its original evidence is no longer available.

Do not estimate the full serving footprint from the text-only chart. Add vector storage, identifiers, index structures, replicas, and retained answer bundles as separate terms, using measurements from the chosen implementation. Shared immutable chunks can reduce duplication between corpus history and answer evidence, but only if references prevent premature deletion. A garbage collector must account for those references and any deletion obligations before reclaiming a historical chunk. The storage policy is therefore part of evidence availability, not merely an infrastructure optimization.

Handle partial failures without rewriting history

If a citation object is missing, the system should not quietly substitute the latest document. A newer revision might reverse the original guidance. Return an unavailable-evidence state or regenerate the answer against a fresh snapshot, with a new answer identifier. The distinction matters because regeneration is a new computation, not restoration of the original evidence.

If the active index is unavailable, falling back to an older generation may be reasonable for a low-risk knowledge search. The response must disclose its effective freshness and satisfy the same permission checks. For a workflow where recent changes are essential, failing closed on freshness may be the correct behavior. Make freshness a request constraint instead of a hidden implementation preference.

A revision manifest also helps diagnose apparently random failures. Compare successful and unsuccessful answers by parser version, chunk boundaries, and corpus generation. An indexing regression can otherwise masquerade as model variability. Replaying the same question against a controlled generation removes one major source of ambiguity from evaluation.

Snapshot identifiers also belong in feedback records. If a reader marks an answer incorrect, retain the manifest reference with that feedback instead of only the question text. Otherwise a later evaluation may retrieve corrected documents and conclude that the reported problem cannot be reproduced. That hides the original failure and biases quality measurements toward the corpus as it exists during review.

A migration that can be reviewed

Start by adding immutable revision identifiers to retrieval results while leaving current serving behavior intact. Then attach those identifiers to citations and reject mismatched revisions in a non-production evaluation path. Measure how often the existing system would have paired stale evidence with a current document. That number estimates the immediate value of the contract.

Next introduce staged ingestion for one collection with frequent coordinated updates. Test activation while the citation store is delayed, while an index shard is unavailable, and while a user loses access. Verify that failure states remain distinct: unavailable corpus, missing citation, unauthorized disclosure, and exceeded freshness constraint should not collapse into a generic empty answer.

Finally, make the snapshot manifest part of the answer interface. Application teams can then display meaningful freshness, support reproducible feedback, and distinguish a changed source from a changed model response. Retrieval quality is still important, but consistency determines whether a well-retrieved passage can be trusted as the actual basis of the answer the user sees.