<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tanmaya sree Chirra</title>
    <description>The latest articles on DEV Community by Tanmaya sree Chirra (@tanmaya_sreechirra_d568b).</description>
    <link>https://dev.to/tanmaya_sreechirra_d568b</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4079374%2Fcd39d5b0-0bb1-446c-9663-3264e1c15b41.jpg</url>
      <title>DEV Community: Tanmaya sree Chirra</title>
      <link>https://dev.to/tanmaya_sreechirra_d568b</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tanmaya_sreechirra_d568b"/>
    <language>en</language>
    <item>
      <title>From Zero to Hindi Voice Agent in 10 Days: Schemes, Memory, and Outbound Calls"</title>
      <dc:creator>Tanmaya sree Chirra</dc:creator>
      <pubDate>Sat, 15 Aug 2026 18:37:54 +0000</pubDate>
      <link>https://dev.to/tanmaya_sreechirra_d568b/from-zero-to-hindi-voice-agent-in-10-days-schemes-memory-and-outbound-calls-24cf</link>
      <guid>https://dev.to/tanmaya_sreechirra_d568b/from-zero-to-hindi-voice-agent-in-10-days-schemes-memory-and-outbound-calls-24cf</guid>
      <description>&lt;h1&gt;
  
  
  Building Ashley: A Hindi Voice Agent for Rural Financial Access
&lt;/h1&gt;

&lt;h2&gt;
  
  
  The Problem and the Users
&lt;/h2&gt;

&lt;p&gt;India has over 500 million Jan Dhan account holders — yet millions of first-time banking users in rural areas don't know what schemes they qualify for, how UPI works, or even how to &lt;br&gt;
open a zero-balance account. They can't navigate government portals. They don't read English. And they're often afraid of being cheated.&lt;/p&gt;

&lt;p&gt;A chatbot doesn't help them. A voice agent does.&lt;/p&gt;

&lt;p&gt;Ashley is a Hindi/Hinglish voice agent built for exactly these users — someone who speaks to them like a helpful neighbour, in their own language, for free, 24/7. Built for the #&lt;br&gt;
VoiceForBharat challenge under the Financial Services track.&lt;/p&gt;

&lt;p&gt;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━&lt;/p&gt;

&lt;h2&gt;
  
  
  What Ashley Does
&lt;/h2&gt;

&lt;p&gt;• Speaks and understands Hindi and Hinglish&lt;br&gt;
• Checks eligibility for 5 government schemes: Jan Dhan, PM Kisan, Mudra Yojana, PMJJBY, PMSBY&lt;br&gt;
• Remembers returning users (with their consent)&lt;br&gt;
• Escalates fraud cases to human agents with a reference ID&lt;br&gt;
• Places outbound Twilio reminder calls for scheme deadlines&lt;br&gt;
• Hands off to Priya, a specialist agent, for deep scheme queries&lt;br&gt;
• Shows a live call analytics dashboard and escalations dashboard&lt;/p&gt;

&lt;p&gt;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━&lt;/p&gt;

&lt;h2&gt;
  
  
  How the System Works
&lt;/h2&gt;

&lt;p&gt;Browser mic → Web Speech API (STT)&lt;br&gt;
           → Flask /chat → LLM (OpenRouter) → Tool calls&lt;br&gt;
           → Murf Falcon API (TTS) → Audio URL → Browser plays&lt;/p&gt;

&lt;p&gt;The frontend handles speech recognition via the Web Speech API. The text goes to a Flask backend, which runs it through an LLM with tool-calling enabled. The LLM can call tools like &lt;br&gt;
check_eligibility, save_user, create_escalation, or handoff_to_scheme_specialist. The response text is sent to Murf Falcon for TTS, and the audio URL is played back in the browser.&lt;/p&gt;

&lt;p&gt;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━&lt;/p&gt;

&lt;h2&gt;
  
  
  The Most Important Features
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Indian Voice with Personality — Murf Falcon (hi-IN-shweta)
&lt;/h3&gt;

&lt;p&gt;Ashley uses Murf Falcon GEN2 with the hi-IN-shweta voice — warm, natural, and unmistakably Indian. The system prompt enforces a strict personality: warm, unhurried, under 2 sentences&lt;br&gt;
per response, mirrors the user's language exactly.&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
MURF_VOICE_ID = "hi-IN-shweta"&lt;/p&gt;

