How darshanthelucifer-png/krishimitra-ai works
AgriSaarthi AI is a multilingual agricultural advisory product delivered through a React/Capacitor client and FastAPI backend. Farmers use chat or voice for grounded crop guidance, and can access disease diagnosis, weather, mandi prices, and land/soil planning. The main advisory path runs through the chat route and RAG service, which retrieves and reranks agricultural references before generating a response; low-confidence cases have agronomy and web-search fallback capabilities. Several feature services are represented from the tree and README, but their internal calls are not shown in the sampled source.
Main entry points: rag_service.py RAG orchestrator · App.tsx Web and mobile app · main.py FastAPI gateway · Chat.tsx Chat interface
Components 28
Farmer client
- Web and mobile app
frontend/src/App.tsx - Chat interface
frontend/src/pages/Chat.tsx - Disease check
frontend/src/pages/DiseaseCheck.tsx - Land planner
frontend/src/pages/LandVisualizer.tsx - API client
frontend/src/services/api.ts - Auth state
frontend/src/hooks/useAuth.tsx - Auth client service
frontend/src/services/authService.ts
API and identity
- FastAPI gateway
backend/app/main.py - Authentication routes
backend/app/api/routes/auth.py - Chat route
backend/app/api/routes/chat.py - Disease route
backend/app/api/routes/disease.py
Advisory intelligence
- RAG orchestrator
backend/app/services/rag_service.py - Hybrid retrieval
backend/app/ai/hybrid_retriever.py - Vector retrieval
backend/app/ai/retriever.py - Embedding service
backend/app/ai/embeddings.py - Agronomy reasoning
backend/app/services/agronomy_reasoning_engine.py - Language model
backend/app/ai/llm.py - Agent workflow
backend/app/ai/agents/graph.py
Field services
- Disease diagnostics
backend/app/services/disease_service.py - Land blueprint
backend/app/services/land_visualizer_service.py - Weather advisory
backend/app/services/weather_service.py - Mandi intelligence
backend/app/services/mandi_service.py - Voice services
backend/app/services/voice_service.py - Translation
backend/app/services/translation_service.py
Other components
- Farmer
- SoilGrids
- Agricultural web sources
- Chroma vector store
Connections 31
- Farmer → Web and mobile app: uses
README.md - Web and mobile app → Chat interface: renders
frontend/src/App.tsx - Web and mobile app → Disease check: renders
frontend/src/App.tsx - Web and mobile app → Land planner: renders
frontend/src/App.tsx - Chat interface → API client: requests through
frontend/src/pages/Chat.tsx - Chat interface → Voice services: uses voice client
- Web and mobile app → Auth state: provides auth
frontend/src/App.tsx - Auth state → Auth client service: calls
frontend/src/hooks/useAuth.tsx - Auth client service → API client: sends auth requests
frontend/src/services/authService.ts - API client → FastAPI gateway: sends REST requests
README.md - FastAPI gateway → Authentication routes: registers
backend/app/main.py - FastAPI gateway → Chat route: registers
backend/app/main.py - FastAPI gateway → Disease route: registers
backend/app/main.py - Chat route → RAG orchestrator: calls
backend/app/api/routes/chat.py - Disease route → Disease diagnostics: calls
backend/app/api/routes/disease.py - RAG orchestrator → Hybrid retrieval: retrieves with
backend/app/services/rag_service.py - RAG orchestrator → Language model: generates with
backend/app/services/rag_service.py - RAG orchestrator → Agronomy reasoning: falls back to
README.md - RAG orchestrator → Mandi intelligence: routes price intent
backend/app/services/rag_service.py - RAG orchestrator → Agricultural web sources: searches fallback
- Hybrid retrieval → Vector retrieval: queries dense channel
backend/app/ai/hybrid_retriever.py - Vector retrieval → Embedding service: embeds queries
backend/app/ai/retriever.py - Vector retrieval → Chroma vector store: queries vectors
backend/app/ai/retriever.py - Hybrid retrieval → Chroma vector store: loads indexed records
backend/app/ai/hybrid_retriever.py - RAG orchestrator → Agent workflow: orchestrates agents
README.md - Farmer → Disease check: submits crop photo
README.md - Farmer → Land planner: requests farm plan
README.md - Land blueprint → SoilGrids: fetches soil profiles
README.md - Farmer → Weather advisory: requests weather
- Farmer → Translation: requests translation
- Farmer → Voice services: uses voice loop
README.md