IBM 用 CUGA 构建印度语语音农业助手
核心要点
- IBM Research 用开源 agent harness CUGA 搭建了一个印度语语音农业助手,用户可用印地语、泰米尔语等直接提问。
- 助手将语音转文字后检索一本 154 页的英文农业手册,再用提问语言以 2~4 句口语作答,并展示来源页码。
- 关键设计:CUGA 只做“文本进、文本出”的大脑,语音识别与语音合成是外围两层薄封装,可独立替换。
- 真正的难点不是语音,而是跨语言检索:默认英文嵌入模型会让印地语问题检索到错误段落,且不报错。
- 解决方案是换用多语言嵌入模型 intfloat/multilingual-e5-large,使同一语义在不同语言下落到相近向量位置。
详细解读
CUGA(ConfigUrable Generalist Agent)是 IBM Research 的开源 agent harness,负责模型接线、工具管理、状态与护栏,开发者只需编写工具和提示词。本文以嵌入式 SDK 形式用于小型 Web 应用,支持在 watsonx 与 OpenAI 之间一键切换模型,并通过 agent.knowledge.search() 完成 PDF 解析、分块、嵌入与本地检索;每个问题使用独立会话线程,避免上下文串扰。
语音层支持两种方案:Sarvam AI 的云端语音 API(浏览器直调),或自托管开源模型(SraVaani 做语音识别、Svara 做语音合成)。
作者强调,默认英文嵌入模型下,印地语或泰米尔语问题仍会返回五段文本,但都是错误内容,模型因被要求只依据给定材料作答,会礼貌回复“手册未涵盖”,全程无报错无警告。建议在调提示词之前,先用非英语问题验证检索是否正确。
此外,面向“听”的写作很重要:Markdown、项目符号、引用标记和括号译文读出来都很别扭,需在提示词中禁止并在合成前用轻量格式化器清理。护栏则用简单输入检查拦截明显跑题问题,若漏网则让模型以 OFF_TOPIC 开头,由应用替换回复。
An Indic Voice Agent with CUGA
EnterpriseArticlePublished November 25, 2026 Upvote 12Most useful knowledge is written and digitized in English. Most of the people who need it speak, and think, in their own regional languages like Hindi, Tamil, Telugu, Gujarati, Marathi and many others. Many would rather talk than type.
We built a small voice agent to close that gap, using CUGA as the agent harness. This post explains the use case and what we learned. You can try it yourself in CUGA Apps.
The use case: a Farm Assistant
A farmer asks a question aloud, in their own language: how do I tell good seed from bad? The agent:
- Listens and turns the speech into text.
- Searches a 154-page agricultural handbook, which is written in English.
- Answers in two to four spoken sentences, in the language the question was asked in, using only what the handbook says.
- Speaks the answer back and shows the source pages, so the answer can be checked.
If someone asks about cricket or coding, it politely steers them back to farming instead of making something up.
Where CUGA fits
CUGA (ConfigUrable Generalist Agent) is IBM Research's open-source agent harness. It handles the model wiring, tool management, state and guardrails, so you write tools and a prompt instead of the agent loop. Here we use it as an embedded SDK inside a small web app, for three things:
- One agent, any model. Switch between watsonx and OpenAI with one setting.
- The knowledge engine. Parse a PDF, chunk it, embed it, and search it locally with
agent.knowledge.search(). - Conversation threads. Each question gets a fresh thread, so one person's language or context never leaks into another's.
The key design idea is simple: CUGA is a text-in, text-out brain. Voice is two thin layers around it.
audio ──▶ speech-to-text ──▶ knowledge.search ──▶ CUGA (grounded answer) ──▶ text-to-speech ──▶ audio
Because the agent only ever sees text, you can build and test it with plain text first, then add the ears and the mouth. You can also swap speech providers without touching the agent. We support two: Sarvam AI's cloud speech APIs, called directly from the user's browser, and open-source models (SraVaani for speech-to-text, Svara for text-to-speech) running on your own server.
The hard part is not the voice
Adding speech is the easy part. The hard part is cross-lingual retrieval: a Hindi question has to find an English paragraph.
Search works by turning text into vectors and finding the nearest ones. CUGA's default embedding model is English-only, so it turns Hindi into vectors that carry almost no meaning. With it, a Hindi or Tamil question still retrieves five passages, but they are the wrong ones. The model, correctly told to answer only from what it was given, quietly says "the handbook doesn't cover that". Every layer behaves correctly, so there is no error and no warning.
The fix is to use a multilingual embedding model (we use intfloat/multilingual-e5-large), so the same meaning lands in the same place whatever the language. Conceptually simple, though wiring it into CUGA took a small workaround (shown in the tutorial). After that, one English document serves every language, and you do not need translated copies of anything.
Our advice: before you tune a single prompt, ask your agent one question in a non-English language and check that it finds the right pages.
Making it sound right and keeping it safe
A few small decisions mattered more than we expected:
- Write for the ear. Markdown, bullet points, citation tags and bracketed translations such as "millet (बाजरा)" all sound wrong when read aloud. The prompt asks the model not to produce them, and a light formatter strips any that slip through before speech.
- Keep guardrails cheap. Simple input checks catch obvious off-topic questions. If one gets through, the model starts its reply with
OFF_TOPIC, and the app swaps in a polite redirect. No second LLM call, so the voice path stays fast. - Ground every answer. The model sees only the retrieved passages, is told not to use outside knowledge, and the page sources are shown to the user.
- Keep keys out of the server. With the Sarvam option, the browser talks to Sarvam directly. The server receives only text and never sees the user's key.
Try it
You do not need to set anything up to see it work. Open the voice agent in CUGA Apps on Hugging Face Spaces, ask a farming question in your language, and listen to the answer:
Want to build one yourself? Our step-by-step tutorial, Build an Indic Voice Agent with CUGA, starts from an empty folder and adds each layer in turn.
Beyond farming: Scaling for Bharat
Nothing here is specific to agriculture. Swap the handbook for scheme documents, health advisories, or legal guides, and you have a different assistant. Swap the speech provider and you change the deployment model, such as cloud for speed or on-premises for data sovereignty, without rewriting the agent.
Voice-first, multilingual assistants are how digital services can reach people who were never served well by English-only text screens. Building them on an open, auditable harness, with answers tied to sources people can check, is how they earn trust.
This approach sits precisely at the intersection of what we are building with IBM Bharat Core. Bharat Core is an optimized AI stack built on top of IBM Sovereign Core, designed specifically for the Indian ecosystem to run Indic AI workloads securely on local infrastructure. When scaling a voice agent from a prototype to a secure enterprise application (like a vernacular KYC system or multilingual government bot), you need greater control over data sovereignty. By pairing CUGA’s flexible agent harness with Bharat Core’s ready-to-deploy Indic connectors and fine-tuned models, developers can build fully compliant, sovereign AI solutions tailored to India's unique linguistic diversity.
If you are building for India at scale, see the work happening at IBM Bharat Core.
Learn more about CUGA
New to CUGA? Here are some places to start:
- cuga.dev: the CUGA home page.
- CUGA on GitHub: the open-source harness (Apache 2.0). Star it, file issues, or pick up a good first issue.
- CUGA documentation: setup, the SDK, knowledge, policies and configuration.
- CUGA Apps gallery on GitHub: the source for the apps in the Hugging Face Space.
Spaces you can try in your browser:
- CUGA Agent: the general-purpose agent, running on a demo CRM scenario.
- CUGA Apps: launch working CUGA apps from one dashboard.
- CUGA Policy Playground: two live agents side by side, one with policies and one without.
More CUGA posts on the Hugging Face blog:
- CUGA on Hugging Face: Democratizing Configurable AI Agents: the introduction to CUGA and its configurable reasoning modes.
- Build real agentic apps using CUGA: two dozen working examples on a lightweight harness: the app gallery this voice agent belongs to.
- Same Model, Different Harness: CUGA, Hermes, and Deep Agents — When to Pick CUGA?: how much the harness matters when the model stays the same.
Spaces mentioned in this article 3
More from this author
Time-Series Models in the Streamhouse: A New Frontier and Use Cases
Palette: teaching a small model to build decks in your design language
Community
This is an interesting example of how voice agents can support Indic languages and make AI more accessible to diverse users. I think AI agent cost optimization is also worth considering when developing voice-based solutions, as managing compute resources and usage costs can help make these applications more practical to scale. I also came across this article on AI KYC automation and customer verification, which explores another practical application of AI in business workflows: https://mobisoftinfotech.com/resources/blog/ai-kyc-automation-customer-verification