<?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: Rishabh Kumar</title>
    <description>The latest articles on DEV Community by Rishabh Kumar (@rishabh_dev).</description>
    <link>https://dev.to/rishabh_dev</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%2F4079254%2F34a9b203-5122-4729-8ca6-690e3365b012.png</url>
      <title>DEV Community: Rishabh Kumar</title>
      <link>https://dev.to/rishabh_dev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rishabh_dev"/>
    <language>en</language>
    <item>
      <title>Building KisanMitra AI: A Full-Stack Voice Agent for Indian Farmers 🌾🎙️</title>
      <dc:creator>Rishabh Kumar</dc:creator>
      <pubDate>Sat, 15 Aug 2026 17:00:11 +0000</pubDate>
      <link>https://dev.to/rishabh_dev/-building-kisanmitra-ai-empowering-indian-farmers-with-a-full-stack-voice-agent-15f</link>
      <guid>https://dev.to/rishabh_dev/-building-kisanmitra-ai-empowering-indian-farmers-with-a-full-stack-voice-agent-15f</guid>
      <description>&lt;p&gt;&lt;em&gt;Day 10 of the **10 Days of Voice Agents – VoiceForBharat Edition&lt;/em&gt;* Challenge | Farm &amp;amp; Field Track*&lt;/p&gt;

&lt;p&gt;Imagine holding a smartphone in the middle of a mustard field in rural India.&lt;/p&gt;

&lt;p&gt;Your hands are covered in soil. The sun makes the screen difficult to read. You need an answer about your crop, weather, or mandi prices — but typing a long query or navigating through complicated portals isn't practical.&lt;/p&gt;

&lt;p&gt;Now imagine simply pressing a button and saying:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"भैया, कल बारिश होगी क्या? और धान में भूरा धब्बा रोग लगा है, क्या करें?"&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Instead of searching through menus, you can simply talk.&lt;/p&gt;

&lt;p&gt;That's the idea behind &lt;strong&gt;KisanMitra AI (किसान मित्र AI)&lt;/strong&gt; — a full-stack, real-time bilingual voice agent designed specifically around agricultural assistance.&lt;/p&gt;

&lt;p&gt;The project combines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🎙️ &lt;strong&gt;Murf Falcon TTS&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;⚡ &lt;strong&gt;LiveKit Agents&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;📝 &lt;strong&gt;Deepgram STT&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;🧠 &lt;strong&gt;Google Gemini&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;🌐 &lt;strong&gt;Next.js 15&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;🗄️ &lt;strong&gt;SQLite&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;📞 &lt;strong&gt;SIP-based calling&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;🚨 &lt;strong&gt;Human escalation&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;🤝 &lt;strong&gt;Specialist agent handoff&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This article is the complete story of how I built KisanMitra AI during the &lt;strong&gt;10 Days of Voice Agents – VoiceForBharat Edition&lt;/strong&gt; challenge.&lt;/p&gt;




&lt;h1&gt;
  
  
  🇮🇳 1. Why Voice for Indian Farmers?
&lt;/h1&gt;

&lt;p&gt;Voice assistants are often treated as convenience tools.&lt;/p&gt;

&lt;p&gt;But in agriculture, voice can solve a much more practical problem: &lt;strong&gt;accessibility&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Farmers may be working outdoors, using their hands, dealing with sunlight, speaking in Hindi or regional languages, and needing information quickly.&lt;/p&gt;

&lt;p&gt;The interaction shouldn't look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Open App
   ↓
Find Menu
   ↓
Select Category
   ↓
Fill Form
   ↓
Type Question
   ↓
Wait for Result
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It should feel more like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;👨‍🌾 Farmer
    ↓
🎙️ "मेरी फसल में ये समस्या हो रही है..."
    ↓
🤖 KisanMitra AI
    ↓
🔊 Natural Voice Response
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the &lt;strong&gt;Farm &amp;amp; Field track&lt;/strong&gt;, my objective was simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Make agricultural assistance as conversational and accessible as possible.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  🏗️ 2. End-to-End System Architecture
&lt;/h1&gt;

