Government Scheme Awareness Agent using LiveKit
Overview
This guide demonstrates how to build a government scheme awareness agent that helps citizens discover, understand, and learn how to apply for various government welfare schemes using LiveKit for real-time communication and Sarvam AI for speech processing. Ideal for government digital initiatives, NGOs, and citizen service centers.
For the broader architecture pattern this agent fits into, accessibility, grounding scheme facts, latency targets, see the Government Services use-case guide. For a closely related rural/farmer audience, see Agri & Rural.
What You’ll Build
A voice agent that can:
- Explain various government schemes in simple language
- Help citizens understand eligibility criteria
- Guide users through application processes
- Answer questions about benefits, documents required, and deadlines
- Communicate in multiple Indian languages for maximum accessibility
Quick Overview
- Get API keys (LiveKit, Sarvam)
- Install packages
- Create
.envfile with your API keys - Write the agent code
- Run:
python agent.py dev - Test:
python agent.py console
Quick Start
1. Prerequisites
- Python 3.9 or higher
- API keys from:
- LiveKit Cloud (free account)
- Sarvam AI (get API key from dashboard)
2. Install Dependencies
macOS/Linux
Windows
3. Create Environment File
Create a file named .env in your project folder and add your API keys:
Replace the values with your actual API keys.
4. Write Your Agent
Create scheme_awareness_agent.py:
5. Run Your Agent
6. Test Your Agent
In a new terminal, run:
Customization Examples
Example 1: Hindi-focused Agent
For Hindi-speaking citizens:
Example 2: Tamil Agent for Rural Tamil Nadu
Example 3: Bengali Agent for West Bengal
Example 4: Multilingual Agent (Auto-detect)
For citizen service centers serving diverse populations:
Example 5: Speech-to-English Agent (Saaras)
When you need to process regional language input but generate English reports. Saaras v3 handles both transcription (same-language output) and translation (English output) via the mode parameter: use mode="translate" for speech-to-English.
Available Options
Language Codes
Speaker Voices (Bulbul v3)
Male (23): Shubh (default), Aditya, Rahul, Rohan, Amit, Dev, Ratan, Varun, Manan, Sumit, Kabir, Aayan, Ashutosh, Advait, Anand, Tarun, Sunny, Mani, Gokul, Vijay, Mohit, Rehan, Soham
Female (14): Ritu, Priya, Neha, Pooja, Simran, Kavya, Ishita, Shreya, Roopa, Tanya, Shruti, Suhani, Kavitha, Rupali
Pro Tips
- Use
language="unknown"to serve citizens who speak different languages - Use warm, friendly voices like
simranfor citizen-facing services - Sarvam’s models handle code-mixing naturally - citizens often mix Hindi with English or regional languages
- Consider deploying region-specific agents for better language accuracy
- Keep responses simple and avoid bureaucratic jargon
Troubleshooting
API key errors: Check that all keys are in your .env file and the file is in the same directory as your script.
Module not found: Run the installation command again based on your operating system.
Poor transcription: Try language="unknown" for auto-detection, or specify the correct language code.
Additional Resources
- Sarvam AI Documentation
- LiveKit Documentation
- LiveKit Sarvam LLM Plugin
- LiveKit Sarvam STT Plugin
- LiveKit Sarvam TTS Plugin
Need Help?
- Sarvam Support: developer@sarvam.ai
- Community: Join the Discord Community
Happy Building!