How gouravagarwal2716/agronex-ai works
Agronex AI is a farmer-facing crop intelligence and parametric-insurance platform. Farmers register, submit a leaf photo and location, and receive a diagnosis, damage and spread estimates, grounded advice, and follow-up actions. The backend pipeline orchestrates the documented model stages; the web app also exposes scan history, alerts, insights, crop recommendations, voice/chat assistance, and claim PDFs. Several route and model implementations were not excerpted, so those capabilities and stage links rely on README documentation rather than inspected route code.
Main entry points: pipeline.py Analysis pipeline · App.jsx Web application · api.js API client · main.py FastAPI application
Components 34
Farmer web app
- Web application
frontend/src/App.jsx - Welcome and onboarding
frontend/src/pages/Onboarding.jsx - Scan submission
frontend/src/pages/Scan.jsx - Results and claim view
frontend/src/pages/Results.jsx - Dashboard
frontend/src/pages/Dashboard.jsx - History and insights
frontend/src/pages/History.jsx - Kisan Mitra chat
frontend/src/components/chat/AgriBotWidget.jsx - API client
frontend/src/services/api.js
Backend API
- FastAPI application
backend/app/main.py - Scan and chat routes
backend/app/api/routes/scan.py - History and alert routes
backend/app/api/routes/history_alerts_insights.py - Insurance claims
backend/app/api/routes/insurance.py - WhatsApp dispatch
backend/app/api/routes/whatsapp.py
Crop analysis
- Analysis pipeline
backend/app/services/pipeline.py - Leaf gatekeeper
backend/app/models/inference/gatekeeper.py - Lesion segmentation
backend/app/models/inference/segmentation.py - Disease classifier
backend/app/models/inference/classifier.py - Weather and soil context
backend/app/services/location.py - Spread forecasting
backend/app/models/inference/forecaster.py - Yield loss estimate
backend/app/models/inference/yield_estimator.py - Risk fusion and urgency
backend/app/models/inference/fusion.py - Urgency scoring
backend/app/models/inference/urgency_scorer.py - Early risk model
backend/app/models/inference/presymptomatic.py
Advisory services
- Grounded advisory
backend/app/services/rag.py - Regional voice
backend/app/services/voice.py - Crop recommendations
backend/app/services/crop_recommendation.py - FAISS knowledge index
Identity and records
- Authentication routes
backend/app/api/routes/auth.py - Token security
backend/app/core/security.py - Record operations
backend/app/database/crud.py - Database models
backend/app/database/models.py - Database session
backend/app/database/session.py
Other components
- Farmer
- Weather and soil APIs
Connections 39
- Farmer → Web application: uses
- Web application → Welcome and onboarding: routes to
frontend/src/App.jsx - Web application → Scan submission: routes to
frontend/src/App.jsx - Web application → Results and claim view: routes to
frontend/src/App.jsx - Web application → Dashboard: routes to
frontend/src/App.jsx - Web application → History and insights: routes to
frontend/src/App.jsx - Web application → Kisan Mitra chat: renders
frontend/src/App.jsx - Welcome and onboarding → API client: uses
- Scan submission → API client: submits scan
- Results and claim view → API client: requests scan
frontend/src/pages/Results.jsx - Kisan Mitra chat → API client: sends chat
frontend/src/components/chat/AgriBotWidget.jsx - API client → FastAPI application: calls API
frontend/src/services/api.js - FastAPI application → Scan and chat routes: registers routes
- FastAPI application → History and alert routes: registers routes
- FastAPI application → Insurance claims: registers routes
- Scan and chat routes → Analysis pipeline: runs analysis
- Analysis pipeline → Leaf gatekeeper: validates image
backend/app/services/pipeline.py - Analysis pipeline → Lesion segmentation: measures lesions
backend/app/services/pipeline.py - Analysis pipeline → Disease classifier: classifies disease
backend/app/services/pipeline.py - Analysis pipeline → Weather and soil context: fetches context
backend/app/services/pipeline.py - Weather and soil context → Weather and soil APIs: queries
- Analysis pipeline → Spread forecasting: forecasts spread
backend/app/services/pipeline.py - Analysis pipeline → Yield loss estimate: estimates loss
backend/app/services/pipeline.py - Analysis pipeline → Risk fusion and urgency: fuses risk
backend/app/services/pipeline.py - Analysis pipeline → Urgency scoring: scores urgency
backend/app/services/pipeline.py - Analysis pipeline → Early risk model: uses model
backend/app/services/pipeline.py - Analysis pipeline → Grounded advisory: generates advice
backend/app/services/pipeline.py - Grounded advisory → FAISS knowledge index: retrieves guidance
backend/app/services/rag.py - Analysis pipeline → Regional voice: generates speech
backend/app/services/pipeline.py - Analysis pipeline → WhatsApp dispatch: dispatches report
backend/app/services/pipeline.py - Scan and chat routes → Crop recommendations: offers crops
- History and insights → API client: loads records
frontend/src/services/api.js - Results and claim view → Insurance claims: downloads claim
- Welcome and onboarding → Authentication routes: registers or logs in
- Authentication routes → Record operations: reads and creates
backend/app/api/routes/auth.py - Authentication routes → Token security: creates token
backend/app/api/routes/auth.py - Authentication routes → Database session: uses database session
backend/app/api/routes/auth.py - Database session → Database models: initializes tables
backend/app/database/session.py - Record operations → Database models: persists records