How yagnasuthar/farmxpert works
FarmXpert is a multi-agent farm-advisory product: a farmer uses the web app to ask a question or request farm operations guidance; the Node API supplies farm context to the stateless AI service, returns an answer, and owns persistence. The graph also preserves the documented specialist-advisory and task-planning capabilities, plus authentication, farm data, and knowledge retrieval. The README and sampled entry points support the cross-service flow; some internal agent wiring is not shown, so only documented relationships are drawn.
Main entry points: engine.py Execution engine · app.js HTTP API · routes.js Chat and voice · pool.js PostgreSQL data
Components 24
Farmer experience
- Web app
Frontend/src/app/[locale]/(app)/dashboard/assistant/page.jsx - Sign-in and onboarding
Frontend/src/app/[locale]/(app)/auth/login/page.jsx
Application API
- HTTP API
Backend/src/app.js - Authentication
Backend/src/modules/auth/routes.js - Chat and voice
Backend/src/modules/chat/routes.js - Farm and soil API
Backend/src/modules/farms.js - Plans and tasks API
Backend/src/modules/plans.js - AI service client
Backend/src/clients/ai.js
AI advisory
- FastAPI service
AI_Backend/main.py - Agent orchestrator
AI_Backend/orchestration/service.py - Execution engine
AI_Backend/orchestration/engine.py - Crop recommendations
AI_Backend/agents/crop_planning_growth/crop_prediction/service.py - Weather advisories
AI_Backend/agents/crop_planning_growth/weather_watcher/service.py - Soil analysis
AI_Backend/agents/crop_planning_growth/soil_health/service.py - Irrigation planning
AI_Backend/agents/crop_planning_growth/irrigation_planner/service.py - Market intelligence
AI_Backend/agents/supplychain_market_access/market_intelligence/service.py - Task planning
AI_Backend/agents/farm_operations_automation/task_scheduler/service.py - Knowledge retrieval
AI_Backend/agents/retrieval_agent/service.py
Farm data
- PostgreSQL data
Backend/src/db/pool.js - Knowledge index
AI_Backend/agents/retrieval_agent/store.py
External services
- Weather providers
- Language model
- Mandi data
Other components
- Farmer
Connections 29
- Farmer → Web app: asks or views
- Web app → HTTP API: sends requests
- HTTP API → Authentication: routes auth
- HTTP API → Chat and voice: routes chat
- HTTP API → Farm and soil API: routes farm data
- HTTP API → Plans and tasks API: routes plans
- Sign-in and onboarding → HTTP API: submits credentials
- Authentication → PostgreSQL data: reads and writes
- Farm and soil API → PostgreSQL data: reads and writes
- Plans and tasks API → PostgreSQL data: reads and writes
- Chat and voice → PostgreSQL data: loads context and history
- Chat and voice → AI service client: requests advisory
- AI service client → FastAPI service: sends farm context
- FastAPI service → Agent orchestrator: routes advisory
- Agent orchestrator → Execution engine: executes plan
- Execution engine → Crop recommendations: dispatches agent
- Execution engine → Weather advisories: dispatches agent
- Execution engine → Soil analysis: dispatches agent
- Execution engine → Irrigation planning: dispatches agent
- Execution engine → Market intelligence: dispatches agent
- Execution engine → Task planning: dispatches agent
- Execution engine → Knowledge retrieval: dispatches agent
- Weather advisories → Weather providers: fetches forecasts
- Market intelligence → Mandi data: fetches market data
- Knowledge retrieval → Knowledge index: reads index
- Agent orchestrator → Language model: generates language output
- FastAPI service → Chat and voice: returns advisory
- Chat and voice → Web app: returns answer
- Chat and voice → PostgreSQL data: records answered turn