RAG
Choosing embedding models
Dimensions, languages, domains, cost — and the rule that you can’t mix them.
What it is and why it exists
Embedding models differ in retrieval quality per domain and language, vector size, max input length, price and whether you can self-host. Some support shorter vectors (Matryoshka training) so you can trade accuracy for storage.
Quick prototype
Whatever the provider’s default embedding model is.
In production, at scale
Benchmark two or three models on your labelled queries, consider multilingual models if users mix languages, version the model with the index, and plan a full re-embed (and dual-index cutover) when you switch.
Vendors and tools
| MTEB leaderboard | Public benchmark (sanity check, not the decision) |
|---|---|
| OpenAI, Cohere, Voyage, Google | Hosted embeddings |
| sentence-transformers / TEI | Self-hosted open models |
On AWS: Titan Text Embeddings V2 (configurable dimensions) and Cohere Embed on Bedrock.
How it fails
- Switching models without re-embedding the corpus
- English-only model on Hinglish queries
What the interviewer asks next
How do you migrate to a new embedding model with no downtime?
Build a second index with the new model in the background, shadow-query both, compare metrics, then flip the read alias and retire the old index.