Building AgriAlert: A Proactive Marathi AI Voice Assistant for Indian Farmers
๐พ 1. The Mission: Voice AI for the Backbone of Bharat In rural Maharashtra, timely access to agricultural insights can make or break a harvest. Sudden unseasonal rainfall, fast-spreading crop diseases, and fluctuating Mandi prices directly impact a farmer's livelihood. While modern digital tools exist, digital literacy and complex smartphone UIs often stand in the way. To bridge this divide, I spent the last 10 days building AgriAlert under the Farm & Field track of the #VoiceForBharat Challenge. AgriAlert is a Marathi AI voice assistant designed to provide real-time weather advisories, Mandi market rates, crop care guidance, and proactive disaster warnings through voice conversations on the web and direct mobile phone calls. โ๏ธ 2. High-Level System Architecture AgriAlert is built on a real-time conversational voice pipeline: [ Farmer Voice Input (Web/Phone) ] โ โผ [ STT: LiveKit Multi-Locale Speech-to-Text ] โ โผ [ Brain: LLM with Domain Prompt, Guardrails & Memory ] โโโ SQLite DB (Caller profile, land size, crops) โโโ Tools: Mandi Rates & Weather APIs โโโ Telephony: Outbound SIP Calling โโโ Specialist Agent: Deep Agronomy Handoff โ โผ [ TTS: Murf Falcon (Pooja - Marathi) ] โ โผ [ Real-Time Audio Output (<500ms Latency) ] ๐ 3. Key Features Built Across the 10 Days Ultra-Fast Regional Voice: Powered by Murf Falcon, the Marathi voice (Pooja) speaks naturally in Devanagari Marathi with near-zero latency, understanding code-mixed terms like "pesticide", "urea", and "weather". Strict Guardrails: Programmed to never guess market prices without verified sources, and strictly refuses to prescribe toxic chemicals without human expert validation. Long-Term Caller Memory: Uses an SQLite database to remember returning farmers, their district, and their primary crops upon explicit consent. Tool Chaining & Live Data: Automatically pulls the caller's saved district to fetch live weather forecasts and Mandi prices without making the farmer repeat themselves. Proactive Outbound Calls: Uses LiveKit SIP integration to automatically call farmers on their mobile phones when severe weather alerts are issued. Human Escalation (KVK Integration): Generates traceable support tickets for complex issues, routing them directly to agricultural extension officers. Call Analytics Dashboard: Tracks success rates, total calls, and call outcomes in real time while enforcing zero PII retention. Multi-Agent Specialist Handoff: Seamlessly transfers complex disease diagnosis calls to a dedicated Crop Problem Specialist Agent. ๐ ๏ธ 4. Key Challenges & How I Solved Them Devanagari vs. Romanized Script: Early tests occasionally produced Romanized Marathi (e.g., 'namaste' instead of 'เคจเคฎเคธเฅเคคเฅ'), which caused TTS pronunciation issues. I resolved this by enforcing strict system prompt constraints requiring all Marathi responses to be strictly in native Devanagari script. Tool Chaining Latency: Calling multiple tools sequentially added noticeable delays. By pre-fetching caller metadata on session connection and passing cached district data into API calls, latency was kept well under conversational thresholds. Proactive Call Opt-outs: Outbound calls can easily feel intrusive. I structured the opening script to immediately state who is calling, why (weather warning), and how to opt out within the first two sentences. ๐ป 5. Quickstart Guide: Run Your Own Voice Agent Prerequisites Python 3.10+ Murf API Key (with Murf Falcon access) LiveKit Cloud Project & API Keys Clone the Starter Code Bash git clone https://github.com/murf-ai/murf-livekit-starter.git cd murf-livekit-starterConfigure Environment Variables Create a .env file in the root directory: Code snippet LIVEKIT_URL=your_livekit_url LIVEKIT_API_KEY=your_api_key LIVEKIT_API_SECRET=your_api_secret MURF_API_KEY=your_murf_key - Run the Agent Bash python -m venv venv source venv/bin/activate pip install -r requirements.txt python src/agent.py dev ๐ฎ 6. What's Next? Expanding language models to support multi-lingual pan-India deployment (Hindi, Tamil, Telugu, Gujarati). Direct integration with official state government agricultural databases and soil testing APIs. Top comments (0)
Comments
No comments yet. Start the discussion.