&lt;p&gt;KisanMitra AI connects a real-time voice pipeline with AI reasoning, tools, memory, analytics, telephony and human escalation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                         👨‍🌾 FARMER
                             │
                 ┌───────────┴───────────┐
                 │                       │
          🌐 Web Browser            📞 Phone / SIP
                 │                       │
                 └───────────┬───────────┘
                             ▼
                       ⚡ LIVEKIT
                    Real-Time Audio
                             │
                             ▼
                    🎙️ Silero VAD
                  Turn Detection
                             │
                             ▼
                    📝 Deepgram STT
                    Hindi / Hinglish
                             │
                             ▼
                   🧠 KISANMITRA AGENT
                             │
                ┌────────────┼────────────┐
                ▼            ▼            ▼
             Gemini       Memory        Tools
                │            │            │
                │            ▼            ├── Weather
                │         SQLite           ├── Farmer Profile
                │                           └── Escalation
                │
                ▼
             Decision
                │
        ┌───────┴────────┐
        ▼                ▼
   Normal Answer    Complex Problem
        │                │
        │                ▼
        │          🌾 FASAL DOCTOR
        │          Specialist Agent
        │
        └────────┬───────────────┘
                 ▼
            🔊 MURF FALCON
             Text-to-Speech
                 │
                 ▼
              LIVEKIT
                 │
                 ▼
           👨‍🌾 FARMER HEARS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The architecture and integration layers are based on the project structure documented during the build.&lt;/p&gt;




&lt;h1&gt;
  
  
  🔄 3. How a Voice Conversation Works
&lt;/h1&gt;

&lt;p&gt;Let's follow one conversation from beginning to end.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1 — Farmer speaks
&lt;/h3&gt;

&lt;p&gt;The farmer speaks through the browser microphone or a supported phone/SIP connection.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2 — LiveKit transports audio
&lt;/h3&gt;

&lt;p&gt;LiveKit handles the real-time audio communication.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3 — Voice Activity Detection
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Silero VAD&lt;/strong&gt; detects when the farmer starts and stops speaking.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4 — Speech-to-Text
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Deepgram Nova-3 STT&lt;/strong&gt; converts the audio into text.&lt;/p&gt;

&lt;p&gt;It is designed to handle Hindi/Hinglish conversations and code-switching.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"सरसों का Mandi Bhav क्या है?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Step 5 — Gemini processes the request
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Google Gemini&lt;/strong&gt; receives the transcript and relevant context.&lt;/p&gt;

&lt;p&gt;The agent decides whether it needs to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Answer directly&lt;/li&gt;
&lt;li&gt;Access memory&lt;/li&gt;
&lt;li&gt;Call a tool&lt;/li&gt;
&lt;li&gt;Escalate the issue&lt;/li&gt;
&lt;li&gt;Hand the conversation to a specialist&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 6 — Murf Falcon generates the voice
&lt;/h3&gt;

&lt;p&gt;The generated response is sent to &lt;strong&gt;Murf Falcon TTS&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The response is then streamed back as audio.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 7 — Farmer hears the response
&lt;/h3&gt;

&lt;p&gt;The audio travels through LiveKit back to the user.&lt;/p&gt;

&lt;p&gt;So the complete pipeline is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;🎙️ Speech
   ↓
LiveKit
   ↓
Silero VAD
   ↓
Deepgram STT
   ↓
Google Gemini
   ↓
Tools / Memory
   ↓
Murf Falcon
   ↓
LiveKit
   ↓
🔊 Speech
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  ⚡ 4. Why Low Latency Matters
&lt;/h1&gt;

&lt;p&gt;Voice conversations feel very different from text conversations.&lt;/p&gt;

&lt;p&gt;If an AI takes several seconds before responding, users may think:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Call cut gaya kya?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's why latency became an important part of this project.&lt;/p&gt;

&lt;p&gt;With streaming TTS, the project targeted approximately &lt;strong&gt;114–135 ms TTFB&lt;/strong&gt; for the Murf Falcon voice layer in the tested setup.&lt;/p&gt;

