Your new embedding model has different dimensions from existing vectors. How do you handle migration?
NLPLevel: IntermediateTroubleshooting Scenarios
Your new embedding model has different dimensions from existing vectors. How do you handle migration?
Hints
- What does closeness mean in this representation and metric?
- Check normalization, exact versus approximate search and alignment with the training objective.
Answer
You cannot mix vectors of different dimensions in the same HNSW index.
Migration plan:
- Build shadow index with new model — embed all documents in background; validate quality
- Test quality on eval dataset — confirm new model improves or matches old
- Dual-query transition — during cutover period, query both indexes; merge results by score normalization
- Atomic switchover — when shadow index is complete and validated, swap the primary index pointer
- Decommission old index after confidence period
Avoid: gradual migration where some documents are in new index and some in old — split indexes cause inconsistent retrieval quality.
Source and licence: JustInCache & contributors — Awesome AI Interviews · Apache-2.0