Inspiration

My grandfather was a wheat farmer in Punjab. Every season he'd lose part of his crop — not because he didn't work hard, but because the rust fungus alert reached him three days after it had already spread. The alert existed. It just never reached him.

800 million smallholder farmers face this same problem. Most have a basic phone. Very few have reliable internet. Agricultural extension services are understaffed and slow. By the time a pest alert travels from a government office to a village, the damage is done.

The gap isn't information — it's delivery. AgriSensei closes that gap.

What it does

AgriSensei is an autonomous multi-agent system that wakes up every morning at 6 AM IST, checks the weather forecast and crop disease news for each registered farmer's region, writes a plain-language advisory in their language, and sends it directly to their phone via SMS or WhatsApp.

No app to download. No internet needed on their end. Just a message that says: "Aaj barish hogi, gehu ko paani mat do" — and that's enough.

Farmers can also reply or ask questions anytime. The chat agent remembers their crop, region, and past conversations, so it gives contextual answers instead of generic ones.

How I built it

Multi-agent architecture with Gemini 3.6 Flash:

  • Orchestrator agent — handles farmer chat with full function calling (weather, news, SMS, WhatsApp tools)
  • Daily brief agent — runs every morning, fetches real weather + crop news, generates advisory
  • Translation agent — translates advisories into Hindi, Telugu, Tamil, or English

Pipeline:

  1. Cloud Scheduler fires at 6 AM IST → Pub/Sub message
  2. FastAPI backend on Cloud Run picks it up
  3. Pulls 3-day weather forecast from WeatherAPI
  4. Fetches crop disease news from NewsAPI
  5. Gemini 3.6 Flash writes the advisory
  6. Second Gemini call translates it into farmer's language
  7. Twilio delivers via SMS or WhatsApp

Stack: FastAPI + Cloud Run + Firestore + Pub/Sub + Cloud Scheduler + Twilio + Google GenAI SDK

Challenges

  • Gemini free tier rate limits (5-20 req/min) required building a retry system with exponential backoff
  • Streaming responses with function calling required a two-phase approach: tool loop first (non-streaming), then stream only the final answer
  • Making the system work without internet on the farmer's side — the entire intelligence lives server-side, delivery is just SMS

What I learned

Real agentic systems aren't just "call an LLM" — they're about orchestrating multiple specialized agents, handling failures gracefully, and making sure the output actually reaches the person who needs it. The hardest part wasn't the AI. It was the last mile.

What's next

  • Voice call support for farmers who can't read
  • Market price alerts (mandi prices)
  • Image-based crop disease diagnosis via WhatsApp photo
  • Regional language expansion: Marathi, Punjabi, Kannada

Built With

Share this project:

Updates

Submission history