&lt;p&gt;The goal was to make the response feel immediate rather than waiting for the entire response to be generated first.&lt;/p&gt;




&lt;h1&gt;
  
  
  🎨 5. Building the Frontend
&lt;/h1&gt;

&lt;p&gt;I didn't want KisanMitra AI to look like a basic chatbot.&lt;/p&gt;

&lt;p&gt;I built a custom &lt;strong&gt;Next.js 15 + Tailwind CSS + shadcn/ui&lt;/strong&gt; interface with an agriculture-inspired emerald/green theme.&lt;/p&gt;

&lt;h2&gt;
  
  
  🌿 Main UI Features
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Glassmorphism
&lt;/h3&gt;

&lt;p&gt;Frosted glass cards and layered panels give the interface a modern look.&lt;/p&gt;

&lt;h3&gt;
  
  
  🎙️ Listening State
&lt;/h3&gt;

&lt;p&gt;The UI visually indicates when the agent is listening.&lt;/p&gt;

&lt;h3&gt;
  
  
  🌱 Thinking State
&lt;/h3&gt;

&lt;p&gt;A separate state indicates that the AI is processing the request.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔊 Speaking State
&lt;/h3&gt;

&lt;p&gt;Audio visualizations show when the agent is responding.&lt;/p&gt;

&lt;h3&gt;
  
  
  💬 Live Transcript
&lt;/h3&gt;

&lt;p&gt;The user can see the conversation while speaking with the agent.&lt;/p&gt;




&lt;h1&gt;
  
  
  📦 6. Six Agricultural Modules
&lt;/h1&gt;

&lt;p&gt;The main dashboard contains six smart agricultural modules.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Module&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;⛅ &lt;strong&gt;Weather Forecast&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Weather, rain and temperature information&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🌱 &lt;strong&gt;Crop Advisory&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Crop and farming guidance&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;📈 &lt;strong&gt;Mandi Bhav&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Market-related information&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🐛 &lt;strong&gt;Disease Control&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Crop disease and pest assistance&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🐄 &lt;strong&gt;Livestock Care&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Animal and dairy-related assistance&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🏛️ &lt;strong&gt;Government Schemes&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Agricultural scheme information&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Example voice prompts:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"क्या कल मेरे खेत में बारिश होगी?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"गेहूं की पहली सिंचाई कब करनी चाहिए?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"धान की पत्तियों में धब्बे आ गए हैं, क्या करूं?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"आज मंडी में सरसों का भाव क्या है?"&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;These modules are part of the frontend experience documented in the project.&lt;/p&gt;




&lt;h1&gt;
  
  
  🚀 7. The 9-Day Technical Journey
&lt;/h1&gt;

&lt;p&gt;KisanMitra AI wasn't built in one day.&lt;/p&gt;

&lt;p&gt;It evolved throughout the challenge.&lt;/p&gt;

&lt;h2&gt;
  
  
  Day 1 — Give the Agent a Voice 🎙️
&lt;/h2&gt;

&lt;p&gt;The first step was creating the basic real-time voice agent.&lt;/p&gt;

&lt;p&gt;I connected the voice pipeline and integrated &lt;strong&gt;Murf Falcon TTS&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This transformed the project from a text-based concept into a conversational assistant.&lt;/p&gt;




&lt;h2&gt;
  
  
  Day 2 — Build the User Interface 🎨
&lt;/h2&gt;

&lt;p&gt;I moved beyond the backend and created a proper frontend.&lt;/p&gt;

&lt;p&gt;The goal was to give users a simple way to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Start a conversation&lt;/li&gt;
&lt;li&gt;See the agent state&lt;/li&gt;
&lt;li&gt;View transcripts&lt;/li&gt;
&lt;li&gt;Interact with agricultural modules&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Day 3 — Add Memory 🧠
&lt;/h2&gt;

&lt;p&gt;A useful assistant shouldn't forget everything after every call.&lt;/p&gt;

