How shivamr021/krishimitra-ai works
KrishiMitra is a farmer-facing agricultural assistant delivered primarily through WhatsApp, with a frontend demo site. A chat request is interpreted by Gemini, dispatched to weather or mandi-price handlers, or answered conversationally; incoming plant images go through local disease classification and use Gemini Vision when confidence is low. The README documents multilingual support and these capabilities. Frontend component wiring beyond the sampled app entry points is not established by the excerpts, so its showcase sections are represented without inferred call edges.
Main entry points: webhook_router.py Chat webhook · ai_processor.py Query interpretation · config.py Runtime settings · router.py Tool dispatch
Components 19
WhatsApp backend
- API application
backend/main.py - Chat webhook
backend/api/webhook_router.py - Language sessions
backend/api/webhook_router.py - Tool dispatch
backend/core/router.py - Runtime settings
backend/core/config.py
Agricultural intelligence
- Query interpretation
backend/utils/ai_processor.py - Plant diagnosis
backend/agents/pest_detection_agent.py - Mandi prices
backend/agents/market_price_agent.py - Weather advice
backend/agents/weather_agent.py
Frontend showcase
- Frontend app
frontend/src/App.tsx - Landing page
frontend/src/pages/Index.tsx - Not-found page
frontend/src/pages/NotFound.tsx - Feature showcase
frontend/src/components/Features.tsx - How it works
frontend/src/components/HowItWorks.tsx - WhatsApp rationale
frontend/src/components/WhyWhatsApp.tsx
Other components
- Farmer
- WhatsApp / Twilio
- Google Gemini
- OpenWeather API
Connections 21
- Farmer → WhatsApp / Twilio: sends query or image
README.md - WhatsApp / Twilio → Chat webhook: posts message
README.md - API application → Chat webhook: mounts route
backend/main.py - Chat webhook → Query interpretation: interprets text
backend/api/webhook_router.py - Chat webhook → Plant diagnosis: diagnoses image
backend/api/webhook_router.py - Chat webhook → Tool dispatch: dispatches tool
backend/api/webhook_router.py - Chat webhook → Language sessions: stores language
backend/api/webhook_router.py - Chat webhook → WhatsApp / Twilio: returns reply
backend/api/webhook_router.py - Tool dispatch → Mandi prices: gets price
backend/core/router.py - Tool dispatch → Weather advice: gets forecast
backend/core/router.py - Query interpretation → Google Gemini: requests interpretation
backend/utils/ai_processor.py - Query interpretation → Google Gemini: translates reply
backend/utils/ai_processor.py - Plant diagnosis → Google Gemini: uses low-confidence fallback
backend/agents/pest_detection_agent.py - Mandi prices → Google Gemini: requests price answer
backend/agents/market_price_agent.py - Weather advice → OpenWeather API: fetches conditions
backend/agents/weather_agent.py - Query interpretation → Runtime settings: reads credentials
backend/utils/ai_processor.py - Plant diagnosis → Runtime settings: reads model and credentials
backend/agents/pest_detection_agent.py - Mandi prices → Runtime settings: reads credentials
backend/agents/market_price_agent.py - Weather advice → Runtime settings: reads API key
backend/agents/weather_agent.py - Frontend app → Landing page: routes home
frontend/src/App.tsx - Frontend app → Not-found page: routes unmatched paths
frontend/src/App.tsx