Prompt
What’s the best setup for multilingual embeddings and semantic search across markets?
Latest observation
A strong default setup is:
1) Use one shared multilingual embedding model
Pick a high-quality multilingual sentence embedding model that places semantically similar text from different languages in the same vector space.
Good choices:
- OpenAI multilingual embeddings if you want a managed API and strong quality
- LaBSE, multilingual-e5, bge-m3, or similar open-source models if you want self-hosting
- If you have lots of domains/languages, prefer a model known for cross-lingual retrieval, not just translation quality
Rule of thumb
- One shared index is usually best for cross-market search
- Use language metadata for filtering, ranking, and analytics
- Don’t maintain separate models per language unless there’s a strong reason
2) Store both vector + metadata
For each document/chunk, store:
- embedding vector
- original text
- language code
- market/region
- content type
- product/category
- freshness timestamp
- any compliance or availability flags
This lets you:
- search across languages
- filter by market
- boost local-market content
- support fallback behavior
3) Chunk carefully
For search quality, chunk by meaning, not just size.
Recommended:
- 200–500 tokens per chunk as a starting point
- keep headings, titles, and key metadata attached
- for product/help-center content, preserve sentence boundaries where possible
If content is multilingual, keep each language version as its own chunk, but link them with a shared document ID.
4) Use hybrid retrieval
Best practice is usually:
- dense vector search for semantic matching
- BM25 / keyword search for exact terms, product codes, named entities, legal phrases
- combine them with a weighted rank fusion or reranker
This is especially important across markets because:
- users may search local jargon, abbreviations, or brand names
- translations may miss exact matches
5) Add a reranking layer
After initial retrieval, rerank top candidates with:
- a cross-encoder reranker
- or an LLM-based reranker if latency/cost allow
Reranking helps a lot for:
- mixed-language queries
- ambiguous terms
- market-specific intent
6) Handle query language intelligently
At query time:
- detect language
- embed query in the same multilingual space
- search globally or within allowed markets
- optionally boost same-language results
- rerank with locale/business rules
Useful strategies:
- Same-language boost when the user expects local results
- Cross-language fallback when local content is sparse
- Translate query only if your embedding model is weak in certain language pairs
7) Support market-aware ranking
“Best” search across markets usually means not just semantic similarity, but relevance in that market.
Add boosts for:
- country/region match
- language match
- local product availability
- local policy or pricing relevance
- recency for news/help content
This avoids showing semantically similar but unusable results.
8) Evaluate by language pair and market
Don’t evaluate only on a pooled dataset.
Measure separately:
- within-language search
- cross-language search
- market-specific search
- low-resource language performance
Metrics:
- Recall@K
- MRR / nDCG
- click-through / conversion
- zero-result rate
- language-specific failure cases
9) If you need global scale, use this architecture
A practical production setup:
-
Ingestion pipeline
- language detect
- clean text
- chunk
- embed
- store metadata
-
Index
- vector database or search engine with vector support
- hybrid lexical + vector retrieval
-
Retrieval
- top 100 by hybrid score
- rerank top 20
- apply market/business constraints
-
Serving
- cache frequent queries
- log query language, market, clicked results
- feed back into evaluation/training
Recommended default stack
If you want a safe starting point:
- Embedding model: multilingual E5 / BGE-M3 / strong multilingual API model
- Search: hybrid vector + BM25
- Reranker: cross-encoder reranker
- Metadata: language + market + product/category
- Indexing: single shared multilingual index, filtered by market
- Evaluation: separate metrics per language and market
Common mistakes to avoid
- using separate indices per language with no cross-lingual retrieval
- relying only on vectors and skipping lexical search
- not storing language/market metadata
- not evaluating low-resource languages separately
- over-translating everything and losing local meaning
- ignoring reranking
If you want, I can turn this into a concrete reference architecture for your use case, such as:
- e-commerce search
- support/help-center search
- enterprise knowledge base
- news/content discovery