&lt;p&gt;I introduced persistent storage using SQLite so that useful farmer information and interaction data could be retained.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User
 ├── Name
 ├── Language
 ├── District
 ├── Crop
 └── Previous Interaction
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Day 4 — Connect Real-World Tools 🔧
&lt;/h2&gt;

&lt;p&gt;The agent needed access to information outside the LLM.&lt;/p&gt;

&lt;p&gt;I added domain tools that allow KisanMitra AI to perform actions such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Farmer profile lookup&lt;/li&gt;
&lt;li&gt;Profile updates&lt;/li&gt;
&lt;li&gt;Weather lookup&lt;/li&gt;
&lt;li&gt;Escalation&lt;/li&gt;
&lt;li&gt;Call status logging&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The core tools are documented around the &lt;code&gt;FarmerTools&lt;/code&gt; layer in the project.&lt;/p&gt;




&lt;h2&gt;
  
  
  Day 5 — Make the Agent Proactive 📞
&lt;/h2&gt;

&lt;p&gt;Instead of always waiting for a farmer to start a conversation, I explored outbound SIP calling.&lt;/p&gt;

&lt;p&gt;This opens the possibility of proactive alerts.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Weather API
     ↓
Severe Weather Detected
     ↓
KisanMitra AI
     ↓
📞 Outbound Voice Call
     ↓
👨‍🌾 Farmer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Day 6 — Human Escalation 🚨
&lt;/h2&gt;

&lt;p&gt;AI shouldn't pretend to know everything.&lt;/p&gt;

&lt;p&gt;For complex or serious cases, KisanMitra AI can escalate the issue.&lt;/p&gt;

&lt;p&gt;The system can create a unique reference such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;KISAN-7842
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and send the relevant escalation information through a Discord webhook.&lt;/p&gt;

&lt;p&gt;This creates a human-in-the-loop workflow.&lt;/p&gt;




&lt;h2&gt;
  
  
  Day 7 — Analytics Dashboard 📊
&lt;/h2&gt;

&lt;p&gt;Once the agent could handle conversations, I needed to understand how it was performing.&lt;/p&gt;

&lt;p&gt;So I built an analytics dashboard using:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Next.js + SQLite&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The dashboard can track:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Total calls&lt;/li&gt;
&lt;li&gt;Successful calls&lt;/li&gt;
&lt;li&gt;Failed calls&lt;/li&gt;
&lt;li&gt;Call logs&lt;/li&gt;
&lt;li&gt;Session information&lt;/li&gt;
&lt;li&gt;Conversation data&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Day 8 — Specialist Agent Handoff 🤝
&lt;/h2&gt;

&lt;p&gt;One of the most interesting additions was the &lt;strong&gt;Fasal Doctor&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Instead of forcing one agent to handle every agricultural problem:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                    KisanMitra AI
                         │
             ┌───────────┴───────────┐
             │                       │
       General Query          Complex Crop Issue
             │                       │
             ▼                       ▼
         Response              🌾 Fasal Doctor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The specialist-agent concept allows complex crop-related conversations to be routed to a dedicated agent.&lt;/p&gt;




&lt;h2&gt;
  
  
  Day 9 — Bring Everything Together 🚀
&lt;/h2&gt;

&lt;p&gt;By this stage, KisanMitra AI combined:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Voice + Memory + Tools + Calling + Human Escalation + Analytics + Specialist Handoff&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The project had evolved from a basic voice assistant into a much more complete voice-agent architecture.&lt;/p&gt;




&lt;h1&gt;
  
  
  📂 8. Project Folder Structure
&lt;/h1&gt;

