This report describes a demand forecasting system built for Farm To Feed, a Kenyan agri-commerce platform that redistributes surplus produce. The model predicts whether individual buyers will purchase specific products in the next one to two weeks, and estimates order volumes. Accurate demand signals allow farmers to harvest against committed orders rather than guesswork, and allow buyers to plan procurement without over-ordering. The final ensemble achieved a private leaderboard AUC of 0.9165, placing it in the top tier of the Zindi competition submissions.
Farm To Feed connects smallholder farmers with commercial buyers (restaurants, schools, corporate kitchens) in Kenya. A persistent challenge is demand uncertainty: buyers order conservatively to avoid spoilage, farmers harvest optimistically to maximise income. The mismatch produces avoidable post-harvest losses — estimated at 30–40% of perishable produce in Kenya's fresh market chain.
The core hypothesis is simple: if buyers can be shown accurate demand signals two weeks ahead, they can commit earlier, and farmers can harvest against confirmed orders rather than projected ones.
The model separates the forecasting problem into two parts: (1) a binary purchase classifier predicting whether a buyer will order at all in a given week, and (2) a volume regression estimating how much they will order. The two-week volume prediction is computed as: V₂w = V₁w + ΔV, where ΔV is modelled independently to capture temporal drift without compounding baseline error.
unit_name and customer_category as interpretable supply-chain constraints| Stakeholder | Problem addressed | Measurable outcome | Status |
|---|---|---|---|
| Smallholder farmers | Harvest decisions made without buyer commitment | Income variance reduced via advance order signals (est. 20–30%) | Live |
| Commercial kitchens | Over-ordering to buffer against supply uncertainty | Spoilage rate reduction through tighter weekly commits (est. 25–35%) | Live |
| Farm To Feed logistics | Reactive route planning and late supplier coordination | 14-day forward demand visibility enables pre-planned routes | Pilot |
| NGOs and impact investors | Difficulty quantifying food waste reduction | Weekly demand signal dashboard with surplus diversion metrics | Planned |
This interface demonstrates how stakeholders can query demand forecasting data using natural language, powered by an MCP server backend. In production, an LLM agent connects to the MCP server to parse questions, select the right tool, and return data-driven answers.
top_products, query_demand, waste_estimate, etc.) → Data Layer → Formatted response. The MCP server code is available at mcp_farm.py.