Description
The new i18n system allows users to ask questions in French, Spanish, Hindi, Portuguese, and other languages. The answer_question pipeline accepts a language parameter and correctly translates the answer back to the user's language. However, the user's original question is embedded and searched against ChromaDB as-is, without first being translated to English.
Since the entire IPCC corpus and research papers are indexed in English, embedding a French or Hindi question produces a query vector that poorly matches the English document space, resulting in low-quality or empty retrieval.
translate_to_english() already existed in backend/llm/translation.py but was never called in the retrieval pipeline.
Reproduction
- Set language to French (fr) in the UI dropdown
- Ask: "Qu'est-ce qu'une vague de chaleur marine ?"
- Observe: retrieval returns 0 or irrelevant chunks despite the question being valid
Impact
All non-English queries return degraded or empty answers, making the multilingual feature effectively non-functional.
Location
backend/retrieval/pipeline.py — answer_question() function.
Fix Applied (commit 2936cb5)
Added retrieval_question = translate_to_english(question) if language != "en" else question before calling query_chunks(), so the translated English version is used for embedding while the original question is preserved for history and display.
Description
The new i18n system allows users to ask questions in French, Spanish, Hindi, Portuguese, and other languages. The
answer_questionpipeline accepts alanguageparameter and correctly translates the answer back to the user's language. However, the user's original question is embedded and searched against ChromaDB as-is, without first being translated to English.Since the entire IPCC corpus and research papers are indexed in English, embedding a French or Hindi question produces a query vector that poorly matches the English document space, resulting in low-quality or empty retrieval.
translate_to_english()already existed inbackend/llm/translation.pybut was never called in the retrieval pipeline.Reproduction
Impact
All non-English queries return degraded or empty answers, making the multilingual feature effectively non-functional.
Location
backend/retrieval/pipeline.py—answer_question()function.Fix Applied (commit 2936cb5)
Added
retrieval_question = translate_to_english(question) if language != "en" else questionbefore callingquery_chunks(), so the translated English version is used for embedding while the original question is preserved for history and display.