&lt;p&gt;def murf_tts(text: str) -&amp;gt; str:&lt;br&gt;
    r = requests.post(&lt;br&gt;
        "&lt;a href="https://api.murf.ai/v1/speech/generate" rel="noopener noreferrer"&gt;https://api.murf.ai/v1/speech/generate&lt;/a&gt;",&lt;br&gt;
        headers={"api-key": MURF_API_KEY, "Content-Type": "application/json"},&lt;br&gt;
        json={"voiceId": MURF_VOICE_ID, "text": text, "format": "MP3", "modelVersion": "GEN2"},&lt;br&gt;
    )&lt;br&gt;
    r.raise_for_status()&lt;br&gt;
    return r.json()["audioFile"]&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Safety Guardrails
&lt;/h3&gt;

&lt;p&gt;Ashley will never ask for OTPs, PINs, or account numbers. If someone tries, she says exactly:&lt;br&gt;
│ &lt;em&gt;"Main aapka OTP ya PIN kabhi nahi maangunga. Koi bhi yeh maange toh fraud ho sakta hai — turant call kaatein."&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Scheme Eligibility Tool
&lt;/h3&gt;

&lt;p&gt;A local dataset of 5 schemes with eligibility rules. The LLM calls check_eligibility as soon as it has one relevant data point — age, farmer status, business ownership — without &lt;br&gt;
waiting to collect everything first.&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
def check_eligibility(answers: dict) -&amp;gt; dict:&lt;br&gt;
    eligible = []&lt;br&gt;
    for name, scheme in SCHEMES.items():&lt;br&gt;
        try:&lt;br&gt;
            if scheme&lt;a href="https://dev.toanswers"&gt;"rules"&lt;/a&gt;:&lt;br&gt;
                eligible.append({&lt;br&gt;
                    "scheme": name,&lt;br&gt;
                    "description": scheme["description"],&lt;br&gt;
                    "documents": scheme["documents"],&lt;br&gt;
                    "apply_at": scheme["apply_at"],&lt;br&gt;
                })&lt;br&gt;
        except (TypeError, ValueError):&lt;br&gt;
            continue&lt;br&gt;
    return {"eligible_schemes": eligible, "data_as_of": "August 2025 (local dataset)"}&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Consent-Gated Memory
&lt;/h3&gt;

&lt;p&gt;Ashley asks before saving anything:&lt;br&gt;
│ &lt;em&gt;"Kya main yeh yaad rakh sakta hoon aapke liye?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Only name, language preference, and scheme facts are stored — never account numbers or Aadhaar.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Human Escalation + Outbound Calls
&lt;/h3&gt;

&lt;p&gt;Fraud reports and blocked account cases get escalated with a reference ID. Users can also request a Twilio outbound reminder call to their phone for scheme deadlines.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Specialist Handoff
&lt;/h3&gt;

&lt;p&gt;When a user needs detailed scheme guidance, Ashley hands off to Priya — a specialist agent with a different system prompt — without making the user repeat themselves.&lt;/p&gt;

&lt;p&gt;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━&lt;/p&gt;

&lt;h2&gt;
  
  
  Challenges and How I Overcame Them
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Overlapping Audio Problem
&lt;/h3&gt;

&lt;p&gt;The biggest bug: when a user typed a message before clicking "Start Call", two audio responses would play simultaneously — the greeting and the reply — completely overlapping.&lt;/p&gt;

&lt;p&gt;Root cause: speakAgent() was creating a new Audio() object every time without stopping the previous one. Also, the chat input depended on an active voice session — if /start hadn't &lt;br&gt;
been called, /chat had no session history and silently failed.&lt;/p&gt;

&lt;p&gt;Fix: Made speakAgent() return a Promise and always call stopAudio() first. Created a single handleUserMessage(text, source) function that both voice and chat feed into. If no session&lt;br&gt;
exists when a chat message arrives, it auto-starts one, awaits the greeting, then sends the message — in sequence, never in parallel.&lt;/p&gt;

