AI multi-agent WhatsApp-based wheat advisory system for Egypt using APSIM Next Gen, Flask, weather/soil data, and scenario simulations.
# CropOracle Egypt
**CropOracle Egypt** is a WhatsApp-based, multi-agent AI decision-support system that connects Egyptian wheat farmers to real crop simulation workflows using **APSIM Next Generation**.
A farmer sends one message on WhatsApp, for example:
> I am in Kafr El-Sheikh. What if rainfall decreases 20% and temperature increases 2°C? Should I sow wheat on 15 Nov, 1 Dec, or 15 Dec?
The system interprets the question, prepares APSIM scenarios, runs crop simulations, validates the outputs, and sends a farmer-friendly advisory reply through WhatsApp.
---
## Main objective
To provide smallholder and commercial wheat farmers in Egypt with fast, science-based, location-specific crop advice through WhatsApp, without requiring a mobile app, agronomic training, or direct access to crop modeling software.
---
## Core capabilities
CropOracle Egypt is designed to support:
- Wheat sowing-date comparison
- Climate-change scenarios, including rainfall reduction and warming
- Irrigation strategy comparison
- Nitrogen fertilizer scenario comparison
- Soil-specific simulation using Egyptian soil profiles
- Governorate-specific advisory messages
- Arabic and English farmer replies
- APSIM Next Gen simulation orchestration
- Multi-agent AI workflow using Python and optional LangGraph
---
## Multi-agent architecture
The system is organized as a coordinated group of agents:
| Agent | Role |
|---|---|
| Intake Agent | Understands the farmer message and extracts intent, location, crop, dates, and scenario details |
| Weather Agent | Retrieves or prepares weather data and applies climate-change perturbations |
| Soil Agent | Selects the soil profile for the farmer location |
| APSIM Simulation Agent | Builds and runs APSIM Next Gen scenario files |
| Validation Agent | Checks simulation quality, missing outputs, and outliers |
| Advisory Agent | Converts model outputs into clear farmer recommendations |
| Coordinator | Manages workflow state, memory, and routing bet …