<?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: Gaurav Shinde</title>
    <description>The latest articles on DEV Community by Gaurav Shinde (@gaurav_shinde_7b5a0679994).</description>
    <link>https://dev.to/gaurav_shinde_7b5a0679994</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%2F3936266%2F08f6be43-e198-45f5-9da7-2f4155db0453.png</url>
      <title>DEV Community: Gaurav Shinde</title>
      <link>https://dev.to/gaurav_shinde_7b5a0679994</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gaurav_shinde_7b5a0679994"/>
    <language>en</language>
    <item>
      <title>Building Dukaan Mitra: A Voice AI Assistant for Kirana Stores</title>
      <dc:creator>Gaurav Shinde</dc:creator>
      <pubDate>Sat, 15 Aug 2026 15:26:00 +0000</pubDate>
      <link>https://dev.to/gaurav_shinde_7b5a0679994/building-dukaan-mitra-a-voice-ai-assistant-for-kirana-stores-1lin</link>
      <guid>https://dev.to/gaurav_shinde_7b5a0679994/building-dukaan-mitra-a-voice-ai-assistant-for-kirana-stores-1lin</guid>
      <description>&lt;h1&gt;
  
  
  Building Dukaan Mitra: A Voice AI Assistant for Kirana Stores
&lt;/h1&gt;

&lt;p&gt;Over the last 10 days, I took part in &lt;strong&gt;10 Days of Voice Agents — VoiceForBharat Edition&lt;/strong&gt;, where the goal was to build a capable voice AI agent from scratch. Here's a look at what I built, the challenges I ran into, and how you can build one too.&lt;/p&gt;

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

&lt;p&gt;Local grocery shops, known as "Kirana" stores in India, run on personal relationships with regular customers. A large share of their business comes from customers calling in their monthly restock of staples like rice, dal, and oil.&lt;/p&gt;

&lt;p&gt;But during peak hours, shop owners miss these calls or forget to follow up — and that means lost sales. I wanted to fix this by building &lt;strong&gt;Dukaan Mitra&lt;/strong&gt;, an AI voice assistant that proactively calls regular customers to remind them about their monthly restock, takes their order, and saves it directly to a database.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Dukaan Mitra Does
&lt;/h2&gt;

&lt;p&gt;Dukaan Mitra is designed to sound and act like a real shop assistant:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It makes outbound calls to customers and greets them by name.&lt;/li&gt;
&lt;li&gt;It understands natural, code-mixed conversation — Hinglish, Hindi, and English.&lt;/li&gt;
&lt;li&gt;It checks today's prices and stock for items in real time.&lt;/li&gt;
&lt;li&gt;It confirms the order, generates an Order ID, and logs it.&lt;/li&gt;
&lt;li&gt;If a customer raises a complaint, dispute, or return request, it hands the call over seamlessly to a specialist agent named Pooja.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;A few key features are what made this agent feel robust and realistic rather than a scripted demo.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Indian voices with Murf Falcon&lt;/strong&gt;&lt;br&gt;
To make the agent sound local, I used &lt;strong&gt;Murf Falcon&lt;/strong&gt; for text-to-speech — the main assistant runs on the voice "Anisha," and the returns specialist runs on "Pooja." Falcon's sub-130ms latency is what made the conversation feel genuinely responsive instead of laggy and robotic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Deep guardrails and personality&lt;/strong&gt;&lt;br&gt;
I instructed the LLM to strictly use female grammatical forms when speaking Hindi/Hinglish (e.g., "main kar dungi," not "main kar dunga"). I also gave it a hard rule to never invent prices — if an item isn't in the database, the agent says so honestly instead of guessing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Real-time tools and memory&lt;/strong&gt;&lt;br&gt;
The agent connects to local SQLite databases (&lt;code&gt;inventory.db&lt;/code&gt; and &lt;code&gt;users.db&lt;/code&gt;) and uses tools like &lt;code&gt;check_price_and_stock&lt;/code&gt;, &lt;code&gt;confirm_order&lt;/code&gt;, and &lt;code&gt;save_caller&lt;/code&gt; to interact with that data mid-call.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Multi-agent handoff&lt;/strong&gt;&lt;br&gt;
Returns are tricky to handle well in one flow. When a customer asks for a refund, Dukaan Mitra calls a &lt;code&gt;transfer_to_returns_specialist&lt;/code&gt; tool that routes the conversation to a completely separate agent instance — different prompt, different voice — dedicated entirely to logging return requests.&lt;/p&gt;
&lt;h2&gt;
  
  
  The Difficult Parts: Lessons Learned
&lt;/h2&gt;

