← Back

Embedding Model Migration Without Search Regressions

Migrate embedding models with versioned indexes, shadow queries, backfill checks, and a rollback plan. Avoid mixing incompatible vectors or losing document updates.

An embedding model migration changes the meaning of your search index. Replacing the query encoder while leaving stored document vectors untouched is not an ordinary configuration update. Unless the models explicitly provide compatible representations, treat the new encoder as a new retrieval system that needs its own indexed data and evaluation.

The risky part is often operational. A backfill completes, the new index looks healthy, and then a customer searches for a document edited during the migration. The old text appears because nobody defined how concurrent changes would reach both versions.

Version the whole embedding contract

Record the model identifier and revision, dimensionality, distance metric, normalization, query and document input modes, preprocessing, and chunking version. These values describe how text became a vector. The model name alone is insufficient to reproduce the index.

Pinecone's index creation documentation exposes dimensionality and similarity configuration for dense vectors. Those are compatibility requirements to verify before loading data. Equal dimensions alone do not prove that two models assign compatible meanings to their coordinates.

Use an immutable configuration identifier, such as retrieval-config-12, in ingestion jobs and query traces. Resolve that identifier to the complete contract. Avoid a mutable label such as latest when debugging a comparison from last week.

This also helps you distinguish a model migration from a simultaneous parser change. If you alter both, you may still ship a better system, but you will need a more careful experiment to explain why it improved.

Build a second index from a defined snapshot

My recommended approach for a live service is to keep the current index serving while constructing the replacement. Capture a source snapshot or a well-defined ingestion watermark. Every document should have a stable identity and a monotonically comparable version or update sequence.

Write a manifest containing the expected document versions. Count checks are necessary but not sufficient: two indexes can contain the same number of records while holding different documents. Compare identities and versions, and inspect representative text and metadata.

For an illustrative migration, suppose the snapshot ends at event 50,000. Backfill documents as of that point, then replay updates after that event. A document deleted at event 50,032 must be deleted from the new index, even if an older backfill worker finishes afterward.

Prevent that race with version-aware writes, ordering, or another mechanism your storage system actually supports. Do not assume a timestamp comparison exists simply because the ingestion payload includes a timestamp.

Choose a strategy for concurrent writes

Dual writes and change-log replay solve related problems with different failure modes. Dual writes can leave one index updated and the other stale after a partial failure. A replayable log requires durable ordering and enough retention to finish the backfill.

For either approach, define retries and reconciliation. Record unsuccessful writes outside the worker process so a restart does not erase them. Deletions and permission changes deserve the same treatment as content updates.

Keep the source system authoritative. An index is a derived view, and migration tooling should be able to rebuild or reconcile it from trusted source records. This becomes particularly useful when a transient encoding error affects only part of a large batch.

Shadow the complete query path

Send representative queries to both configurations without exposing shadow results to users. Encode each query with the matching model and preprocessing settings. Compare relevant-evidence coverage, exact-identifier queries, multilingual cases where applicable, and filtered retrieval.

Do not compare raw similarity scores between models as if they shared a calibrated scale. Compare outcomes against labels: did the required passage appear, at what rank, and did the generated answer use it correctly?

Preserve the surrounding retrieval settings during the initial comparison. If you also change candidate depth, reranking, and prompt assembly, an improvement will be harder to attribute. Later experiments can tune the new system independently.

Watch operational metrics too: encoding failures, query latency, indexing lag, storage consumption, and rate-limit behavior. A model that improves offline relevance but cannot keep up with document changes may reduce real-world freshness.

Switch configuration and index together

Qdrant documents collection aliases that can be changed atomically, allowing a rebuilt collection to replace an existing target. That is useful infrastructure, but your application must also keep query encoding aligned with the chosen collection.

An alias swap alone does not atomically deploy a new encoder across every application instance. One practical design is an application-level routing configuration that selects an immutable pair: encoder configuration plus concrete index name. Resolve the pair once per request and carry it through the pipeline.

Use a small rollout before full traffic if your infrastructure allows it. Define rollback criteria in advance: unacceptable relevance regressions, error rates, or latency on important query categories. Keep the old index current during the rollback window if returning to it must preserve recent updates.

Retire deliberately

After the observation window, verify that no active query path uses the old configuration. Stop its ingestion only after deciding how long rollback remains necessary. Archive the migration manifest and evaluation report before deleting expensive resources.

Keep the retrieval evaluation set stable while comparing indexes, and revisit the chunking contract if document segmentation changes with the encoder. A migration needs explicit versioning of the whole retrieval path.

The migration is complete when the new system is correct, current, observable, and reversible for the agreed window. Finishing a vector backfill is only one milestone on that path.