Embeddings in depth
Example: a multilingual product search
Example: a hypothetical online pharmacy wants search that works when customers type "bukhar ki dawai", "fever tablet" or a misspelled brand name. Product names, descriptions and common alternate names are embedded with a multilingual embedding model. At query time, the query is embedded with the same model, and a vector database returns the nearest products. Because exact brand and salt names matter in pharmacy, a keyword index runs in parallel and the two result lists are merged, which is hybrid search. A reranker orders the final shortlist. Evaluation uses real search logs labeled by pharmacists.
Choosing an embedding model
| Factor | What to check |
| Quality on your data | Retrieval recall on a labeled set of your queries, not only leaderboard rank |
| Languages | Hindi, regional languages and code-mixed text, tested separately |
| Dimensions | More dimensions cost more storage and memory; some models allow shorter vectors with small quality loss |
| Input length | Maximum tokens per input, which constrains chunk size |
| Hosting | Hosted API or self-hosted open model, relevant for data residency |
| Throughput | Speed of embedding the initial corpus and keeping up with updates |
Hosted options come from providers such as OpenAI, Google, Cohere and Voyage AI; open models such as the BGE and E5 families can run on your own infrastructure through libraries like Sentence Transformers.
Operating embeddings in production
- Version everything: store the model name and version with each vector so you know when re-embedding is needed.
- Plan re-indexing: switching models means embedding the whole corpus again; build it as a repeatable job and run old and new indexes side by side during migration.
- Normalize consistently: apply the same text cleaning to documents and queries.
- Use the model's conventions: some models expect different prefixes or task types for queries and documents.
- Protect sensitive data: vectors derived from personal data should be treated as personal data, with access control and deletion.
How to measure embedding quality
Build a test set of queries with known relevant items. Measure recall at k, mean reciprocal rank and nDCG, sliced by language and query type. Then measure the downstream task: answer accuracy in RAG, click-through in search, or acceptance in recommendations.
Monitor search quality after launch as well. Queries with no clicks, repeated reformulations and low similarity scores for the top result are signals that a topic is missing from the index or that the embedding model struggles with certain phrasing. Review these regularly and add the cases to your test set.
Common mistakes
- Mixing vectors from two different models in one index.
- Relying on vectors alone for exact identifiers such as SKUs, invoice numbers or legal citations; add keyword search.
- Embedding noisy text full of headers and boilerplate.
- Choosing a model from a benchmark without testing on your languages.
Embeddings power semantic search, recommendations and clustering, and pair with knowledge graphs when relationships matter. We build with them in AI-powered search and smart recommendations.