&lt;p&gt;Building this wasn't without hurdles. The biggest one was a race condition right at the start of every outbound call.&lt;/p&gt;

&lt;p&gt;Since the agent needs to know who it's calling, I initially had it call the &lt;code&gt;lookup_caller&lt;/code&gt; tool as its very first action. But I discovered that &lt;strong&gt;Gemini 3.5 Flash Lite would sometimes crash or hang if it tried to invoke a tool as its absolute first action, before any conversational turns had happened.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How I fixed it:&lt;/strong&gt; I changed the backend initialization flow. Instead of letting the agent look up the user itself, I wrote a Python script to pre-fetch the caller's information from SQLite &lt;em&gt;before&lt;/em&gt; the agent even initializes, then injected that data directly into the system prompt as &lt;code&gt;CURRENT CALLER INFO&lt;/code&gt;. This removed the need for an initial tool call entirely — it stopped the crashes and also made the agent's first response noticeably faster.&lt;/p&gt;
&lt;h2&gt;
  
  
  How to Build and Run Your Own
&lt;/h2&gt;

&lt;p&gt;If you want to build something similar, here are the main components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Speech-to-Text (STT):&lt;/strong&gt; Deepgram — turns user speech into text&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LLM:&lt;/strong&gt; Google Gemini — the brain of the agent&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Text-to-Speech (TTS):&lt;/strong&gt; Murf Falcon — turns text back into voice&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real-Time Transport:&lt;/strong&gt; LiveKit — handles the WebRTC audio streaming&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Python 3.10+ (with &lt;code&gt;uv&lt;/code&gt; for fast package management)&lt;/li&gt;
&lt;li&gt;Node.js 18+ (with &lt;code&gt;pnpm&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;A free &lt;a href="https://cloud.livekit.io/" rel="noopener noreferrer"&gt;LiveKit Cloud&lt;/a&gt; account and project&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Clone the repository&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/gauravshinde2162006-hash/Day-1-Get-Your-Voice-Agent-Talking.git
&lt;span class="nb"&gt;cd &lt;/span&gt;Day-1-Get-Your-Voice-Agent-Talking
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2: Add your API keys&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create a &lt;code&gt;.env.local&lt;/code&gt; file in &lt;em&gt;both&lt;/em&gt; the &lt;code&gt;backend/&lt;/code&gt; and &lt;code&gt;frontend/&lt;/code&gt; directories with the following:&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://...
LIVEKIT_API_KEY=your_livekit_api_key
LIVEKIT_API_SECRET=your_livekit_secret
MURF_API_KEY=your_murf_key
DEEPGRAM_API_KEY=your_deepgram_key
GOOGLE_API_KEY=your_gemini_key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;.env.local&lt;/code&gt; is already in &lt;code&gt;.gitignore&lt;/code&gt; — never commit real keys to the repo.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Install dependencies and run&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In one terminal, start the backend agent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;backend
uv &lt;span class="nb"&gt;sync
&lt;/span&gt;uv run python src/agent.py dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In a second terminal, start the frontend:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;frontend
pnpm &lt;span class="nb"&gt;install
&lt;/span&gt;pnpm dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 4: Test a conversation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Open &lt;code&gt;http://localhost:3000&lt;/code&gt;, click &lt;strong&gt;Start talking&lt;/strong&gt;, and allow microphone access. Since this simulates an outbound call, Dukaan Mitra greets you first — just like it would greet a real customer.&lt;/p&gt;

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

&lt;p&gt;Dukaan Mitra works well as a proof of concept, but a few rough edges are honestly still there:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Hardcoded caller identification.&lt;/strong&gt; The backend currently initializes each session with a fixed &lt;code&gt;caller_id&lt;/code&gt;. In production, this should come dynamically from the incoming SIP trunk data or the frontend session instead.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mocked WhatsApp integration.&lt;/strong&gt; The &lt;code&gt;send_whatsapp_message&lt;/code&gt; tool doesn't actually send anything in the background yet — it opens a pre-filled WhatsApp Web tab via &lt;code&gt;webbrowser.open()&lt;/code&gt;. Swapping this for a real Twilio or WhatsApp Business API call is next on the list.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Simulated error handling.&lt;/strong&gt; To test the agent's failure guardrails during a database outage, I currently check for a local &lt;code&gt;force_db_fail.flag&lt;/code&gt; file. A real version needs proper HTTP timeout and &lt;code&gt;try/except&lt;/code&gt; handling against a live inventory API.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Links and Demos
&lt;/h2&gt;

&lt;p&gt;The full source code for Dukaan Mitra is on GitHub:&lt;br&gt;
&lt;a href="https://github.com/gauravshinde2162006-hash/Day-1-Get-Your-Voice-Agent-Talking" rel="noopener noreferrer"&gt;Dukaan Mitra Voice Agent Repository&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%2Fgdpbb976k6n1rbr24obf.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%2Fgdpbb976k6n1rbr24obf.png" alt=" " width="800" height="450"&gt;&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%2Fib4k1n6e27mm9w6ay53s.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%2Fib4k1n6e27mm9w6ay53s.png" alt=" " width="800" height="450"&gt;&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%2Fg5xj1jf8grgvuxel90ow.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%2Fg5xj1jf8grgvuxel90ow.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Built as part of 10 Days of Voice Agents — VoiceForBharat Edition, powered by Murf AI.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>murfai</category>
      <category>voiceforbharat</category>
    </item>
    <item>
      <title>Captain Cool: Building an Enterprise Multi-Agent IPL Match Strategist with Google Gemini 🏏🏆</title>
      <dc:creator>Gaurav Shinde</dc:creator>
      <pubDate>Sun, 17 May 2026 12:53:13 +0000</pubDate>
      <link>https://dev.to/gaurav_shinde_7b5a0679994/captain-cool-building-an-enterprise-multi-agent-ipl-match-strategist-with-google-gemini-4h6m</link>
      <guid>https://dev.to/gaurav_shinde_7b5a0679994/captain-cool-building-an-enterprise-multi-agent-ipl-match-strategist-with-google-gemini-4h6m</guid>
      <description>&lt;p&gt;🌟 Introduction: The High-Stakes World of T20 Cricket&lt;br&gt;
In the ultra-competitive arena of the Indian Premier League (IPL), matches are won and lost in the margins. A single tactical miscalculation—bowling a spinner in the death overs against a power-hitter, misplacing a fielder at cow corner, or misjudging the heavy dew factor—can alter the fate of a championship.&lt;/p&gt;

&lt;p&gt;While modern IPL franchises employ armies of data analysts, real-time tactical decision-making in the dugout remains incredibly stressful. Captains must synthesize vast amounts of historical data, pitch conditions, and gut instinct in seconds.&lt;/p&gt;

&lt;p&gt;To solve this, we built Captain Cool—an enterprise-grade, virtual IPL captain powered by a multi-agent Google Gemini AI think-tank. Designed for the Google Build with AI Hackathon (#gdgcloudpune), Captain Cool simulates an elite dugout debate in real-time to deliver the ultimate tactical call.&lt;/p&gt;

&lt;p&gt;🧠 The Core Innovation: Multi-Agent Debate Loop&lt;br&gt;
Single-prompt LLMs often suffer from "sycophancy"—they agree with whatever parameters the user inputs without challenging underlying assumptions. In cricket strategy, blind agreement is a recipe for disaster.&lt;/p&gt;

&lt;p&gt;To build a robust tactical engine, Captain Cool implements an advanced Multi-Agent Debate Architecture using four autonomous Gemini 3.1 Flash Lite agents orchestrated via a sequential LangChain-style debate loop:&lt;/p&gt;

&lt;p&gt;[ Live Cricbuzz Scraper / Form Input ]&lt;br&gt;
                 │&lt;br&gt;
                 ▼&lt;br&gt;
 📊 Agent 1: Stats Analyst (Tool Calling)&lt;br&gt;
                 │&lt;br&gt;
                 ▼&lt;br&gt;
 🎯 Agent 2: Strategist (Initial Call)&lt;br&gt;
                 │&lt;br&gt;
                 ▼&lt;br&gt;
 ⚔️ Agent 3: Devil's Advocate (Dissent &amp;amp; Challenge)&lt;br&gt;
                 │&lt;br&gt;
                 ▼&lt;br&gt;
 💪 Agent 2: Strategist (Revised Defense)&lt;br&gt;
                 │&lt;br&gt;
                 ▼&lt;br&gt;
 🎙️ Agent 4: Match Commentator (Final Verdict &amp;amp; Confidence %)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;📊 The Stats Analyst (Tool-Calling Head)
Acting as the head of data intelligence, this agent is equipped with custom JavaScript tools to fetch real-time match context:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;getWinProbability(): Calculates dynamic win percentages based on target, balls remaining, and wickets.&lt;br&gt;
getPlayerProfile(): Pulls elite batting/bowling stats (strike rates, death over economy, weakness against spin/pace).&lt;br&gt;
getPitchAssessment(): Evaluates venue history (Wankhede dew, Chepauk turn) and current phase dynamics.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;🎯 The Strategist (Tactical Captain)&lt;br&gt;
Taking the data report from the Stats Analyst, the Strategist formulates the initial over-by-over plan, selecting the ideal bowler, field placements, and bowling lines.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;⚔️ The Devil’s Advocate (Opposition Analyst)&lt;br&gt;
This is where the magic happens. The Devil's Advocate is strictly instructed to act as the opposition head coach. It inspects the Strategist's plan, identifies glaring tactical blind spots (e.g., "You're bowling Bumrah now, but who bowls the 20th over?" or "Kohli loves stepping out to spin, your mid-off is too deep"), and aggressively challenges the captain.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🎙️ The Match Commentator (Broadcast Verdict)&lt;br&gt;
Finally, the Commentator observes the debate, synthesizes the opposing viewpoints, and delivers an official broadcast-quality verdict complete with a calculated Tactical Confidence Percentage.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;🚀 Key Technical Features&lt;br&gt;
🔴 1. Automated Live Cricbuzz Web Scraper&lt;br&gt;
To ensure the AI operates on absolute real-time data, we built a native Node.js web scraper directly into the Stats Analyst agent.&lt;/p&gt;

&lt;p&gt;How it works: When a user pastes a live Cricbuzz match URL, the backend instantly fetches the live HTML, strips out all DOM overhead, extracts the pure live scorecard and commentary text (up to 15KB), and injects it into Gemini's context window.&lt;br&gt;
Absolute Truth: The AI is instructed to treat this scraped live Cricbuzz data as the primary source of truth, overriding any conflicting manual form inputs.&lt;br&gt;
📍 2. Interactive 2D/3D Fielding Oval&lt;br&gt;
Field placements are critical to T20 bowling plans. We implemented a custom, interactive top-down cricket ground UI directly in the command console.&lt;/p&gt;

&lt;p&gt;Users can click anywhere on the grass to place up to 9 fielders.&lt;br&gt;
Using advanced polar coordinate math, the frontend instantly calculates the exact cricket position clicked (e.g., Deep Point, Slips / Gully, Cow Corner, Short Fine Leg).&lt;br&gt;
This exact fielding list is fed into the AI prompts, allowing the agents to analyze physical field gaps and suggest bowling lines to match!&lt;br&gt;
🌌 3. Cinematic 3D Enterprise UI (Vercel/Apple Inspired)&lt;br&gt;
We elevated the application from a standard dashboard into an immersive, executive-grade sports broadcast platform:&lt;/p&gt;

&lt;p&gt;Photorealistic Championship Trophy: Replaced cartoon emojis with a hyper-realistic 3D golden championship trophy cup rendered with professional studio lighting.&lt;br&gt;
3D Mouse Parallax: As users move their cursor across the screen, background glassmorphism stat cards (⚡ REQ RATE: 12.5 RPO, 🎯 MATCHUP INTEL) and geometric rings shift at varying speeds, creating a stunning illusion of multi-layered depth.&lt;br&gt;
Auto-Scroll Choreography: Clicking Analyze &amp;amp; Decide ignites a glowing neon progress bar and smoothly auto-scrolls down into the Live Debate Arena, spotlighting each agent card as it slides up with 3D tilt effects.&lt;br&gt;
🛠️ Tech Stack &amp;amp; Architecture&lt;br&gt;
AI Engine: Google Gemini 3.1 Flash Lite (via @google/genai SDK)&lt;br&gt;
Backend: Node.js, Express.js, native fetch HTML scraping&lt;br&gt;
Frontend: HTML5, Vanilla JavaScript, CSS3 (Glassmorphism, 3D Perspective Transforms, CSS Grid/Flexbox)&lt;br&gt;
Version Control: Git &amp;amp; GitHub&lt;br&gt;
🏆 Conclusion &amp;amp; Hackathon Journey&lt;br&gt;
Building Captain Cool for the Google Build with AI Hackathon (#gdgcloudpune) was an incredible journey in exploring the power of agentic workflows. By combining tool-calling, multi-agent debate, live web scraping, and premium 3D UI design, we demonstrated how Gemini can transform complex sports analytics into an engaging, real-time decision-making platform.&lt;/p&gt;

&lt;p&gt;🔗 Check out the Project:&lt;br&gt;
GitHub Repository: &lt;a href="https://github.com/gauravshinde2162006-hash/Captain-cool" rel="noopener noreferrer"&gt;https://github.com/gauravshinde2162006-hash/Captain-cool&lt;/a&gt;&lt;br&gt;
We would love to hear your thoughts, feedback, and tactical ideas in the comments below! 👇&lt;/p&gt;

&lt;p&gt;Built with ❤️ for #gdgcloudpune&lt;/p&gt;

</description>
      <category>devto</category>
    </item>
  </channel>
</rss>