&lt;p&gt;The project follows a monorepo-style structure separating the Python voice-agent backend from the Next.js frontend.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;murf-livekit-starter/
│
├── backend/
│   ├── src/
│   │   ├── agent.py
│   │   └── db.py
│   │
│   ├── tests/
│   │   ├── test_agent.py
│   │   ├── test_day5.py
│   │   └── test_day8.py
│   │
│   ├── .env.example
│   ├── .env.local
│   ├── pyproject.toml
│   └── kisan_mitra.db
│
├── frontend/
│   ├── app/
│   │   ├── api/
│   │   │   ├── token/
│   │   │   │   └── route.ts
│   │   │   └── analytics/
│   │   │       └── route.ts
│   │   │
│   │   ├── dashboard/
│   │   │   └── page.tsx
│   │   │
│   │   ├── layout.tsx
│   │   ├── page.tsx
│   │   └── globals.css
│   │
│   ├── components/
│   │   ├── app/
│   │   ├── agents-ui/
│   │   └── ui/
│   │
│   ├── app-config.ts
│   ├── package.json
│   └── .env.local
│
├── start_app.sh
├── start_app.ps1
├── AGENTS.md
├── README.md
└── BLOG_DEV_COMMUNITY.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This structure follows the backend/frontend separation documented in the source project.&lt;/p&gt;




&lt;h1&gt;
  
  
  🧠 9. Important Backend Components
&lt;/h1&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;backend/src/agent.py&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;This is the core of the voice agent.&lt;/p&gt;

&lt;p&gt;It connects:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;STT
 ↓
LLM
 ↓
Tools
 ↓
TTS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It also contains the agent instructions and farmer-specific tools.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;code&gt;backend/src/db.py&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;This manages SQLite persistence.&lt;/p&gt;

&lt;p&gt;The project uses tables such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;users
call_logs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;users&lt;/code&gt; table can store useful profile information, while &lt;code&gt;call_logs&lt;/code&gt; stores session-related information.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;code&gt;frontend/app/api/token/route.ts&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;This API route generates LiveKit access tokens and handles agent dispatch configuration.&lt;/p&gt;

&lt;p&gt;This is important because the frontend needs a secure way to establish a LiveKit session.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;code&gt;frontend/app/dashboard/page.tsx&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;This page provides the analytics dashboard.&lt;/p&gt;

&lt;p&gt;It displays information such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Total calls&lt;/li&gt;
&lt;li&gt;Success rate&lt;/li&gt;
&lt;li&gt;Active sessions&lt;/li&gt;
&lt;li&gt;Call logs&lt;/li&gt;
&lt;li&gt;Transcripts&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🚧 10. The Developer Struggles
&lt;/h1&gt;

&lt;p&gt;No real project is complete without debugging.&lt;/p&gt;

&lt;p&gt;These were two of my biggest lessons.&lt;/p&gt;




&lt;h2&gt;
  
  
  💥 Struggle #1 — The Silent Agent
&lt;/h2&gt;

&lt;p&gt;On Day 1, everything appeared to be running.&lt;/p&gt;

&lt;p&gt;The backend was active.&lt;/p&gt;

&lt;p&gt;The frontend connected.&lt;/p&gt;

&lt;p&gt;The microphone worked.&lt;/p&gt;

&lt;p&gt;But the agent was completely silent.&lt;/p&gt;

&lt;p&gt;After hours of debugging, I found the issue.&lt;/p&gt;

&lt;p&gt;My &lt;code&gt;.env.local&lt;/code&gt; contained:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ❌ Wrong
AGENT_NAME=
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent name was empty.&lt;/p&gt;

&lt;p&gt;I changed it to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ✅ Fixed
AGENT_NAME=my-agent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that, the correct agent dispatch was triggered and the voice agent finally started speaking.&lt;/p&gt;

&lt;h3&gt;
  
  
  Lesson learned:
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Always check environment variables before assuming the entire voice pipeline is broken.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The project documentation specifically identifies explicit agent routing through &lt;code&gt;AGENT_NAME&lt;/code&gt; as part of the LiveKit token/dispatch setup.&lt;/p&gt;




&lt;h1&gt;
  
  
  💥 Struggle #2 — The Beautiful but Useless Mic Button 😅
&lt;/h1&gt;

&lt;p&gt;I created a beautiful animated microphone button.&lt;/p&gt;

&lt;p&gt;It looked amazing.&lt;/p&gt;

&lt;p&gt;But when I clicked it...&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Nothing happened.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The problem?&lt;/p&gt;

