<?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: Aniket Dubey</title>
    <description>The latest articles on DEV Community by Aniket Dubey (@aniket_dubey_1204).</description>
    <link>https://dev.to/aniket_dubey_1204</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%2F4078056%2F1c01664a-6da5-45af-b2b8-6882b6003b48.png</url>
      <title>DEV Community: Aniket Dubey</title>
      <link>https://dev.to/aniket_dubey_1204</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aniket_dubey_1204"/>
    <language>en</language>
    <item>
      <title>Building Dukaan Saathi: A Production Voice AI Agent for India's Local Kirana Stores</title>
      <dc:creator>Aniket Dubey</dc:creator>
      <pubDate>Fri, 14 Aug 2026 17:54:41 +0000</pubDate>
      <link>https://dev.to/aniket_dubey_1204/building-dukaan-saathi-a-production-voice-ai-agent-for-indias-local-kirana-stores-aj0</link>
      <guid>https://dev.to/aniket_dubey_1204/building-dukaan-saathi-a-production-voice-ai-agent-for-indias-local-kirana-stores-aj0</guid>
      <description>&lt;h1&gt;
  
  
  Building Dukaan Saathi: A Production Voice AI Agent for India's Local Kirana Stores
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;How I built a full-duplex, multilingual voice AI assistant with real-time commodity pricing, persistent memory, SIP outbound calling, human escalation, call analytics, and specialist agent handoffs in 10 days using Murf Falcon &amp;amp; LiveKit.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  📌 The Problem &amp;amp; The Mission
&lt;/h2&gt;

