Building Roshni: An Ultra-Low Latency, Multi-Agent Financial Voice Assistant for Bharat ๐ฎ๐ณ
How I built an end-to-end, multilingual financial voice AI using Murf Falcon, LiveKit Agents, Deepgram Nova-3, Google Gemini, and Next.js during the 10 Days of AI Voice Agents Challenge.
๐ 1. The Problem & Why Voice Matters for Bharat
In India, financial inclusion has accelerated rapidly with UPI, digital banking, and government-backed credit initiatives. However, navigating complex interest rates, eligibility criteria for government schemes (like PM Mudra or Sukanya Samriddhi Yojana), and understanding formal banking terms remains intimidating for millions of citizensโespecially in regional and tier-2/3 heartlands where digital interfaces can be overwhelming.
Text-first interfaces fail where voice thrives.
When rural entrepreneurs or first-time bank customers have questions, they don't want to navigate complex web forms or read dense PDFs. They want to ask a direct question in their language and get an immediate, clear, spoken answer.
To solve this, I built Roshni AI (and her specialist counterpart, Vikram) โ an ultra-low latency, conversational financial assistant engineered for natural voice interactions in English, Hindi (Devanagari script), and Hinglish.
๐๏ธ 2. High-Level Architecture & Tech Stack
Building a real-time conversational agent requires synchronizing four core pipelines with sub-second latency:
[ ๐ค User Microphone ]
โ (WebRTC Audio Stream)
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ LiveKit Agents Worker โ
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโ
โผ โผ โผ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Deepgram โ โโโโโบ โGoogle Geminiโ โโโโโบ โ Murf Falcon โ
โ Nova-3 โ โ (LLM) โ โ Fast TTS โ
โ (Fast STT) โ โ โ โ (Anisha / Samar)โ
โโโโโโโโโโโโโโโ โโโโโโโโฌโโโโโโโ โโโโโโโโโโฌโโโโโโโโโ
โ (Tool / Handoff) โ
โผ โผ
โโโโโโโโโโโโโโโโโ [ ๐ Audio Output ]
โ SQLite Memory โ
โ & Analytics โ
โโโโโโโโโโโโโโโโโ
The Stack:
- TTS (Text-to-Speech): Murf Falcon โ Delivering conversational Indian voices (Anisha for general banking and Samar for specialist schemes) with lightning-fast Time-To-First-Byte (TTFB ~95ms).
-
STT (Speech-to-Text): Deepgram Nova-3 (
language="multi") for instantaneous multi-language speech recognition. -
LLM Engine: Google Gemini (
gemini-3.5-flash-lite) with strict prompt guardrails. - Real-time Transport & Orchestration: LiveKit Agents Framework + Silero VAD for natural turn-taking and interruption handling.
- Frontend Portal & Dashboard: Next.js 15, Tailwind CSS, and LiveKit Components React.
- Persistence & Call Analytics: SQLite with instant synchronous write pipelines.
๐ 3. Key Capabilities Built
๐๏ธ 1. Ultra-Realistic Indian Voices via Murf Falcon
Using Murf Falconโs conversational voices transformed the agent from a robotic IVR into a warm, approachable advisor. By pacing sentences naturally and configuring TTFB optimization, conversational latency stayed under 1 second.
๐ค 2. Native Devanagari Script Enforcement
A common flaw in bilingual voice bots is sending romanized Hindi (e.g., "namaste, aapka swagat hai") to TTS engines, causing English phonetic engines to mispronounce Indian syllables. I enforced strict system prompt constraints:
Always write Hindi in Devanagari script (e.g., "เคจเคฎเคธเฅเคคเฅ, เคเคชเคเคพ เคธเฅเคตเคพเคเคค เคนเฅ"). Never write romanized Hindi.
This simple prompt architecture ensured flawless Indian accent pronunciation every single turn.
๐ง 3. Persistent Memory & User Recognition
Using SQLite (agent_memory.db), Roshni stores caller identity, preferred languages, and previous queries. Returning users are greeted by name with tailored suggestions based on their recorded financial profile.
๐ ๏ธ 4. Tool Execution & Dynamic Rate Lookups
Roshni accesses custom tools like check_scheme_rates to provide live, structured interest rate calculations for Fixed Deposits, Senior Citizen schemes, and Savings accounts without LLM hallucinations.
๐ค 5. Multi-Agent Specialist Handoff (Day 9 Milestone)
One agent should not try to be an expert in everything. I split responsibilities between two distinct agents:
- Roshni (General Banking): Powered by Murf Falcon Anisha. Handles general banking and savings queries.
- Vikram (Government Scheme Specialist): Powered by Murf Falcon Samar. Specializes in PM Mudra loans, subsidies, and government welfare programs.
When a caller asks about government schemes, Roshni announces: "I will connect you to Vikram, our Government Scheme Specialist", and hands over the full conversation history to Vikram in real time.
# Multi-Agent Handoff in LiveKit
@function_tool
async def transfer_to_scheme_specialist(self, context: RunContext, query: str) -> str:
"""Handoff caller to Vikram for Government Scheme queries."""
self.session_state["is_success"] = True
record_call_outcome(self.call_id, "SUCCESS", "Transferred to Scheme Specialist")
return "I will connect you to Vikram, our Government Scheme Specialist."
๐ 6. Real-Time Call Analytics Dashboard
A dedicated Next.js dashboard tracks live call outcomes:
- Total Calls, Successful Inquiries, and Failure rates.
- Live inspection of active session reference IDs and reasons.
- Zero-cache dynamic API endpoints polling local SQLite metrics every 2 seconds.
๐ฅ 4. Engineering Challenges & How I Solved Them
No real-world AI project works on the first try. Here were the biggest hurdles and how I conquered them:
โก Challenge 1: The 429 Quota Trap & Model Selection
-
The Problem: Experimental LLM versions like
gemini-3.5-flashhave an ultra-restrictive free tier limit of only 20 requests per day. Voice pipelines consume 10โ15 calls per conversation due to streaming transcript evaluations, quickly causing429 Too Many Requestscrashes. -
The Solution: I switched to
gemini-3.5-flash-lite, which offers 500 daily requests, instantly resolving quota exhaustion and reducing inference latency.
โฑ๏ธ Challenge 2: Synchronous Network Blocking in Function Tools
- The Problem: Making synchronous network calls inside tools blocked the Python asyncio event loop, causing LiveKit audio streams to stutter and trigger gateway timeouts.
-
The Solution: Refactored all tool network operations to use asynchronous non-blocking patterns (
aiohttp), keeping audio streaming perfectly smooth.
๐พ Challenge 3: SQLite Multi-Process Disconnect Race Conditions
-
The Problem: Logging call outcomes strictly on
on_disconnectedsometimes missed calls when sessions were terminated abruptly by the browser client. - The Solution: Implemented synchronous write-ahead loggingโrecording an initial session row immediately on connect and updating it instantly the moment a tool executes.
๐ ๏ธ 5. Step-by-Step Guide: Run Your Own Voice Agent
Want to run this agent locally? Here is how to get started in under 5 minutes:
Prerequisites
- Python 3.10+
- Node.js 18+
- Free API Keys: LiveKit Cloud, Murf AI, Deepgram, and Google AI Studio.
Step 1: Clone the Repository
git clone [https://github.com/your-username/murf-livekit-starter-main.git](https://github.com/your-username/murf-livekit-starter-main.git)
cd murf-livekit-starter-main
Step 2: Configure Environment Variables
Create a .env file in backend/:
LIVEKIT_URL=wss://your-project.livekit.cloud
LIVEKIT_API_KEY=your_livekit_api_key
LIVEKIT_API_SECRET=your_livekit_api_secret
DEEPGRAM_API_KEY=your_deepgram_api_key
MURF_API_KEY=your_murf_api_key
GOOGLE_API_KEY=your_gemini_api_key
Step 3: Run Backend Agent
cd backend
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
python src/agent.py dev
Step 4: Run Next.js Frontend
cd ../frontend
npm install
npm run dev
Open http://localhost:3000, click Start Session, and start talking!
๐ฎ Whatโs Next?
- More Regional Dialects: Adding Tamil, Telugu, and Bengali voice models using Murf Falcon.
- Direct Core Banking API Integration: Secure sandboxed mock transactions via voice biometric confirmation.
- Low-bandwidth Audio Compression: Optimizing codecs for 2G/3G mobile connectivity in rural areas.
๐ Links & Resources
- ๐๏ธ TTS Engine: Murf Falcon API (https://murf.ai/)
- โก Realtime Engine: LiveKit Voice AI (https://livekit.io/)
MY ENTIRE CODE IS IN [ https://github.com/rumparoy3012-ops/DAY-1-AI-VOICE-AGENT-BUILDING ] SO IF VIEW IT FOR BETTER UNDERSTANDING.
Special thanks to the Murf AI team for organizing the #10DaysofAIVoiceAgents โ VoiceForBharat Challenge!

Top comments (2)
good
Nice ๐๐ป