&lt;p&gt;I had designed the UI but hadn't connected the button to the actual LiveKit session lifecycle.&lt;/p&gt;

&lt;p&gt;The fix was connecting it with &lt;code&gt;useSessionContext()&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useSessionContext&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@livekit/components-react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;ActiveMicButton&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;session&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useSessionContext&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleToggle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;connected&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleToggle&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      Start Conversation
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once connected to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the button actually started the voice session.&lt;/p&gt;

&lt;h3&gt;
  
  
  Lesson learned:
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;A beautiful UI is useless if it isn't connected to the actual application logic.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  🛠️ 11. How You Can Build Your Own Voice Agent
&lt;/h1&gt;

&lt;p&gt;If you're new to voice AI, start with four major components.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌──────────────┐
│     STT      │
│  Deepgram    │
└──────┬───────┘
       ↓
┌──────────────┐
│     LLM      │
│ Gemini / GPT │
└──────┬───────┘
       ↓
┌──────────────┐
│     TTS      │
│ Murf Falcon  │
└──────┬───────┘
       ↓
┌──────────────┐
│  LiveKit     │
│  WebRTC      │
└──────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  1. Speech-to-Text
&lt;/h3&gt;

&lt;p&gt;Convert the user's voice into text.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; Deepgram&lt;/p&gt;

&lt;h3&gt;
  
  
  2. LLM
&lt;/h3&gt;

&lt;p&gt;The brain of the agent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; Google Gemini&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Text-to-Speech
&lt;/h3&gt;

&lt;p&gt;Convert the generated answer back into speech.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; Murf Falcon&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Real-Time Transport
&lt;/h3&gt;

&lt;p&gt;Move audio between the user and agent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; LiveKit&lt;/p&gt;

&lt;p&gt;The project uses this four-part STT → LLM → TTS → real-time transport architecture.&lt;/p&gt;




&lt;h1&gt;
  
  
  🔐 12. Security: Don't Leak Your API Keys
&lt;/h1&gt;

&lt;p&gt;This is extremely important when building AI applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Never commit:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.env
.env.local
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to GitHub.&lt;/p&gt;

&lt;p&gt;Instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.env.example
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;should contain only the required variable names.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MURF_API_KEY=
LIVEKIT_API_KEY=
LIVEKIT_API_SECRET=
DEEPGRAM_API_KEY=
GOOGLE_API_KEY=
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the real values should remain in your local environment.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🚨 &lt;strong&gt;Never publish real API keys in a public GitHub repository.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  🔮 13. What's Next for KisanMitra AI?
&lt;/h1&gt;

&lt;p&gt;KisanMitra AI is only the beginning.&lt;/p&gt;

&lt;h2&gt;
  
  
  📱 WhatsApp Voice Notes
&lt;/h2&gt;

&lt;p&gt;The next step is making the assistant accessible through WhatsApp voice messages.&lt;/p&gt;

&lt;p&gt;A farmer could simply send:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🎙️ Voice Note&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;and receive:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🔊 Voice Answer&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🗣️ Regional Indian Languages
&lt;/h2&gt;

&lt;p&gt;I want to expand beyond Hindi/Hinglish into languages and dialects such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bhojpuri&lt;/li&gt;
&lt;li&gt;Maithili&lt;/li&gt;
&lt;li&gt;Haryanvi&lt;/li&gt;
&lt;li&gt;Bundelkhandi&lt;/li&gt;
&lt;li&gt;Marathi&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The long-term goal is to make voice AI feel natural across different parts of India.&lt;/p&gt;




&lt;h2&gt;
  
  
  📸 Multimodal Crop Diagnosis
&lt;/h2&gt;

&lt;p&gt;Imagine combining:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;📸 Crop Image
     +
🎙️ Farmer's Voice
     +
🧠 AI
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A farmer could show an infected leaf while explaining the symptoms verbally.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛰️ Smarter Agricultural Data
&lt;/h2&gt;

&lt;p&gt;Another future direction is integrating richer agricultural and environmental data sources to make recommendations more context-aware.&lt;/p&gt;