&lt;p&gt;javascript&lt;br&gt;
function stopAudio() {&lt;br&gt;
    if (agentAudio) {&lt;br&gt;
        agentAudio.onended = null;&lt;br&gt;
        agentAudio.onerror = null;&lt;br&gt;
        agentAudio.pause();&lt;br&gt;
        agentAudio = null;&lt;br&gt;
    }&lt;br&gt;
    isSpeaking = false;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;function speakAgent(reply, audioUrl) {&lt;br&gt;
    return new Promise((resolve) =&amp;gt; {&lt;br&gt;
        stopAudio(); // always kill previous before starting new&lt;br&gt;
        // ...&lt;br&gt;
    });&lt;br&gt;
}&lt;/p&gt;

&lt;h3&gt;
  
  
  Free LLM Rate Limits
&lt;/h3&gt;

&lt;p&gt;OpenRouter's free tier has a 50 requests/day cap. Hit it mid-demo. Solution: keep a fallback model ready (nvidia/nemotron-3-super-120b-a12b:free) and consider adding $5 credits for &lt;br&gt;
recording days.&lt;/p&gt;

&lt;p&gt;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Build and Run It
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Components You Need
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;th&gt;Tool used&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;STT&lt;/td&gt;
&lt;td&gt;Converts speech to text&lt;/td&gt;
&lt;td&gt;Web Speech API (browser)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LLM&lt;/td&gt;
&lt;td&gt;Understands and responds&lt;/td&gt;
&lt;td&gt;OpenRouter&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TTS&lt;/td&gt;
&lt;td&gt;Converts text to speech&lt;/td&gt;
&lt;td&gt;Murf Falcon API&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Transport&lt;/td&gt;
&lt;td&gt;Connects everything&lt;/td&gt;
&lt;td&gt;Flask + fetch&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Setup
&lt;/h3&gt;

&lt;p&gt;bash&lt;br&gt;
git clone &lt;a href="https://github.com/your-username/ashley" rel="noopener noreferrer"&gt;https://github.com/your-username/ashley&lt;/a&gt;&lt;br&gt;
cd ashley&lt;br&gt;
python3 -m venv venv&lt;br&gt;
source venv/bin/activate&lt;br&gt;
pip install -r requirements.txt&lt;/p&gt;

&lt;h3&gt;
  
  
  API Keys
&lt;/h3&gt;

&lt;p&gt;Create a .env file — never commit this:&lt;/p&gt;

&lt;p&gt;MURF_API_KEY=your_key&lt;br&gt;
OPENROUTER_API_KEY=your_key&lt;br&gt;
TWILIO_ACCOUNT_SID=your_sid&lt;br&gt;
TWILIO_AUTH_TOKEN=your_token&lt;br&gt;
TWILIO_FROM_NUMBER=+1xxxxxxxxxx&lt;br&gt;
PUBLIC_BASE_URL=&lt;a href="https://your-ngrok-url.ngrok.io" rel="noopener noreferrer"&gt;https://your-ngrok-url.ngrok.io&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Run
&lt;/h3&gt;

&lt;p&gt;bash&lt;br&gt;
python server.py&lt;/p&gt;

&lt;h1&gt;
  
  
  open &lt;a href="http://localhost:5000" rel="noopener noreferrer"&gt;http://localhost:5000&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;For outbound calls, run ngrok in a separate terminal:&lt;br&gt;
bash&lt;br&gt;
ngrok http 5000&lt;/p&gt;

&lt;p&gt;Then update PUBLIC_BASE_URL in .env with the ngrok URL.&lt;/p&gt;

&lt;h3&gt;
  
  
  Test a Conversation
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;a href="http://localhost:5000" rel="noopener noreferrer"&gt;http://localhost:5000&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Enter your name or phone number&lt;/li&gt;
&lt;li&gt;Click "Baat Shuru Karein" or just type in the chat box&lt;/li&gt;
&lt;li&gt;Ask: "Main kisan hoon, mujhe kya mil sakta hai?"&lt;/li&gt;
&lt;li&gt;Ashley will ask your age and land size, then show eligible schemes&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd Improve Next
&lt;/h2&gt;

&lt;p&gt;• Replace Web Speech API with Deepgram or AssemblyAI for better Hindi accuracy&lt;br&gt;
• Add support for regional languages: Tamil, Bengali, Marathi&lt;br&gt;
• Move from SQLite to PostgreSQL for production&lt;br&gt;
• Add a proper job queue so outbound calls don't block the server&lt;br&gt;
• Stream TTS audio instead of waiting for the full clip&lt;/p&gt;

&lt;p&gt;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;p&gt;• 🔗 GitHub: &lt;a href="https://github.com/25wh1a6678-art/voice_agent" rel="noopener noreferrer"&gt;https://github.com/25wh1a6678-art/voice_agent&lt;/a&gt;&lt;br&gt;
• 📊 Analytics: &lt;a href="http://localhost:5000/dashboard" rel="noopener noreferrer"&gt;http://localhost:5000/dashboard&lt;/a&gt;&lt;br&gt;
• 🆘 Escalations: &lt;a href="http://localhost:5000/escalations" rel="noopener noreferrer"&gt;http://localhost:5000/escalations&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1176upeiaus3j6lt42ko.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1176upeiaus3j6lt42ko.png" alt=" " width="800" height="622"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>voiceagent</category>
      <category>python</category>
      <category>opensource</category>
      <category>fintech</category>
    </item>
  </channel>
</rss>
