<?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: Shreya Patel</title>
    <description>The latest articles on DEV Community by Shreya Patel (@shreya_patel_02).</description>
    <link>https://dev.to/shreya_patel_02</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%2F3478261%2F8e9c15a1-458e-46a3-b81f-2d3933abcd93.png</url>
      <title>DEV Community: Shreya Patel</title>
      <link>https://dev.to/shreya_patel_02</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shreya_patel_02"/>
    <language>en</language>
    <item>
      <title>KRISHI MITRA AI</title>
      <dc:creator>Shreya Patel</dc:creator>
      <pubDate>Sat, 15 Aug 2026 12:01:52 +0000</pubDate>
      <link>https://dev.to/shreya_patel_02/krishi-mitra-ai-j74</link>
      <guid>https://dev.to/shreya_patel_02/krishi-mitra-ai-j74</guid>
      <description>&lt;h1&gt;
  
  
  🌾 KrishiMitra AI: Building a Voice AI Assistant for Smarter Farming
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;From a simple voice assistant to a multilingual farming companion with tools, memory, outbound calls, human escalation, analytics, and specialist handoffs.&lt;/p&gt;
&lt;/blockquote&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 I built and continuously improved my own voice AI project: &lt;strong&gt;KrishiMitra AI&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;My project belongs to the &lt;strong&gt;Farm &amp;amp; Field&lt;/strong&gt; track and is designed to help farmers access useful agricultural information through a simple voice conversation.&lt;/p&gt;

&lt;p&gt;The idea was simple:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What if a farmer could just speak to an AI assistant instead of navigating complicated applications or typing long questions?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That question became the starting point for KrishiMitra AI.&lt;/p&gt;




&lt;h2&gt;
  
  
  🌱 What is KrishiMitra AI?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;KrishiMitra AI&lt;/strong&gt; is a voice-first agricultural assistant designed to help farmers with everyday farming-related questions.&lt;/p&gt;

&lt;p&gt;Instead of requiring a farmer to type a query, the user can simply speak naturally.&lt;/p&gt;

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

&lt;blockquote&gt;
&lt;p&gt;"Meri soybean ki leaves yellow ho rahi hain."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;or:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"What will the weather be like today?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;KrishiMitra AI can understand the request, process it, and respond through voice.&lt;/p&gt;

&lt;p&gt;The project focuses on making AI assistance more accessible, especially for users who may be more comfortable speaking than typing.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 Why Farm &amp;amp; Field?
&lt;/h2&gt;

&lt;p&gt;Agriculture involves many decisions that depend on timely information.&lt;/p&gt;

&lt;p&gt;Farmers may need help with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Crop-related problems&lt;/li&gt;
&lt;li&gt;Weather information&lt;/li&gt;
&lt;li&gt;Irrigation questions&lt;/li&gt;
&lt;li&gt;Pest-related issues&lt;/li&gt;
&lt;li&gt;Farming guidance&lt;/li&gt;
&lt;li&gt;Market-related information&lt;/li&gt;
&lt;li&gt;Getting human assistance when AI is not enough&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Voice can make these interactions more natural.&lt;/p&gt;

&lt;p&gt;A farmer doesn't have to open a keyboard and formulate a perfect question.&lt;/p&gt;

&lt;p&gt;They can simply speak.&lt;/p&gt;

&lt;p&gt;That is the experience I wanted KrishiMitra AI to provide.&lt;/p&gt;




&lt;h2&gt;
  
  
  🖥️ The KrishiMitra AI Interface
&lt;/h2&gt;

&lt;p&gt;The frontend was designed around a simple idea:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The user should immediately understand what the agent does and how to start talking to it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The home screen contains the KrishiMitra AI branding, farming categories, a voice interaction button, and options such as Human Help and Analytics.&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%2F72bw2uttnzl9krqodb25.jpeg" 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%2F72bw2uttnzl9krqodb25.jpeg" alt=" " width="800" height="500"&gt;&lt;/a&gt;E&lt;/p&gt;

&lt;p&gt;&lt;code&gt;WhatsApp Image 2026-08-15 at 4.55.43 PM (1).jpeg&lt;/code&gt;&lt;/p&gt;

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

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;KrishiMitra AI home screen&lt;/strong&gt; — The voice-first interface designed for simple and accessible farming assistance.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🎙️ A Voice-First Experience
&lt;/h2&gt;

