type
Post
status
Published
date
Nov 26, 2026
slug
summary
tags
category
技术分享
icon
password

Building a Voice Agent for Indic Languages with CUGA

Most critical information is currently stored in English, yet millions of people think and speak in regional languages such as Hindi, Tamil, Telugu, Gujarati, and Marathi. For many of these users, typing is less natural than speaking. To bridge this gap, IBM Research developed a voice agent using the open-source framework CUGA (ConfigUrable Generalist Agent). This project demonstrates how to create an assistant that listens to spoken questions in Indic languages, retrieves relevant information from English documents, and responds with spoken answers in the user's native tongue.

The Farm Assistant Use Case

The primary demonstration is a "Farm Assistant." When a farmer asks a question aloud—such as how to distinguish good seed from bad—the agent performs a specific four-step process:
1. It listens to the audio and converts the speech into text.
2. It searches a 154-page agricultural handbook, which is written entirely in English.
3. It formulates an answer of two to four spoken sentences in the language of the question, relying solely on the handbook’s content.
4. It speaks the answer back to the user and displays the source pages for verification.
The system is designed with guardrails. If a user asks about unrelated topics like cricket or coding, the agent politely redirects them to agricultural topics instead of generating ungrounded responses.

Understanding CUGA as an Agent Harness

CUGA is an open-source tool from IBM Research that manages model wiring, state, and guardrails, allowing developers to focus on writing tools and prompts rather than building the entire agent loop. In this implementation, CUGA acts as an embedded SDK within a small web application. Its key features include:
* Model Flexibility: The agent can switch between watsonx and OpenAI with a single configuration change.
* Knowledge Engine: It parses PDFs, chunks them, embeds them, and performs local searches.
* Thread Isolation: Each question gets a fresh conversation thread, preventing language or context leakage between different users.
The core design principle is that CUGA functions as a text-in, text-out brain. Voice is treated as two thin layers surrounding this core: speech-to-text on the input side and text-to-speech on the output side. This architecture allows developers to build and test the agent using plain text first, then add audio capabilities without modifying the core logic. Speech providers can be swapped easily; the system supports Sarvam AI’s cloud APIs called directly from the browser, or open-source models like SraVaani (speech-to-text) and Svara (text-to-speech) running on a local server.

The Challenge of Cross-Lingual Retrieval

The most difficult technical aspect is not the voice processing, but cross-lingual retrieval. Specifically, a question in Hindi must successfully find relevant paragraphs in an English document. Standard embedding models are often English-centric, meaning they convert Hindi text into vectors that carry little semantic weight. This results in the agent retrieving incorrect passages, leading it to correctly but unhelpfully state that the handbook does not cover the topic.
To solve this, the project utilizes the intfloat/multilingual-e5-large embedding model. This ensures that the same meaning lands in the same vector space regardless of the language used. Consequently, a single English document can serve users across multiple languages without the need for translated copies. The developers advise testing the agent with a non-English question before optimizing prompts to ensure the retrieval layer is functioning correctly.

Voice Presentation and Safety

Several design decisions were made to ensure the output is suitable for spoken consumption:
* Audio-First Formatting: Markdown syntax, bullet points, and citation tags are inappropriate for speech. The prompt instructs the model to avoid these, and a lightweight formatter strips any that appear before the text is converted to audio.
* Efficient Guardrails: Simple input checks filter obvious off-topic queries. If a query slips through, the model prefixes its response with a specific flag, allowing the app to swap in a polite redirect without requiring a second LLM call.
* Grounded Answers: The model is strictly instructed to use only the retrieved passages, ensuring accuracy. Source pages are always visible to the user.
* Security: When using cloud speech providers, the browser communicates directly with the service. The server only receives text, keeping API keys secure.

Conclusion

This project illustrates that voice agents can be made accessible to non-English speaking populations by addressing cross-lingual retrieval and audio-specific formatting. The approach is scalable; by swapping the agricultural handbook for health advisories or legal guides, similar assistants can be deployed for various sectors. Developers can explore this further through the provided tutorials and open-source resources.
原文出处:Hugging Face, https://huggingface.co/blog/ibm-research/an-indic-voice-agent-with-cuga
单卡 RTX PRO 6000 运行 Inkling 2 Mini:利用智能体实现推理速度提升 40%Google Research 开源 LLM 社会推理评估框架,直击日常场景痛点
Loading...