Retrieval and RAGScale and federated operationsStaff
How would you migrate embedding models without mixing incompatible vector spaces or losing concurrent updates?
By Amit Kumar3 min readWorked answer includedReviewed 27 Sept 2026
The question
Interview question
Old documents use one embedding model and new documents another. Both vectors have 768 components, so the index accepts them, but all queries now use the new encoder and old documents disappear from results. Explain the failure and design versioned generations, backfill with concurrent writes/deletes, atomic query routing and safe rollback.
Draft your approach first
Take a few minutes before you read the answer. Name the constraint that matters most, the failure you are designing for and how you would know it worked.
Reveal the worked answerWorked answer
Equal dimensions do not mean a shared coordinate system. A vector's direction and distance have meaning relative to the model that produced the query and document vectors. Feeding a new query vector into an index full of old document vectors can produce plausible numeric scores with no calibrated relevance. Even if both models use cosine similarity, the spaces are not interchangeable without evidence of alignment. That is why this can fail quietly instead of throwing a dimension error.
Make the embedding generation a named version that includes model, preprocessing, chunking, normalization, vector metric and source-document revision. A query must target a compatible generation. If we want to compare models, send the same authorized query to two separate indexes with their matching query encoders, and evaluate answer-bearing recall, freshness, citations, latency and cost on the same cases. Do not merge raw scores across generations as though a 0.82 in one means the same thing as 0.82 in the other. A learned fusion or rank-based merger is possible, but it needs its own evaluation and access checks.
I would build a new collection from a pinned source snapshot. While the backfill runs, send source changes to both generations or record a durable change cursor and replay into the new one. Carry the source document revision and any tombstone, a retained marker that says the document was deleted, through both paths. A document updated during backfill must not have its older snapshot vector overwrite the newer version. Apply idempotent, revision-ordered writes per document, and track per-partition coverage. Weaviate's vectorizer migration guide shows separate collection and alias-based migration as one concrete approach. The application still owns its dual-write or catch-up correctness.
Before cutover, compare inventory against the source, including deletes and permission metadata. Sample old and new queries from actual task types, especially rare exact product codes, policy exceptions and newly written pages. A better average retrieval score on a subset is not permission to lose the exception a user needs. If the new index lacks enough coverage, keep the old generation as primary. Route shadow traffic only where data handling permits, and verify the new query encoder is pinned to the same embedding model as the new document vectors.
Cutover switches the query encoder and index generation as one logical release. An alias switch for the collection is insufficient if the query service keeps using the old encoder. Keep the old collection and encoder together for rollback until the defined window closes. If permissions change, both generations need current enforcement. For sensitive revocation, do not wait for dual-index synchronization before blocking a result from model context.
If the interviewer proposes placing a model-version field on each vector and filtering at query time, it can work as a temporary separation in an engine that truly isolates scoring and candidate selection by that field. But it still leaves the new model with only partially re-embedded documents, and selective filters may hurt recall or performance. Separate generations make coverage and rollback easier to reason about. The success condition is not “both vectors are 768 wide.” It is that every served query uses a compatible, sufficiently complete and authorized evidence space.
Related questions
Keep practising retrieval and rag
Follow another question in this area, or search the complete library.
Get my essays on AI engineering and distributed systems by email. Subscribe to ArchCrux