&lt;p&gt;Once the user starts talking, KrishiMitra AI moves into an active voice conversation.&lt;/p&gt;

&lt;p&gt;The interface clearly shows that the agent is speaking, making the interaction feel more like a real conversation than a traditional chatbot.&lt;/p&gt;

&lt;p&gt;Under the hood, the voice pipeline connects several components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Speech-to-Text&lt;/li&gt;
&lt;li&gt;Large Language Model&lt;/li&gt;
&lt;li&gt;Text-to-Speech&lt;/li&gt;
&lt;li&gt;Real-time communication through LiveKit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The starter architecture uses Deepgram for STT, an LLM for reasoning, Murf Falcon for TTS, and LiveKit for real-time audio transport.&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%2Fq0g5c0z5jqvyq7kwq2cy.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%2Fq0g5c0z5jqvyq7kwq2cy.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Caption:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;KrishiMitra AI in an active voice session&lt;/strong&gt; — The interface shows the agent speaking to the user.&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h1&gt;
  
  
  🧠 How KrishiMitra AI Works
&lt;/h1&gt;

&lt;p&gt;The basic voice flow looks 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;flowchart LR
    A["🎙️ Farmer speaks"] --&amp;gt; B["Deepgram STT"]
    B --&amp;gt; C["LLM / Agent"]
    C --&amp;gt; D["Decision + Tools"]
    D --&amp;gt; E["Murf Falcon TTS"]
    E --&amp;gt; F["🔊 Farmer hears response"]
    F --&amp;gt; A

    C --&amp;gt; G{"Specialist needed?"}
    G --&amp;gt;|No| D
    G --&amp;gt;|Yes| H["🌱 Crop Problem Specialist"]
    H --&amp;gt; E

    C --&amp;gt; I{"Human help needed?"}
    I --&amp;gt;|Yes| J["👩‍🌾 Human Support"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The important part is that KrishiMitra AI isn't just a text chatbot.&lt;/p&gt;

&lt;p&gt;It is a &lt;strong&gt;real-time voice pipeline&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The user speaks → speech is transcribed → the agent understands the request → tools or specialist agents can be used → the response is converted back into speech.&lt;/p&gt;




&lt;h1&gt;
  
  
  🧩 The Main Components
&lt;/h1&gt;

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

&lt;p&gt;The first step is converting the farmer's speech into text.&lt;/p&gt;

&lt;p&gt;For my project, the voice pipeline uses &lt;strong&gt;Deepgram STT&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This allows the agent to understand what the user is saying before the LLM processes the request.&lt;/p&gt;




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

&lt;p&gt;The LLM acts as the reasoning layer.&lt;/p&gt;

&lt;p&gt;It determines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What the user is asking&lt;/li&gt;
&lt;li&gt;Whether a tool is required&lt;/li&gt;
&lt;li&gt;Whether the request needs a specialist&lt;/li&gt;
&lt;li&gt;How the response should be formulated&lt;/li&gt;
&lt;li&gt;When the conversation should be escalated&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is where the main intelligence of the agent lives.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Murf Falcon TTS
&lt;/h2&gt;

&lt;p&gt;The response generated by the LLM needs to become speech again.&lt;/p&gt;

&lt;p&gt;This is where &lt;strong&gt;Murf Falcon&lt;/strong&gt; comes in.&lt;/p&gt;

&lt;p&gt;One of the biggest highlights of this challenge for me was building with &lt;strong&gt;Murf Falcon — the fastest TTS API used in the challenge&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The starter project supports Murf voices including Indian English voices such as Anisha, Pooja, and Samar.&lt;/p&gt;

&lt;p&gt;For a voice-first agricultural assistant, natural and fast speech matters because long pauses can make a conversation feel unnatural.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. LiveKit
&lt;/h2&gt;

&lt;p&gt;LiveKit handles the real-time communication layer between the frontend and the voice agent.&lt;/p&gt;

&lt;p&gt;The frontend and backend communicate through the LiveKit infrastructure rather than directly calling each other.&lt;/p&gt;

&lt;p&gt;This makes it possible to build an interactive browser-based voice experience.&lt;/p&gt;




&lt;h1&gt;
  
  
  🛠️ Features I Built During the Challenge
&lt;/h1&gt;

&lt;p&gt;The 10-day challenge was not just about making an AI speak.&lt;/p&gt;

&lt;p&gt;Each day added another capability to the project.&lt;/p&gt;

&lt;p&gt;Here are some of the important features I worked on.&lt;/p&gt;




&lt;h2&gt;
  
  
  🌾 1. Farming-Focused Personality
&lt;/h2&gt;

&lt;p&gt;Instead of creating a generic assistant, I gave the agent a specific identity:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;KrishiMitra AI — a farming companion.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The agent is designed to be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Helpful&lt;/li&gt;
&lt;li&gt;Simple&lt;/li&gt;
&lt;li&gt;Conversational&lt;/li&gt;
&lt;li&gt;Farmer-friendly&lt;/li&gt;
&lt;li&gt;Clear&lt;/li&gt;
&lt;li&gt;Safety-aware&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal is not to sound like a complicated technical system.&lt;/p&gt;

&lt;p&gt;It should feel like an assistant that a farmer can actually talk to.&lt;/p&gt;




&lt;h1&gt;
  
  
  🌐 2. Multilingual and Hinglish Conversations
&lt;/h1&gt;

&lt;p&gt;Agricultural users may not always communicate in formal English.&lt;/p&gt;

&lt;p&gt;Therefore, KrishiMitra AI supports natural language switching.&lt;/p&gt;

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

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

&lt;blockquote&gt;
&lt;p&gt;"Meri crop mein keede lag gaye hain."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The agent can respond in Hinglish/Hindi.&lt;/p&gt;

&lt;p&gt;If the user switches to English, the agent can respond in English.&lt;/p&gt;

&lt;p&gt;This makes the conversation more natural and accessible.&lt;/p&gt;




&lt;h1&gt;
  
  
  🧠 3. Memory
&lt;/h1&gt;

&lt;p&gt;Another important capability was memory.&lt;/p&gt;

&lt;p&gt;A useful assistant should not behave like it has forgotten everything every time the user returns.&lt;/p&gt;

&lt;p&gt;Memory allows the system to retain useful conversational information and provide a more personalized experience.&lt;/p&gt;

&lt;p&gt;For a farming assistant, this can become especially useful when discussing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Crop type&lt;/li&gt;
&lt;li&gt;Previously discussed problems&lt;/li&gt;
&lt;li&gt;Farming context&lt;/li&gt;
&lt;li&gt;Earlier questions&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🔧 4. Tools
&lt;/h1&gt;

&lt;p&gt;The agent can use tools when information needs to be retrieved or computed instead of simply generating an answer.&lt;/p&gt;

&lt;p&gt;For example, agricultural assistants can use tools for things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Weather information&lt;/li&gt;
&lt;li&gt;Market information&lt;/li&gt;
&lt;li&gt;Farming-related data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This creates an important distinction:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LLM = reasoning&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tool = real-world data&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That combination makes the assistant more useful.&lt;/p&gt;




&lt;h1&gt;
  
  
  📞 5. Outbound Calls
&lt;/h1&gt;

&lt;p&gt;One of the more challenging parts of the journey was working with outbound voice calls.&lt;/p&gt;

&lt;p&gt;The idea was to allow the system to proactively reach users for useful situations such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Weather warnings&lt;/li&gt;
&lt;li&gt;Important agricultural updates&lt;/li&gt;
&lt;li&gt;Price-related alerts&lt;/li&gt;
&lt;li&gt;Other farming notifications&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This introduced another layer of complexity because voice agents now need to interact with telephony infrastructure in addition to the browser.&lt;/p&gt;




&lt;h1&gt;
  
  
  👩‍🌾 6. Human Escalation
&lt;/h1&gt;

&lt;p&gt;AI should not pretend to know everything.&lt;/p&gt;

&lt;p&gt;For serious or uncertain farming problems, KrishiMitra AI can escalate the request to human support.&lt;/p&gt;

&lt;p&gt;I created a Human Help flow where the user can provide:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Name&lt;/li&gt;
&lt;li&gt;Reason for help&lt;/li&gt;
&lt;li&gt;What happened&lt;/li&gt;
&lt;li&gt;Urgency&lt;/li&gt;
&lt;li&gt;Preferred language&lt;/li&gt;
&lt;li&gt;Follow-up method&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The request can then be submitted to the support workflow.&lt;/p&gt;

&lt;h3&gt;
  
  
  📸 IMAGE 4 — INSERT HERE
&lt;/h3&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%2Fb5514xfx3hxryx4efy2k.jpeg" 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%2Fb5514xfx3hxryx4efy2k.jpeg" alt=" " width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Human Help request form&lt;/strong&gt; — Farmers can provide the problem details and choose urgency, language, and follow-up preferences.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  ✅ Human Help Confirmation
&lt;/h2&gt;

&lt;p&gt;After submitting the request, the user receives a confirmation with a reference ID and follow-up information.&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%2F18lohfdw2qz0ab0inqt5.jpeg" 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%2F18lohfdw2qz0ab0inqt5.jpeg" alt=" " width="800" height="500"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Caption:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Human Help confirmation&lt;/strong&gt; — The system generates a reference ID and confirms that the request has been submitted.&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h1&gt;
  
  
  📊 7. Call Analytics Dashboard
&lt;/h1&gt;

&lt;p&gt;Another major feature was the analytics dashboard.&lt;/p&gt;

&lt;p&gt;Instead of only building an agent that talks, I wanted to understand how the agent was performing.&lt;/p&gt;

&lt;p&gt;The dashboard provides metrics such as:&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;Success rate&lt;/li&gt;
&lt;li&gt;Recent call outcomes&lt;/li&gt;
&lt;li&gt;Call duration&lt;/li&gt;
&lt;li&gt;Channel&lt;/li&gt;
&lt;li&gt;Details about the outcome&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, during my testing, the dashboard showed:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4 Total Calls&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2 Successful Calls&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2 Failed Calls&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;50% Success Rate&lt;/strong&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%2Fim0ephrmc61k9i8kmt4e.jpeg" 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%2Fim0ephrmc61k9i8kmt4e.jpeg" alt=" " width="800" height="500"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Caption:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;KrishiMitra AI Call Analytics Dashboard&lt;/strong&gt; — Tracking call outcomes, success rate, duration, and recent conversations.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This was useful because it changed the way I looked at the project.&lt;/p&gt;

&lt;p&gt;I wasn't only asking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Does my agent work?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I was also asking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"How well does my agent work?"&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h1&gt;
  
  
  🔄 8. Specialist Agent Handoff
&lt;/h1&gt;

&lt;p&gt;One of the most interesting features from the final days was &lt;strong&gt;agent handoff&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A single AI agent shouldn't have to be an expert at everything.&lt;/p&gt;

&lt;p&gt;So I created a separate:&lt;/p&gt;
&lt;h2&gt;
  
  
  🌱 Crop Problem Specialist
&lt;/h2&gt;

&lt;p&gt;The main KrishiMitra agent handles general farming requests.&lt;/p&gt;

&lt;p&gt;When a farmer reports a specific crop-health problem, the main agent can transfer the conversation to the specialist.&lt;/p&gt;

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

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

&lt;blockquote&gt;
&lt;p&gt;"Meri soybean ki leaves yellow ho rahi hain."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;KrishiMitra AI:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Samajh gaya. Main aapko Crop Problem Specialist se connect karta hoon."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then the specialist takes over:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Namaste! Aapne soybean ki leaves yellow hone ki baat batayi hai. Ye problem kab se dikh rahi hai?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The important part is that the farmer doesn't need to explain the whole problem again.&lt;/p&gt;

&lt;p&gt;The conversation context is preserved during the handoff. My repository documents the implementation using LiveKit's session agent update mechanism and passing the existing chat context to the specialist.&lt;/p&gt;


&lt;h1&gt;
  
  
  🔀 Specialist Handoff Flow
&lt;/h1&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;flowchart TD
    A["🎙️ Farmer asks a question"] --&amp;gt; B["🌾 KrishiMitra Main Agent"]

    B --&amp;gt; C{"Does the request need specialist help?"}

    C --&amp;gt;|No| D["Main Agent answers"]
    D --&amp;gt; E["🔊 Murf Falcon TTS"]

    C --&amp;gt;|Yes| F["Main Agent announces handoff"]
    F --&amp;gt; G["🌱 Crop Problem Specialist"]

    G --&amp;gt; H["Conversation context preserved"]
    H --&amp;gt; I["Specialist asks focused follow-up"]
    I --&amp;gt; E

    E --&amp;gt; J["🎧 Farmer continues conversation"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  🐛 A Problem I Faced During Handoff
&lt;/h1&gt;

&lt;p&gt;This was one of the most useful debugging lessons of the entire challenge.&lt;/p&gt;

&lt;p&gt;Initially, the main agent successfully said:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I'll connect you with our crop problem specialist."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But then...&lt;/p&gt;

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

&lt;p&gt;The specialist didn't respond.&lt;/p&gt;

&lt;p&gt;At first, it looked like the handoff itself was working because the main agent announced it.&lt;/p&gt;

&lt;p&gt;But announcing a handoff and actually transferring an active voice session are two completely different things.&lt;/p&gt;


&lt;h1&gt;
  
  
  🔍 What Was Actually Wrong?
&lt;/h1&gt;

&lt;p&gt;The problem was related to the timing and session state of the specialist agent.&lt;/p&gt;

&lt;p&gt;The specialist's &lt;code&gt;on_enter()&lt;/code&gt; lifecycle method could attempt to generate a response before the session was ready to handle it.&lt;/p&gt;

&lt;p&gt;This created a situation where:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Main Agent → Handoff message → Specialist activation → No response&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The repository's specialist handoff fix addresses this with session readiness checks, deferred response generation, retries, better error handling, and preserved conversation context.&lt;/p&gt;


&lt;h1&gt;
  
  
  💡 What I Learned From This
&lt;/h1&gt;

&lt;p&gt;This taught me an important lesson:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;In real-time AI systems, correct logic is not enough. Timing and state management matter too.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A function can technically execute successfully while the user still experiences silence.&lt;/p&gt;

&lt;p&gt;For voice agents, the complete chain has to work:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STT → Agent → Handoff → Session State → Specialist → LLM → TTS → User&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If one part breaks, the user experiences a failed conversation.&lt;/p&gt;


&lt;h1&gt;
  
  
  🛡️ Safety and Guardrails
&lt;/h1&gt;

&lt;p&gt;An agricultural assistant also needs boundaries.&lt;/p&gt;

&lt;p&gt;KrishiMitra AI should not confidently claim a crop disease diagnosis based only on a short description.&lt;/p&gt;

&lt;p&gt;Instead, it should:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ask follow-up questions&lt;/li&gt;
&lt;li&gt;Explain possible causes carefully&lt;/li&gt;
&lt;li&gt;Avoid pretending to be a certified agricultural expert&lt;/li&gt;
&lt;li&gt;Recommend local agricultural assistance when appropriate&lt;/li&gt;
&lt;li&gt;Avoid unsafe instructions&lt;/li&gt;
&lt;li&gt;Keep responses understandable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is especially important because AI advice can influence real-world decisions.&lt;/p&gt;


&lt;h1&gt;
  
  
  🏗️ Project Architecture
&lt;/h1&gt;

&lt;p&gt;The overall system can be represented 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;flowchart LR
    U["👨‍🌾 Farmer"]

    UI["🌐 KrishiMitra AI Frontend"]

    LK["⚡ LiveKit"]

    STT["🎤 Deepgram STT"]

    MAIN["🧠 KrishiMitra Main Agent"]

    TOOLS["🔧 Agriculture Tools"]

    SPEC["🌱 Crop Problem Specialist"]

    HUMAN["👩‍🌾 Human Support"]

    LLM["🤖 LLM"]

    TTS["🔊 Murf Falcon TTS"]

    DASH["📊 Analytics Dashboard"]

    U --&amp;gt; UI
    UI --&amp;gt; LK
    LK --&amp;gt; STT
    STT --&amp;gt; MAIN

    MAIN --&amp;gt; LLM
    MAIN --&amp;gt; TOOLS

    MAIN --&amp;gt;|Crop problem| SPEC
    SPEC --&amp;gt; LLM

    MAIN --&amp;gt;|Needs human help| HUMAN

    LLM --&amp;gt; TTS
    TTS --&amp;gt; LK
    LK --&amp;gt; UI
    UI --&amp;gt; U

    LK --&amp;gt; DASH
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  🚀 How to Run the Project
&lt;/h1&gt;

&lt;p&gt;The project is based on the Murf LiveKit starter architecture.&lt;/p&gt;

&lt;p&gt;The repository contains a &lt;code&gt;backend&lt;/code&gt; for the Python voice agent and a &lt;code&gt;frontend&lt;/code&gt; for the Next.js voice interface.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;p&gt;You need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Python 3.10+&lt;/li&gt;
&lt;li&gt;Node.js 18+&lt;/li&gt;
&lt;li&gt;&lt;code&gt;uv&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pnpm&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;LiveKit project&lt;/li&gt;
&lt;li&gt;Murf API key&lt;/li&gt;
&lt;li&gt;Deepgram API key&lt;/li&gt;
&lt;li&gt;LLM API key&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The starter README documents the required environment variables, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;LIVEKIT_URL&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;LIVEKIT_API_KEY&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;LIVEKIT_API_SECRET&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;MURF_API_KEY&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;DEEPGRAM_API_KEY&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;GOOGLE_API_KEY&lt;/code&gt; or &lt;code&gt;OPENAI_API_KEY&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔐 Keep API Keys Safe
&lt;/h2&gt;

&lt;p&gt;Never put API keys directly inside your source code.&lt;/p&gt;

&lt;p&gt;Use environment files 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;.env.local
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and add them to &lt;code&gt;.gitignore&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Never publish:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API keys&lt;/li&gt;
&lt;li&gt;API secrets&lt;/li&gt;
&lt;li&gt;Private phone numbers&lt;/li&gt;
&lt;li&gt;Personal caller data&lt;/li&gt;
&lt;li&gt;Private user information&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  ▶️ Running the Backend
&lt;/h1&gt;

&lt;p&gt;From the backend directory:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;The starter project uses the backend agent as the LiveKit voice-processing service.&lt;/p&gt;




&lt;h1&gt;
  
  
  ▶️ Running the Frontend
&lt;/h1&gt;

&lt;p&gt;From the frontend directory:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Then open the local application in your browser.&lt;/p&gt;

&lt;p&gt;The original starter documentation uses &lt;code&gt;localhost:3000&lt;/code&gt; for the frontend.&lt;/p&gt;




&lt;h1&gt;
  
  
  🧪 Testing the Voice Agent
&lt;/h1&gt;

&lt;p&gt;I recommend testing the project using both normal and specialist questions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Test 1 — Normal Question
&lt;/h3&gt;

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

&lt;blockquote&gt;
&lt;p&gt;"What is the weather today?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Expected:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Main Agent responds.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No specialist handoff.&lt;/p&gt;




&lt;h3&gt;
  
  
  Test 2 — Crop Problem
&lt;/h3&gt;

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

&lt;blockquote&gt;
&lt;p&gt;"My soybean crop has yellow leaves."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Expected:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Main Agent:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I understand. I'll connect you with our Crop Problem Specialist."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then:&lt;/p&gt;

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

&lt;blockquote&gt;
&lt;p&gt;"Hello! I understand that your soybean crop has yellow leaves. When did you first notice the problem?"&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  Test 3 — Hinglish
&lt;/h3&gt;

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

&lt;blockquote&gt;
&lt;p&gt;"Meri crop mein keede lag gaye hain."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Expected:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Main Agent:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Samajh gaya. Main aapko Crop Problem Specialist se connect karta hoon."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then the specialist continues in Hinglish.&lt;/p&gt;




&lt;h1&gt;
  
  
  📁 Project Repository
&lt;/h1&gt;

&lt;p&gt;The complete project is publicly available on GitHub:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;shreyaa002/murf-livekit-starter&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It contains the backend, frontend, configuration, and documentation for the project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Repository:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://github.com/shreyaa002/murf-livekit-starter" rel="noopener noreferrer"&gt;https://github.com/shreyaa002/murf-livekit-starter&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  📈 What I Would Improve Next
&lt;/h1&gt;

&lt;p&gt;KrishiMitra AI is still a work in progress.&lt;/p&gt;

&lt;p&gt;There are several things I would like to improve next:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Better Crop Intelligence
&lt;/h3&gt;

&lt;p&gt;Add more specialized agricultural knowledge for different crops and regions.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Image-Based Crop Analysis
&lt;/h3&gt;

&lt;p&gt;Allow farmers to upload or capture a crop image and use visual analysis alongside voice.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. More Regional Languages
&lt;/h3&gt;

&lt;p&gt;Expand support beyond Hindi/Hinglish and English.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Better Personalization
&lt;/h3&gt;

&lt;p&gt;Remember useful farming context such as crops and previous problems while respecting user privacy.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. More Specialist Agents
&lt;/h3&gt;

&lt;p&gt;The current specialist focuses on crop problems.&lt;/p&gt;

&lt;p&gt;Future versions could include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Weather Specialist&lt;/li&gt;
&lt;li&gt;Irrigation Specialist&lt;/li&gt;
&lt;li&gt;Market Specialist&lt;/li&gt;
&lt;li&gt;Government Scheme Specialist&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The main agent could route each question to the appropriate expert.&lt;/p&gt;




&lt;h1&gt;
  
  
  💭 My Biggest Takeaways From 10 Days
&lt;/h1&gt;

&lt;p&gt;This challenge taught me that building a voice agent is much more than connecting an LLM to a microphone.&lt;/p&gt;

&lt;p&gt;I learned how different pieces of a real-time AI system fit together:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Speech recognition + reasoning + tools + memory + TTS + real-time transport + frontend + analytics + human escalation + multi-agent workflows.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I also learned that debugging voice agents is different from debugging a normal application.&lt;/p&gt;

&lt;p&gt;Sometimes everything looks correct in the code, but the user experience still fails because of timing, session state, audio, or asynchronous behavior.&lt;/p&gt;

&lt;p&gt;The specialist handoff was a perfect example of that.&lt;/p&gt;




&lt;h1&gt;
  
  
  🌾 Why I Want to Continue Building KrishiMitra AI
&lt;/h1&gt;

&lt;p&gt;Agriculture is an area where technology can be useful only if it is accessible.&lt;/p&gt;

&lt;p&gt;A powerful AI system is not very helpful if the user needs to understand complicated interfaces before they can use it.&lt;/p&gt;

&lt;p&gt;Voice changes that interaction.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Open → Type → Search → Read → Repeat&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;the experience becomes:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Speak → Listen → Continue&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That is the direction I want to explore further with KrishiMitra AI.&lt;/p&gt;




&lt;h1&gt;
  
  
  🚀 Final Thoughts
&lt;/h1&gt;

&lt;p&gt;Starting this challenge, my goal was simply to build a voice agent.&lt;/p&gt;

&lt;p&gt;By the end, KrishiMitra AI had become much more than that.&lt;/p&gt;

&lt;p&gt;It can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🎙️ Have voice conversations&lt;/li&gt;
&lt;li&gt;🌾 Answer farming-related questions&lt;/li&gt;
&lt;li&gt;🌐 Support multilingual/code-mixed interaction&lt;/li&gt;
&lt;li&gt;🧠 Use conversational context&lt;/li&gt;
&lt;li&gt;🔧 Use tools&lt;/li&gt;
&lt;li&gt;📞 Support outbound calling workflows&lt;/li&gt;
&lt;li&gt;👩‍🌾 Escalate users to human support&lt;/li&gt;
&lt;li&gt;📊 Track call analytics&lt;/li&gt;
&lt;li&gt;🔄 Hand conversations to a crop specialist&lt;/li&gt;
&lt;li&gt;🔊 Respond using Murf Falcon TTS&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The biggest lesson I am taking away is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;A useful AI agent is not just one that can answer questions. It is one that knows what to do, when to use a tool, when to ask for help, and when to hand the conversation to someone more specialized.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is my &lt;strong&gt;10 Days of Voice Agents — VoiceForBharat Edition&lt;/strong&gt; journey with &lt;strong&gt;KrishiMitra AI&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And this is only the beginning. 🌱&lt;/p&gt;




&lt;h2&gt;
  
  
  🔗 Project
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;KrishiMitra AI — GitHub Repository&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;shreyaa002/murf-livekit-starter&lt;/code&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🙌 Thanks
&lt;/h2&gt;

&lt;p&gt;A big thank you to &lt;strong&gt;Murf AI&lt;/strong&gt; for organizing the &lt;strong&gt;10 Days of Voice Agents — VoiceForBharat Edition&lt;/strong&gt; challenge and providing an opportunity to learn by building.&lt;/p&gt;

&lt;p&gt;Building every day, debugging every day, and learning something new every day made this challenge a great experience.&lt;/p&gt;

&lt;h1&gt;
  
  
  VoiceForBharat #MurfAI #VoiceAI #AI #GenerativeAI #LiveKit #MurfFalcon #Agriculture #AgriTech #FarmTech #ArtificialIntelligence #BuildInPublic
&lt;/h1&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>devops</category>
      <category>aws</category>
    </item>
  </channel>
</rss>
