Search across languages while preserving exact entities and measuring answer support in the language of the source.
Multilingual retrieval without losing names, units or permissions
Treat language as a retrieval constraint
Multilingual retrieval finds evidence when the question and the answer-bearing document use different languages or scripts. A Hindi request for a pump's pressure limit might need an English maintenance sheet. Translate or encode the request for candidate generation, but retain the original request and its entity spans. A translated product name can become a common noun; a model number or unit can be silently changed. Keep the original tokens beside any expansion so the exact identifier remains searchable. Expansion tests should fail when an alias changes the requested entity.
Use two candidate paths
A multilingual vector index can find semantically related passages across languages; an exact or transliterated term index can recover names and part numbers that an embedding misses. Merge bounded candidate lists, then rank the original passages. Transliteration is a controlled alias for a named entity, not a general translation engine. Store aliases with locale, entity ID and review status. If two entities share the same Roman spelling, an alias must not erase that ambiguity. Hybrid merging gives a practical way to combine the two paths without pretending their raw scores are comparable.
Preserve the source's meaning
Retrieve source text, revision, locale and passage ID together. A translated display excerpt may help the reader, but the citation must still point to the original passage. Numbers, negation, effective dates and units require explicit checks across the translation boundary. Do not answer a question in the user's language from a passage whose translation has inverted 'must not' or converted 47 psi into 47 kPa. Claim-level support is judged against the source, not against a fluent paraphrase.
Filter before mixing languages
Tenant permissions, document status and jurisdiction apply to every language variant. A public English summary is not evidence that a private Spanish appendix can be searched or surfaced. Deduplicate translations by source lineage only after access filtering; separate independently authored statements even if they are translated similarly. Track source revision across language copies because a translated page may lag behind the original. Corpus lifecycle determines which variant is eligible.
Evaluate language pairs, not one average
Build judged queries for each query-language and document-language pair, including mixed-script queries, transliterated names, similar identifiers and documents with no valid answer. Report candidate recall, supported answer rate and entity preservation per pair. A strong English-English score can hide total failure on Hindi-English or Arabic-English searches. Review wrong answers with both original and translated passages. If no reviewer can establish the meaning of the source, mark support unknown rather than accepting the answer by fluency.
Worked contract
from dataclasses import dataclass
import unicodedata
@dataclass(frozen=True)
class ServicePassage:
passage_id: str
tenant: str
locale: str
text: str
entity_id: str
def normalized(text: str) -> str:
return unicodedata.normalize("NFKC", text).casefold()
def exact_entity_candidates(passages: list[ServicePassage], tenant: str,
requested_entity: str, aliases: dict[str, str]) -> list[str]:
entity_id = aliases.get(normalized(requested_entity))
if entity_id is None:
return []
return [passage.passage_id for passage in passages
if passage.tenant == tenant and passage.entity_id == entity_id]
service_notes = [ServicePassage("sheet-en-r4", "north", "en",
"Pump P-47 relief limit is 83 kPa.", "pump-p47"),
ServicePassage("sheet-hi-r2", "south", "hi",
"P-47 limit is 99 kPa.", "pump-p47")]
reviewed_aliases = {normalized("पी-47"): "pump-p47", normalized("P-47"): "pump-p47"}
assert exact_entity_candidates(service_notes, "north", "पी-47", reviewed_aliases) == ["sheet-en-r4"]
assert exact_entity_candidates(service_notes, "north", "P-48", reviewed_aliases) == []Performance and operating cost
The transparent candidate scan costs O(N) time over N passages and O(K) output space for K eligible matches. A production entity index keyed by tenant and entity ID reduces lookup work but requires reviewed aliases and refreshes when documents change. A second multilingual vector path adds index storage and query latency; measure its incremental supported recall by language pair before accepting the cost.
Common Mistakes
- Treating transliteration as an unambiguous entity identifier.
- Dropping the original query after translation and losing exact numbers or negation.
- Citing only a generated translation rather than the source passage.
- Reporting one aggregate recall score across uneven language pairs.
Validation drill
Build 53 questions across three query languages and two document languages. Include twelve mixed-script identifiers and eight restricted passages. Record entity preservation, authorized candidate recall and supported answers for every language pair.
Read next
- Query expansion: add recall terms without changing the user's question
- Hybrid retrieval: fuse exact terms and semantic candidates by rank
- Claim-level citations: verify each answer against its passage
- Retrieval corpus contracts: identity, permissions and document lifecycle
