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.
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, OpenAI)
- 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)
- OpenAI (create new secret key)
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:
Available Options
Language Codes
Speaker Voices (Bulbul v2)
Female Voices:
anushka- Clear and professional (default)manisha- Warm and friendly (recommended for citizen services)vidya- Articulate and precisearya- Young and energetic
Male Voices:
abhilash- Deep and authoritativekarun- Natural and conversationalhitesh- Professional and engaging
Pro Tips
- Use
language="unknown"to serve citizens who speak different languages - Use warm, friendly voices like
manishafor 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
Need Help?
- Sarvam Support: developer@sarvam.ai
- Community: Join the Discord Community
Happy Building!