&lt;p&gt;Across India, millions of neighborhood &lt;strong&gt;Kirana (mom-and-pop grocery) stores&lt;/strong&gt; form the backbone of daily commerce. While large e-commerce apps require typing and complex UI navigation, local shoppers and shopkeepers have always relied on one natural interface: &lt;strong&gt;their voice&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Customers frequently call or walk in asking:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;"Atta ka rate kya chal raha hai?"&lt;/em&gt; (What's the current price of flour?)&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;"Pichhli bar wala saman bhej do."&lt;/em&gt; (Send my usual monthly ration.)&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;"Kharab tel ka packet return karna hai."&lt;/em&gt; (I need to return a damaged oil packet.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Typing on keyboards or navigating complex apps is a friction point for small store owners. &lt;strong&gt;Voice AI is the ultimate equalizer.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For the &lt;strong&gt;Murf AI #VoiceForBharat Challenge (10 Days of Voice Agents)&lt;/strong&gt;, I built &lt;strong&gt;Dukaan Saathi (दुकान साथी)&lt;/strong&gt; — a production-ready, full-duplex digital voice assistant tailored specifically for India's local retail ecosystem.&lt;/p&gt;




&lt;h2&gt;
  
  
  🏗️ System Architecture
&lt;/h2&gt;

&lt;p&gt;Dukaan Saathi processes spoken Hindi in real time with sub-150ms voice latency using the following pipeline:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;flowchart TD
    User([🎙️ Caller: Browser WebRTC or SIP Phone]) &amp;lt;--&amp;gt; LiveKit[⚡ LiveKit Real-Time Audio Transport]
    LiveKit &amp;lt;--&amp;gt; Deepgram[🗣️ Deepgram Nova-3 STT \nCustom Kirana Keyterms]
    Deepgram &amp;lt;--&amp;gt; LLM[🧠 Groq LLaMA 3.3 70B \n+ CleanGroqLLM Sanitizer]
    LLM &amp;lt;--&amp;gt; Tools[🛠️ Tool Ecosystem \n• Mandi API \n• SQLite Memory \n• Escalations \n• Specialist Handoff]
    LLM --&amp;gt; MurfFalcon[🔊 Murf Falcon TTS \nhi-IN-anisha &amp;amp; hi-IN-karan \nSub-150ms Latency]
    MurfFalcon --&amp;gt; LiveKit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Core Technologies:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;TTS (Text-to-Speech)&lt;/strong&gt;: &lt;strong&gt;&lt;a href="https://murf.ai/" rel="noopener noreferrer"&gt;Murf Falcon&lt;/a&gt;&lt;/strong&gt; (&lt;code&gt;hi-IN-anisha&lt;/code&gt; for main assistant, &lt;code&gt;hi-IN-karan&lt;/code&gt; for specialist) — delivering ultra-fast, natural Indian voice synthesis.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;STT (Speech-to-Text)&lt;/strong&gt;: &lt;strong&gt;Deepgram Nova-3&lt;/strong&gt; tuned with Indian retail keywords (&lt;em&gt;dukaan, aata, chawal, cheeni, udhaar, bhaiya&lt;/em&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LLM&lt;/strong&gt;: &lt;strong&gt;Groq LLaMA 3.3 70B Versatile&lt;/strong&gt; for intelligent reasoning and tool calling.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Transport&lt;/strong&gt;: &lt;strong&gt;LiveKit WebRTC &amp;amp; SIP Telephony&lt;/strong&gt; for seamless browser and phone calls.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory &amp;amp; Analytics&lt;/strong&gt;: &lt;strong&gt;SQLite (&lt;code&gt;callers.db&lt;/code&gt;)&lt;/strong&gt; via &lt;code&gt;aiosqlite&lt;/code&gt; (Python backend) and &lt;code&gt;better-sqlite3&lt;/code&gt; (Next.js dashboard).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Frontend&lt;/strong&gt;: &lt;strong&gt;Next.js 14, TypeScript &amp;amp; Tailwind CSS&lt;/strong&gt; with a 5-state 3D audio visualizer.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  🚀 Key Features Built Over 10 Days
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Ultra-Low Latency Natural Hindi Voice (Murf Falcon)
&lt;/h3&gt;

&lt;p&gt;Using Murf Falcon's streaming TTS, responses feel instantaneous. The agent speaks strictly in natural Devanagari Hindi with proper gender agreement and polite Indian conversational grammar (&lt;em&gt;"नमस्ते! मैं दुकान साथी हूँ, बताइए आज क्या सामान चाहिए?"&lt;/em&gt;).&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Interactive 3D Visualizer &amp;amp; Real-Time Hinglish Transliteration
&lt;/h3&gt;

&lt;p&gt;The Next.js frontend features a dynamic 5-State 3D Soap Bubble audio visualizer that reacts to agent states (&lt;em&gt;Listening, Thinking, Speaking, Idle, Error&lt;/em&gt;) and provides real-time Hinglish transliteration for spoken Devanagari Hindi.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Persistent Caller Memory with Verbal Consent
&lt;/h3&gt;

&lt;p&gt;The agent recognizes returning customers by their phone or participant ID:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It greets returning customers warmly and recalls past orders (&lt;em&gt;"नमस्ते अनिकेत जी! पिछली बार आपने 5 kg आटा और 1 kg दाल ली थी..."&lt;/em&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Consent Guardrail&lt;/strong&gt;: Before saving any customer preference, the agent explicitly asks for verbal permission (&lt;em&gt;"क्या मैं यह जानकारी याद रख सकती हूँ?"&lt;/em&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Live Mandi Commodity Price Lookup (data.gov.in API)
&lt;/h3&gt;

&lt;p&gt;Connected the agent to the &lt;strong&gt;Government of India’s Open Mandi API (data.gov.in AGMARKNET)&lt;/strong&gt; with an automatic local catalog fallback (&lt;code&gt;prices_local.json&lt;/code&gt;). When a customer asks &lt;em&gt;"Pyaaz ka rate kya hai?"&lt;/em&gt;, it checks live prices in milliseconds.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Outbound Phone Calling via SIP (Linphone)
&lt;/h3&gt;

&lt;p&gt;Dukaan Saathi doesn't just receive calls — it proactively makes outbound restock reminder phone calls over SIP trunking to remind customers before their monthly groceries run out.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Human Escalation System &amp;amp; Dedicated Owner Dashboard
&lt;/h3&gt;

&lt;p&gt;When issues exceed the agent’s scope (e.g., payment disputes, damaged bulk orders), it asks permission and creates an escalation ticket (&lt;code&gt;TKT-XXXXXX&lt;/code&gt;). Store owners manage these in a real-time &lt;strong&gt;Human Escalation Dashboard&lt;/strong&gt; (&lt;code&gt;/escalations&lt;/code&gt;).&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Live Call Analytics Dashboard
&lt;/h3&gt;

&lt;p&gt;A real-time analytics web dashboard (&lt;code&gt;/dashboard&lt;/code&gt;) tracking:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Total Calls, Successful Calls, Failed Calls&lt;/strong&gt; (100% real data from SQLite).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Channel Breakdown&lt;/strong&gt; (WebRTC vs. SIP Phone).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Failure Classification&lt;/strong&gt; (Early hangup, out of stock, incomplete enquiry).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Privacy Protection&lt;/strong&gt;: Zero transcripts, passwords, or PII exposed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  8. Specialist Agent Handoff (Returns &amp;amp; Refunds)
&lt;/h3&gt;

&lt;p&gt;One agent shouldn't do everything. For product returns, the main agent (&lt;code&gt;Assistant&lt;/code&gt; / Anisha) announces a transfer and hands the call to the &lt;strong&gt;Returns Specialist (&lt;code&gt;ReturnsAgent&lt;/code&gt; / Karan)&lt;/strong&gt;. The conversation context is passed automatically so the user never repeats themselves, and the specialist can transfer the caller back when finished!&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Real Engineering Challenges &amp;amp; How I Solved Them
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Challenge 1: LLM Function Tag Leakage in Audio Streams
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: During rapid streaming, the LLM occasionally output raw function tags (&lt;code&gt;&amp;lt;function=check_price&amp;gt;{"item": "atta"}&amp;lt;/function&amp;gt;&lt;/code&gt;) directly into the text stream, causing the TTS to read raw code aloud.&lt;br&gt;
&lt;strong&gt;Solution&lt;/strong&gt;: Built a custom stream interceptor, &lt;code&gt;CleanGroqLLM&lt;/code&gt;, which regex-filters function syntax and JSON artifacts in real time before sending text chunks to the Murf TTS stream.&lt;/p&gt;
&lt;h3&gt;
  
  
  Challenge 2: Windows UTF-8 Terminal Logging Crash
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: When logging Hindi Devanagari transcripts on Windows, Python threw &lt;code&gt;UnicodeEncodeError: 'charmap' codec can't encode character&lt;/code&gt;.&lt;br&gt;
&lt;strong&gt;Solution&lt;/strong&gt;: Reconfigured standard output at the top of the backend entry point:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stdout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;encoding&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;utf-8&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stdout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reconfigure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;encoding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;utf-8&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stderr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;encoding&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;utf-8&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stderr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reconfigure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;encoding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;utf-8&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Challenge 3: Matching Official Murf Falcon Voice Catalog
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Attempting to use Gen2 voice IDs with the ultra-low latency Falcon model returned &lt;code&gt;Invalid voice_id: hi-IN-kabir&lt;/code&gt;.&lt;br&gt;
&lt;strong&gt;Solution&lt;/strong&gt;: Queried Murf's official voice catalog endpoint (&lt;code&gt;GET https://api.murf.ai/v1/speech/voices?model=FALCON&lt;/code&gt;) to inspect and test live audio synthesis. We configured &lt;strong&gt;&lt;code&gt;hi-IN-anisha&lt;/code&gt;&lt;/strong&gt; for the female main assistant and &lt;strong&gt;&lt;code&gt;hi-IN-karan&lt;/code&gt;&lt;/strong&gt; for the male returns specialist.&lt;/p&gt;


&lt;h2&gt;
  
  
  💻 How You Can Build &amp;amp; Run Dukaan Saathi
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Prerequisites:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Python 3.10+ with &lt;code&gt;uv&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Node.js 18+ with &lt;code&gt;pnpm&lt;/code&gt; / &lt;code&gt;npm&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;API Keys: &lt;a href="https://murf.ai/api" rel="noopener noreferrer"&gt;Murf AI&lt;/a&gt;, &lt;a href="https://cloud.livekit.io" rel="noopener noreferrer"&gt;LiveKit Cloud&lt;/a&gt;, &lt;a href="https://deepgram.com" rel="noopener noreferrer"&gt;Deepgram&lt;/a&gt;, &lt;a href="https://groq.com" rel="noopener noreferrer"&gt;Groq&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  1. Clone the Repository
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/aniketdubey1204-code/murf-livekit-starter.git
&lt;span class="nb"&gt;cd &lt;/span&gt;murf-livekit-starter
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  2. Configure Environment Secrets
&lt;/h3&gt;

&lt;p&gt;Create &lt;code&gt;backend/.env.local&lt;/code&gt; and &lt;code&gt;frontend/.env.local&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;LIVEKIT_URL=wss://your-project.livekit.cloud
LIVEKIT_API_KEY=your_api_key
LIVEKIT_API_SECRET=your_api_secret
MURF_API_KEY=your_murf_falcon_key
DEEPGRAM_API_KEY=your_deepgram_key
GROQ_API_KEY=your_groq_key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Run the App (One-Click)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Windows&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;\start_app.ps1&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="c"&gt;# Linux / macOS&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;/start_app.sh&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open &lt;strong&gt;&lt;code&gt;http://localhost:3000&lt;/code&gt;&lt;/strong&gt; in your browser, click &lt;strong&gt;Start Talking&lt;/strong&gt;, and speak in Hindi! Access the analytics at &lt;strong&gt;&lt;code&gt;http://localhost:3000/dashboard&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔮 What's Next?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;📦 &lt;strong&gt;Direct UPI Payment Links&lt;/strong&gt;: Automatically sending WhatsApp payment links upon order confirmation.&lt;/li&gt;
&lt;li&gt;🗣️ &lt;strong&gt;Regional Language Support&lt;/strong&gt;: Expanding from Hindi/Hinglish to Tamil, Telugu, and Marathi using Murf Falcon's multilingual voice suite.&lt;/li&gt;
&lt;li&gt;📱 &lt;strong&gt;WhatsApp Voice Note Ingestion&lt;/strong&gt;: Allowing customers to forward voice notes for automated order processing.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔗 Links &amp;amp; Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;💻 &lt;strong&gt;GitHub Repository&lt;/strong&gt;: &lt;a href="https://github.com/aniketdubey1204-code/murf-livekit-starter" rel="noopener noreferrer"&gt;aniketdubey1204-code/murf-livekit-starter&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;⚡ &lt;strong&gt;Murf AI Falcon TTS&lt;/strong&gt;: &lt;a href="https://murf.ai/api" rel="noopener noreferrer"&gt;murf.ai/api&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🌐 &lt;strong&gt;LiveKit Real-Time Agents&lt;/strong&gt;: &lt;a href="https://docs.livekit.io" rel="noopener noreferrer"&gt;docs.livekit.io&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Linkedin&lt;/strong&gt;: &lt;a href="https://www.linkedin.com/in/aniketdubey1204/" rel="noopener noreferrer"&gt;linkedin.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Special thanks to the Murf AI team for hosting the #VoiceForBharat Challenge!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>voiceai</category>
      <category>python</category>
      <category>nextjs</category>
    </item>
  </channel>
</rss>
