Building multilingual voice agents with CUGA and cross-lingual RAG
Hugging Face demonstrates a voice agent that answers Hindi questions using English documents via CUGA and multilingual embeddings.
Hugging Face released a technical tutorial on building a multilingual voice agent using IBM Research’s open-source CUGA harness. The project bridges the gap between English-language digital knowledge and users who prefer speaking in regional Indian languages like Hindi, Tamil, or Telugu. Published in late 2026, the guide details how to create a farm assistant that retrieves information from English handbooks and responds verbally in the user’s native tongue.
What happened
The team built a prototype called the Farm Assistant to address a specific accessibility problem. Most agricultural knowledge is digitized in English, but many farmers think and speak in local languages. The agent allows a user to ask a question aloud, such as how to identify good seeds. It converts the speech to text, searches a 154-page English agricultural handbook, and generates a concise answer. Finally, it speaks the response back in the original language and displays the source pages for verification.
CUGA, or ConfigUrable Generalist Agent, serves as the core engine for this application. It manages model wiring, tool execution, state, and safety guardrails. This architecture allows developers to focus on writing specific tools and prompts rather than rebuilding the entire agent loop. The implementation supports switching between different large language model providers, such as watsonx and OpenAI, through a single configuration setting. It also handles conversation threads to ensure context isolation between different users and sessions.
The tutorial highlights that voice interaction is merely a thin layer around a text-based core. The system follows a linear pipeline: audio input converts to text, which triggers a knowledge search. CUGA processes the retrieved text to generate a grounded answer, which then converts back to speech. This separation allows engineers to build and test the logical reasoning capabilities using plain text before integrating speech-to-text and text-to-speech components. It also enables swapping speech providers without altering the underlying agent logic.
How it works
The most significant technical challenge addressed is cross-lingual retrieval. A user might ask a question in Hindi, but the source document is in English. Standard embedding models often fail here because they map different languages to distant vector spaces. If the system uses an English-only embedding model, a Hindi query produces vectors that do not align with the English document chunks. The agent correctly reports that it cannot find relevant information, resulting in a silent failure with no error logs.
To solve this, the engineers replaced the default embedding model with intfloat/multilingual-e5-large. This multilingual model maps semantically similar concepts from different languages into the same vector space. Consequently, a Hindi question about seeds generates vectors that closely match the corresponding English paragraphs in the handbook. This approach eliminates the need for translated copies of documents, allowing a single English source to serve users across multiple languages. The tutorial notes that verifying this retrieval step is critical before optimizing any other part of the prompt.
Safety and output quality required specific adjustments for voice interfaces. The system prompt explicitly instructs the model to avoid markdown, bullet points, or bracketed translations, as these elements sound unnatural when read aloud. A lightweight formatter strips any remaining formatting artifacts before the text reaches the speech synthesizer. Guardrails are kept efficient by using simple input checks for off-topic queries. If a query slips through, the model prefixes the response with a specific token, allowing the application to swap in a polite redirect without invoking a second large language model call.
Key details
- The agent uses CUGA as an embedded SDK to handle agent loops, tool management, and state.
- Cross-lingual search relies on the
intfloat/multilingual-e5-largeembedding model to align Hindi queries with English documents. - Speech processing supports Sarvam AI cloud APIs or open-source models like SraVaani and Svara for on-premises deployment.
- The system isolates conversation threads to prevent context leakage between different users or languages.
- Guardrails use a lightweight token-based check to redirect off-topic questions without additional LLM costs.
- The browser handles speech API keys directly when using Sarvam, ensuring the server never accesses user credentials.
Why it matters
For software engineers building document-heavy AI applications, this tutorial provides a concrete pattern for handling multilingual requirements. Many enterprise knowledge bases exist only in English, yet global workforces operate in diverse languages. Implementing cross-lingual retrieval allows organizations to leverage existing documentation without the high cost and maintenance burden of translating every document. It demonstrates that the primary barrier is not language translation itself, but the alignment of vector representations during the retrieval phase.
The architecture also emphasizes the importance of modularity in voice agents. By treating speech as separate input and output layers, developers can iterate on the reasoning engine independently. This separation simplifies debugging and testing, as text-based interactions are easier to log and analyze than audio streams. Furthermore, the ability to switch between cloud and on-premises speech providers offers flexibility for data sovereignty requirements, which is crucial for government or healthcare applications.
Trustworthiness remains a central theme in the design. By grounding every answer in retrieved passages and displaying source pages, the system reduces hallucinations. The explicit instruction to avoid external knowledge ensures the agent stays within the bounds of the provided handbook. This approach is essential for high-stakes domains like agriculture or health, where incorrect advice can have serious consequences. The transparent display of sources allows users to verify the information, fostering greater confidence in the automated assistant.
What you can do
- Test the live demo on Hugging Face Spaces by asking farming questions in Hindi, Tamil, or other Indic languages.
- Replace the default embedding model in your RAG pipeline with a multilingual alternative like
multilingual-e5-large. - Verify cross-lingual retrieval by querying your knowledge base in a non-English language before tuning prompts.
- Strip markdown and formatting tags from LLM outputs before sending them to text-to-speech engines.
- Implement lightweight guardrails using token-based checks to handle off-topic queries efficiently.
- Explore the CUGA GitHub repository to understand how the harness manages tool execution and state.



