Promote a compatible retrieval system as one immutable snapshot
Bind encoder geometry, codebooks, corpus versions, metadata, and serving parameters into a reviewable artifact.
On this page
The question for today
What you’ll understand
- List the artifacts that make encoded vectors interpretable.
- Trace an atomic snapshot selection and compatible rollback.
- Check coverage and model compatibility before promotion.
An index file is only one piece of a retrieval system. Its vectors came from a specific embedding pipeline, its compressed bytes require particular codebooks, and its document IDs refer to a particular corpus and visibility boundary. Deploying those pieces independently can produce plausible-looking distances over an incoherent space. Treat a release as an immutable compatible bundle with one selected manifest. Promotion then changes which complete bundle new queries use, while rollback selects another complete bundle whose encoder and document mapping still match its index.
Name every dependency that defines geometry
A manifest should identify the query and document encoder versions, tokenization and text preprocessing, pooling, dimension, dtype, normalization, score metric, and any learned transform. For an IVF or PQ index it also identifies the trained coarse and product codebooks. Include stable document-ID mapping, corpus versions, metadata or visibility boundary, and required search parameters. A checksum establishes artifact identity, while a schema and compatibility check establish what those bytes mean together.
Equal dimensions are necessary for vector arithmetic but insufficient for model compatibility. Two encoders can both emit four coordinates while assigning completely different meanings to each direction. A rollback that loads an old index but keeps a new query encoder can therefore return confidently wrong neighbors without any shape error. Some systems deliberately use distinct query and document encoders; preserve that trained pairing rather than requiring identical binaries or assuming either side can be swapped independently.
Build and validate before selecting the bundle
Construct a candidate snapshot away from live traffic, verify artifact integrity, and check dimensions, item counts, stable IDs, and version-watermark coverage. Faiss I/O documentation explicitly makes callers responsible for loading trusted, unaltered index artifacts; deserialization is not a semantic compatibility validator. Run exact-reference recall checks, filter and deletion tests, and resource measurements using the candidate’s own compatible query pipeline. A file that loads successfully can still contain the wrong model’s vectors or an incomplete corpus.
An application can publish a new manifest identifier through an atomic pointer or compare-and-swap operation, while each query captures one manifest for its whole request. Load and validate the referenced artifacts before making that pointer visible. Keep old artifacts alive while in-flight requests still hold them. The exact storage primitive depends on the deployment platform; the lesson’s invariant is that one query must not mix encoder A, index B, and metadata C merely because those components refreshed at different moments.
Rollback needs the matching visibility story
A canary should compare complete bundles on a declared query sample, record their artifact IDs with latency and result metrics, and avoid changing the evaluation population mid-comparison. Test rollback before relying on it: confirm that the previous encoder, index, codebooks, and ID mapping remain available and loadable. If the previous snapshot predates important deletions or updates, define how current visibility overlays or replayed deltas are applied before sending its results to users.
Keep the promotion record small and auditable: candidate identity, source watermark, validation outputs, selected configuration, and previous pointer. Rollback is not a substitute for discovering why the candidate failed; preserve its artifacts and query traces for diagnosis. Rebuilding from source should be reproducible enough to explain differences, but retaining the exact validated bytes avoids assuming a stochastic graph builder will recreate an identical artifact. The operational unit is the compatible bundle that was actually tested.
Work it through
Identical dimensions can hide a broken rollback
Snapshot A uses query encoder A with qA=(1,0) and document vectors U=(1,0), V=(0,1). Snapshot B uses a consistently swapped coordinate system: qB=(0,1), U=(0,1), V=(1,0). Both use maximum inner product and dimension 2.
Within A, qA·U=1 and qA·V=0, so U wins. Within B, qB·U=1 and qB·V=0, so the compatible transformed bundle also returns U. Each complete snapshot preserves the intended association.
Now load index A while keeping query encoder B. The mixed scores become qB·U_A=0 and qB·V_A=1, so the same query returns V. The vectors still have dimension 2, and all arithmetic is finite.
A compatible rollback selects encoder A with index A and its mapping, restoring scores 1 and 0 for U and V. Switching one manifest for the complete bundle avoids the mixed case; changing only the index pointer does not establish compatibility.
Shape checks alone accept the broken combination. The manifest must bind the query representation to the index geometry and document mapping, including during rollback.
The living notebook
Explore the model
Interactive lab · matrix
A new coordinate transform is not just a new filename
Reset, set Diagonal scale a to 1 and Shear b to 0, predict the identity transform and determinant 1 before Step. Reset, set a to 1 and b to 1, predict A=[[1,1],[0,1]] and determinant 1 before Step. Equal determinant does not mean equal geometry. Readouts refer to the selected final matrix while playback interpolates; this small transform is not an embedding encoder, deployment system, or snapshot compatibility checker.
- Area scale · det A
- 1.4
- Singular values · σmax, σmin
- 1.597, 0.876
- Condition number · κ₂(A)
- 1.823
The selected matrix is A = [[a,b],[0,1]]. Playback interpolates geometry between the identity and A; readouts always describe A. Its determinant is a and its singular values come from AᵀA. Positive a makes every supported matrix invertible. This two-dimensional family is not a general eigensolver or a learned network. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forPreserving array dimensions or one aggregate property does not certify that two coordinate systems are interchangeable.
Pause & reason
Check your understanding
Your turn
Try it yourself
A candidate manifest expects 1,000 stable IDs at watermark 50. The built index has 995 unique IDs, including all expected IDs except five; its dimension and checksum match the recorded build. Is this sufficient for promotion? State the measured coverage and the missing check outcome.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Artifact identity proves which bytes were built, not that the source population is complete.
Compare with the solution
Coverage is 995/1,000=0.995, or 99.5%, with five expected IDs absent. Matching dimensions and the recorded checksum do not repair incomplete ingestion. The declared complete-watermark check fails, so a complete snapshot should not be promoted until the missing IDs are accounted for or the intended source manifest is explicitly corrected and revalidated.
Keep the idea
Take it with you
- An index snapshot includes the encoder geometry and all decoding dependencies.
- Capture one compatible manifest for each request.
- Promotion and rollback must preserve version coverage and visibility as well as bytes.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.