Skip to content

Swapping Embedding Models Is a Database Migration: A Safe Rollout Plan for Vector Search

9 min reading

Move a document assistant between complete retrieval releases while accounting for updates, deletions, evidence comparisons and rollback.

Page details

Blog 04 · Vikram Samal

Edition date: · 9 min read

20px

Edition dates place posts in a retrospective weekly reading sequence.

Last edited:

Sources · Technology essay

TL;DR
  • An embedding model defines a coordinate system, not just an API response shape.
  • Build and evaluate a complete replacement index before moving traffic.
  • Version source chunks and deletions alongside the vectors so rollback stays meaningful.

The vector length is unchanged.
Search results are suddenly worse.
Compatible shapes did not preserve meaning.

Hypothetical scenario. Act 2, the price change. Dev switches Northwind’s query-embedding endpoint to a newer model while the document index still holds old vectors. The request succeeds and returns numbers of the expected length. Priya’s usual policy questions stop finding their supporting passages.

An embedding index belongs to a model

An embedding represents text as a vector: an ordered list of coordinates. A search compares a query vector with document vectors using a chosen similarity measure. Those coordinates gain meaning through the model that produced them. Matching vector lengths establishes a shape requirement, not agreement about what each direction represents.

An embedding migration changes the representation used for stored documents and incoming queries. Query and document representations need a compatible model family, version and intended retrieval configuration. Some models specify different query and document instructions or encoders; compatibility means following that documented pairing, rather than demanding identical strings at every input.

The database analogy is useful because a model change alters stored derived data and the queries that interpret it. A safe change needs a complete new representation, a way to compare behavior and a rollback path. An endpoint configuration edit alone changes the reader while leaving the stored representation behind.

Source revisionOld + new indexSame questionsPaired cutover
Build two complete representations and move the query encoder with the selected index.

Keep a manifest beside the coordinates

Northwind should record the embedding model identifier, revision or deployment version, dimension count and similarity configuration. The chunk record also needs the source document identity, source revision and transformation version. Together these fields explain which text the vector represents and which query encoder is permitted to search it.

OpenAI’s embedding guide explains vector representations, similarity search and configurable dimensions for supported models. Microsoft’s vector-index documentation makes dimensions and vector-search configuration explicit parts of the field definition. These are concrete configuration dependencies; a provider name alone is too coarse to describe the stored representation.

Chunk identity should survive a migration when the underlying source segment is unchanged, or carry a clear mapping when segmentation changes. Otherwise an apparent retrieval improvement can actually be a change in evaluation labels. Keep the text snapshot associated with each evaluated result so Priya can inspect whether the supporting condition was retained.

Build the shadow before routing a query

A shadow index is a replacement built without serving normal reader traffic. Northwind first fixes a source snapshot, embeds its chunks with the candidate model and records the completion state. Changes arriving during the build need replay or a later synchronization pass. An index that was complete yesterday can already be missing today’s policy correction.

Switch the query encoder and target index as one release configuration. Sending a new-model query to the old index is invalid even when both return the same dimension count. A deployment identifier that binds the pair reduces that risk. The configuration should also bind chunking and ranking settings if those changes are part of the same experiment.

During shadow evaluation, issue the same authorized query to both representations and compare the resulting passages. Preserve access filters on both paths. A candidate that returns a better-looking confidential paragraph is not an improvement for an employee who cannot read that paragraph. Quality and eligibility are independent conditions for accepting a result.

Account for payload and rebuild work separately

Hypothetical worked example: Northwind has 2,000,000 chunks, each represented by 1,536 coordinates stored as 4-byte values. One vector consumes 1,536 × 4 = 6,144 bytes. All vectors consume 2,000,000 × 6,144 = 12,288,000,000 bytes, or 12.288 decimal GB, approximately 12.3 GB. Two equally sized representations consume 24.576 GB, approximately 24.6 GB, in raw vector payload.

That figure excludes the approximate-search graph, text, metadata, replicas and build overhead. It also assumes the replacement uses the same dimensions and numeric format. If either changes, calculate its payload independently. Provisioning only the rounded vector number confuses one component of storage with the complete index’s memory and disk requirements.

