Switch the query encoder and its matching vector index as one routing decision when you migrate an embedding model. Before the switch, verify source freshness and document access in the new index. Keep the old route available for rollback only while you can make it meet the same freshness and authorization requirements.
Version the whole retrieval route
Give each route an identifier that represents the query encoder, physical index, document encoder, preprocessing, dimensions and similarity metric. Use that identifier through the request and its retries. If a retry deliberately switches routes, calculate a new query vector for the new route. The old vector may have the same number of dimensions and still give meaningless distance scores in the replacement index.
Microsoft's migration guide recommends keeping old and new vectors separate during validation and warns that changing the query model independently of an index alias can send incompatible vectors during propagation. Google Cloud documents task types for supported embedding models, including different settings for retrieval queries and documents. Include the task setting in the versioned configuration when the model uses it. Microsoft embedding migration guide and Google Cloud embedding task types
Pick a source snapshot with a known position in your change log. Backfill the replacement from that snapshot and apply subsequent changes. An index can contain the expected total number of documents while it is missing one upload and still contains another document that was withdrawn. Compare versions and access state by document ID at a defined source watermark, and use counts to identify where to look.
Rehearse source changes during backfill
Suppose your internal policy assistant is rebuilding its index over the weekend. An editor removes an obsolete travel policy on Saturday morning. A department loses access to a disciplinary procedure that afternoon. On Sunday, a retry from the original snapshot attempts to write both documents again.
| Check | Evidence to require before switching |
|---|---|
| Document withdrawal | The withdrawn version stays out of both routes after the stale backfill retry. |
| Permission revocation | A test account from the affected department cannot retrieve the procedure through either route. |
| Query retry across cutover | A query started on the old route either completes on that route or re-embeds before using the new one. |
| Source changes after switch | The same checks pass after one more edit or permission change on the production route. |
Reject stale writes by comparing source versions, or apply changes in an order that enforces the same requirement. Carry deletion or revocation state across retries so a replay cannot restore stale access. Test access with principals that should see the content and principals that should receive no hit. Average relevance scores cannot show that an individual entitlement is correct.
Make rollback subject to the same checks
Choose a small cohort with known queries, including exact identifiers, vocabulary specific to your organization, and requests that should return no result. Compare relevance and latency against both routes on that cohort. Decide in advance which regression triggers rollback and who can change the active route. Test the actual routing change in a non-production environment with requests already in flight.
Keep the old index current during the rollback window, or document and test how to replay source changes before routing reads back. If you can no longer call the old encoder, define how the application will serve a limited search mode or pause vector retrieval. Restoring the old index alone cannot restore that route.
For more on controlling results after permission changes, see document access guardrails for RAG. The application owns indexing, version pairing and retrieval authorization. If you also route embedding requests through Alectura, review the gateway contract for supported endpoints and input forms. In particular, check whether your SDK sends text or pre-tokenized IDs before relying on guardrails to inspect an embedding input.
Source documents (2)
Trace a request through Alectura.
Bring a sample prompt and a customer policy. See what reaches the model and which decisions appear in the request record.