AI-powered voice & SMS agricultural intelligence for India's small and marginal farmers in their own language, on the phone they already own.
Built for Build with AI: Code for Communities a Google Cloud hackathon where every problem statement was written by an MP's office, and the best solutions get piloted in a real constituency.
86.1% of India's ~146 million landholdings are small and marginal (Agriculture Census, 2015β16). Most of these farmers choose what to plant based on habit and hearsay β not on what the soil, the groundwater, or the sky are actually saying. When the guess is wrong, the loss is total: no insurance cushion, no smartphone to check an app, and one extension officer covering dozens of villages.
AgriVaani doesn't ask farmers to change how they live. It meets them on a phone call.
AgriVaani is three connected AI systems, reachable entirely by voice IVR and SMS β no app, no smartphone, no literacy requirement:
| Pillar | What it does | |
|---|---|---|
| π°οΈ | Smart Crop Recommendation | Fuses satellite NDVI/NDMI, soil pH, groundwater depth, and rainfall history into a ranked, plain-language crop recommendation per plot, per season. |
| β‘ | Real-Time Advisory & Dry-Spell Alerts | Fuses weather forecasts with real field sensor data (Arduino Mega 2560 + GSM + pH sensor) to push proactive irrigation/fertigation alerts by voice and SMS β before the damage happens, not after. Can optionally auto-actuate an irrigation pump via a 4-channel relay, gated by hard safety limits. |
| π¬ | Crop Health Logging | A farmer sends a photo or voice note of a sick plant. Gemini's multimodal model gives an instant diagnosis and confidence score. Low-confidence or high-severity cases are automatically escalated to a human expert at the nearest Rythu Seva Kendra. |
FARMER TOUCHPOINTS
π Toll-free voice call (IVR) π¬ SMS (inbound/outbound)
β β
βββββββββββΌβββββββββββ ββββββββββββΌββββββββββ
β Telephony Gateway ββββββββββ€ SMS Gateway β
β (Twilio / Exotel) β β (Twilio / Exotel) β
βββββββββββ¬βββββββββββ ββββββββββββ¬ββββββββββ
βββββββββββββββββ¬βββββββββββββββ
βΌ
βββββββββββββββββββββββββββββ
β Orchestration API β Node.js / TypeScript
β session state Β· routing β
β IVR state machine β
ββββββββββββββββ¬βββββββββββββ
ββββββββββββββββ¬ββββββββββββΌββββββββββββββββ¬βββββββββββββββ
βΌ βΌ βΌ βΌ βΌ
ββββββββββββββββ βββββββββββββ βββββββββββββ ββββββββββββββ βββββββββββββββ
β Recommend β β Advisory β β Crop β β Language β β RSK Officer β
β Service β β Alert β β Health β β Provider β β Dashboard β
β FastAPI + β β Engine β β Diagnosis β β Bhashini / β β Next.js 14 β
β XGBoost β β Node cron β β Gemini β β Google STT β β β
β β β + rules β β Vision β β /TTS β β β
ββββββββ¬ββββββββ βββββββ¬ββββββ βββββββ¬ββββββ ββββββββββββββ ββββββββ¬βββββββ
β β β β
βΌ βΌ βΌ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β Data Layer β β
β Earth Engine Β· Soil Health Card Β· CGWB β β
β IMD / weather Β· Field hardware (GSM/GPRS + SMS) β β
ββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββ β
βΌ β
ββββββββββββββββββββββββββββββ β
β PostgreSQL Β· Firestore Β· ββββββββββββββββββββββββββ
β BigQuery β
ββββββββββββββββββββββββββββββ
π± Field π‘ GSM / GPRS
βββββββββββββββββββββββ βββββββββββββββββββββββββ
β Arduino Mega 2560 β ββ pH readings βββΊ β Orchestration API β
β + SIM800L GSM β β /v1/sensors/:id/... β
β + pH sensor β βββ commands ββββ β β
β + 4-ch relay β βββββββββββββββββββββββββ
β ββ irrigation pump β
β ββ fertigation valve A βΌ
β ββ fertigation valve B Alert Engine (cron)
β ββ spare fuses forecast + soil signal
β safety: 30-min max runtime, β voice + SMS alert
β local manual override always wins β optional auto-actuation
ββββββββββββββββββββββ (opt-in, critical-only)
| AI / ML | Vertex AI Β· Gemini 2.x (multimodal) Β· XGBoost recommender + rules-based fallback |
| Geospatial | Google Earth Engine (Sentinel-2 NDVI/NDMI) Β· ISRO Bhuvan Β· CGWB / India-WRIS groundwater |
| Weather | IMD API Β· NASA POWER / OpenWeatherMap fallback |
| Voice & SMS | Twilio Programmable Voice + SMS (Exotel-ready via provider interface) |
| Language | Bhashini (primary) Β· Google Cloud Speech-to-Text & Text-to-Speech (fallback, live) |
| Backend | Node.js + TypeScript (orchestration) Β· Python + FastAPI (recommendation engine) |
| Database | PostgreSQL (Cloud SQL / Neon / Supabase) Β· Firestore Β· BigQuery |
| Dashboard | Next.js 14 + TypeScript + Tailwind CSS |
| Field Hardware | Arduino Mega 2560 Β· SIM800L GSM module Β· analog pH sensor Β· 4-channel relay module |
agrivaani/
βββ apps/
β βββ orchestration-api/ # Node.js/TypeScript β telephony, sessions, IVR, alerts
β βββ recommendation-service/ # Python FastAPI β crop scoring + Gemini rationale
β βββ officer-dashboard/ # Next.js 14 β RSK escalation queue
βββ firmware/
β βββ sensor_node/sensor_node.ino # Arduino Mega 2560 + GSM + pH + relay
βββ scripts/
β βββ seed_demo_data.ts
β βββ telemetry_replay.py
β βββ fake_call.ts
βββ db/
β βββ migrations/001_initial_schema.sql
βββ docs/
β βββ DEMO_SCRIPT.md
β βββ KNOWN_GAPS.md
βββ .env.example
This project runs natively on your machine. No virtualization needed.
Create a free instance at neon.tech or supabase.com, then:
psql <your_connection_string> -f db/migrations/001_initial_schema.sqlcp .env.example .env
# fill in DATABASE_URL at minimum β everything else falls back to
# deterministic mocks if a key is missing (see KNOWN_GAPS.md)cd scripts && ts-node seed_demo_data.ts# Terminal 1 β orchestration API
cd apps/orchestration-api && npm install && npm run dev
# Terminal 2 β recommendation engine
cd apps/recommendation-service && python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn main:app --reload --port 8000
# Terminal 3 β officer dashboard
cd apps/officer-dashboard && npm install && npm run devngrok http 3000
# point your Twilio number's webhook at <ngrok-url>/v1/voice/inboundFull walkthrough: docs/DEMO_SCRIPT.md
AgriVaani is built so that every mocked component sits behind the same interface a real one would use β swap a credential, not the architecture. Full detail in docs/KNOWN_GAPS.md.
| Component | Status |
|---|---|
| Crop scoring (rules-based) | β Live, unit-tested |
| Gemini rationale generation | β Live (falls back to static strings without a key) |
| Google Cloud Speech-to-Text / Text-to-Speech | β Live |
| Arduino Mega 2560 firmware (pH + relay + safety cutoffs) | β Written, hardware-ready |
| Alert engine (deterministic dry-spell + pH thresholds) | β Live |
| Gemini Vision crop diagnosis | β Live (falls back to a mock diagnosis without a key) |
| RSK officer dashboard | β Live |
| Twilio voice/SMS | β Live with a trial account + ngrok |
| Earth Engine satellite sync | π‘ Mocked (realistic randomized NDVI/NDMI) |
| XGBoost trained model | π‘ Rules-based fallback in its place |
| Bhashini Indic language APIs | π‘ Mocked (enterprise account required) |
| Officer authentication | π‘ Stubbed (pilot-blocker, not a hackathon-blocker) |
- Auto-actuation is opt-in per plot, critical-alerts-only β advisory (voice/SMS) is always the default response. The system never silently starts controlling a farmer's irrigation pump.
- Hardware-level guardrails: a 30-minute max relay runtime regardless of the source of the command, and a local manual override switch that always wins over a remote signal.
- Alert fatigue control: no duplicate alert for the same unresolved condition within 24 hours.
- Explicit escalation rule, not implicit LLM judgment:
needs_expert = confidence < 0.6 OR severity == "high"lives in code, not inside a prompt.
- Crop recommendation engine with rules-based fallback
- Real-time alert engine with hardware sensor fusion
- Crop health diagnosis with human escalation
- Voice/SMS orchestration with live Twilio + Google TTS
- Real Earth Engine satellite integration
- Trained XGBoost model on labeled yield data
- Bhashini production integration for full Indic language coverage
- Pilot deployment with one Rythu Seva Kendra cluster
- District-scale rollout in partnership with the state agriculture department
SSY β Solve. Scale. Yield. β Indore
Built for Build with AI: Code for Communities (Google Cloud Hackathon)
Krishi Buddhimatta, Har Kisan Tak Agricultural intelligence, to every farmer.