Assume each chunk contains 400 embedding-input tokens on average. Re-embedding requires 2,000,000 × 400 = 800,000,000 tokens. This is an illustrative workload, not a provider invoice. Converting it to money requires a dated embedding rate, any batching discount and the billable input rules. Query traffic during the migration is a separate line in the budget.

Evaluate the questions that make retrieval valuable

Use a fixed question set with known supporting passages. Compare whether the expected evidence appears within the candidate budget, whether exact identifiers survive and whether the ranking favors the applicable revision. Include questions that should return no answer. A model that always finds something can make abstention worse while improving an average similarity score.

Muennighoff and colleagues’ MTEB paper evaluates embeddings across diverse task categories and finds that performance varies with the task. That supports using a benchmark for screening candidates rather than treating a single leaderboard result as Northwind’s acceptance decision. The local test needs policy language, product identifiers and the source formats the assistant actually receives.

Compare answer quality only after separating retrieval quality from generation. Hold the generator and prompt steady during the representation comparison. Then run the complete answer path with the chosen candidate. This order makes it easier to distinguish a retrieval regression from a prompt change that happened to ship in the same release.

In the wild: the representation is only part of retrieval

Anthropic’s Contextual Retrieval report describes adding local explanatory context before creating embeddings and a lexical index. Its evaluated improvement concerns a full preprocessing and retrieval arrangement, not a guarantee that changing the vector model alone improves every corpus. Northwind should record that preprocessing choice with the representation it produces.

The experiment can reveal that embeddings are not the best fix. If failures involve literal part numbers, an exact-match path or hybrid retrieval deserves comparison. If a table lost its headers during parsing, re-embedding the same damaged text preserves the damage. Migration work is justified when the diagnosed failure depends on representation, not merely because a newer model exists.

A canary needs a reversible source history

After offline acceptance, route a bounded share of read traffic to the new index while retaining the old path. Compare supporting-passage rates, empty results, latency and permission failures. Use the same query cohort where practical. A changed workload can otherwise masquerade as a model improvement or regression.

Rollback must include query encoding and index selection together. Keep the older representation synchronized with document edits for the duration of the rollback window. If the old index contains revoked or superseded policies, routing back to it restores availability at the cost of incorrect or unauthorized evidence. An operational rollback is useful only when its data contract still holds.

Microsoft’s deletion-detection guidance shows why deleted source content needs a deliberate propagation mechanism. Northwind tracks tombstones or equivalent removal records while both indexes exist. A source deletion should invalidate associated chunks and derived answer caches; leaving an orphaned vector searchable undermines the promise that the source repository determines available evidence.

When migration is the wrong first project

A common misconception is that equal dimensionality allows vectors from arbitrary models to mix. Another is that re-embedding solves freshness without an update pipeline. A third is that an approximate index’s speed setting is independent of result quality. Keep each variable visible and change them separately unless the release plan explicitly evaluates their combination.

For a small corpus, a simpler exact-search baseline can help assess the candidate without approximate-index effects. For a large corpus, build and catch-up duration become central constraints. The right rollout depends on how long both representations can coexist and how much source change accumulates during that interval, rather than only on the model’s advertised embedding throughput.

Limits: the payload calculation is a lower-bound component estimate under stated assumptions, and an evaluation set cannot anticipate every policy query. Provider revisions, corpus changes and permission updates remain ongoing responsibilities after migration. A successful canary authorizes a controlled expansion; it does not eliminate the need to monitor new retrieval failures.

Northwind’s decision is to release a versioned representation pair, preserve source provenance and keep rollback data current. The migration is complete when the new path serves accepted evidence under the same access contract and the old path can be retired deliberately. A successful request returning a vector is only the beginning of that proof.

Check yourself: embedding decisions

Both models emit 1,536 values. Can their vectors share one search space?

No. Equal dimensions do not establish compatible coordinates. Follow the model’s documented query/document pairing and isolate incompatible versions.

Raw vectors occupy 12.3 GB. Is a 12.3 GB machine sufficient?

The calculation excludes index structures, text, metadata, replicas and runtime overhead. Measure or budget those components separately.

The new index is healthy but rollback would restore deleted policies. Is the release reversible?

Not safely. Keep deletions and updates synchronized during the rollback window, including their effects on derived caches.

Next read: Debug the complete retrieval path.

Source: Vector embeddings — Inspect Primary Source ↗
VS
Vikram Samal

Notes on generative AI and system design.