&lt;h1&gt;
  
  
  📚 14. What I Learned From This Challenge
&lt;/h1&gt;

&lt;p&gt;The biggest lesson from these 10 days is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Building a voice agent is much more than connecting an LLM to a microphone.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A useful voice agent needs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🎙️ Natural voice interaction&lt;/li&gt;
&lt;li&gt;🧠 Memory&lt;/li&gt;
&lt;li&gt;🔧 Real-world tools&lt;/li&gt;
&lt;li&gt;📞 Communication capabilities&lt;/li&gt;
&lt;li&gt;🚨 Human fallback&lt;/li&gt;
&lt;li&gt;📊 Analytics&lt;/li&gt;
&lt;li&gt;🤝 Specialist agents&lt;/li&gt;
&lt;li&gt;🎨 Good UX&lt;/li&gt;
&lt;li&gt;🔐 Secure configuration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But above everything else:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;It needs to solve a real problem.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For KisanMitra AI, that problem is making agricultural assistance easier to access through voice.&lt;/p&gt;




&lt;h1&gt;
  
  
  🔗 15. Project Links
&lt;/h1&gt;

&lt;h3&gt;
  
  
  💻 GitHub Repository
&lt;/h3&gt;

&lt;p&gt;👉 &lt;strong&gt;[PASTE YOUR ACTUAL GITHUB LINK HERE]&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  🌐 Live Demo
&lt;/h3&gt;

&lt;p&gt;👉 &lt;strong&gt;[PASTE YOUR ACTUAL LIVE DEMO LINK HERE]&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  🎥 Demo Video
&lt;/h3&gt;

&lt;p&gt;👉 &lt;strong&gt;[PASTE YOUR YOUTUBE / LOOM VIDEO LINK HERE]&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't forget to replace all three placeholders before publishing.&lt;/strong&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  🙏 16. Final Thoughts
&lt;/h1&gt;

&lt;p&gt;Building KisanMitra AI has been one of my most rewarding experiences with voice AI.&lt;/p&gt;

&lt;p&gt;In these 10 days, I went from a basic voice interaction to building a system combining:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🎙️ Voice&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;↓&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🧠 Memory&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;↓&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔧 Tools&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;↓&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;📞 Outbound Calls&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;↓&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🚨 Human Escalation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;↓&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;📊 Analytics&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;↓&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🤝 Specialist Agent Handoff&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This challenge taught me that the most exciting part of AI isn't just making models smarter.&lt;/p&gt;

&lt;p&gt;It's making technology &lt;strong&gt;easier for people to use&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For a farmer, technology shouldn't feel complicated.&lt;/p&gt;

&lt;p&gt;Sometimes the best interface is simply:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"भैया, मेरी फसल में ये समस्या हो रही है..."&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And the AI should be ready to listen.&lt;/p&gt;

&lt;p&gt;🌾 &lt;strong&gt;That's the idea behind KisanMitra AI.&lt;/strong&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  ❤️ Special Thanks
&lt;/h1&gt;

&lt;p&gt;A huge thank you to &lt;strong&gt;Murf AI&lt;/strong&gt; and &lt;strong&gt;LiveKit&lt;/strong&gt; for organizing the &lt;strong&gt;10 Days of Voice Agents – VoiceForBharat Edition&lt;/strong&gt; challenge.&lt;/p&gt;

&lt;p&gt;The challenge gave me an opportunity to learn, experiment, break things, debug them, and build a voice AI system around a real-world Indian use case.&lt;/p&gt;

&lt;p&gt;If you're also building with voice AI, I'd love to hear what you're creating.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What kind of voice agent are you building?&lt;/strong&gt; 👇&lt;/p&gt;

&lt;p&gt;Let's connect and build the future of voice AI together.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;#10DaysofAIVoiceAgents #MurfFalcon #VoiceForBharat #VoiceAI #AI #GenerativeAI #IndianAI #Agriculture #KisanMitraAI #LiveKit&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>agriculture</category>
      <category>ai</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
