Inspiration

In Machakos County, a smallholder farmer makes one high-stakes decision every season: when to plant maize. Plant before the rains establish and the seed dies in dry soil; plant too late and the crop misses the window. As the rains grow more erratic, that bet gets harder, and getting it wrong can cost a family its seed, its labour, and its food for the year.

The frustrating part is that the data to warn them already exists: satellite rainfall, drought indices, and seasonal forecasts from world-class sources. But it lives in technical dashboards and indices that a farmer with a feature phone can neither reach nor understand. We wanted to close that last mile: turn credible climate science into one timely, plain-language action, delivered on any phone.

What it does

MawinguOps is an early-warning planting advisory for smallholder maize farmers.

  • It issues a single traffic-light signal, GREEN / YELLOW / RED, with one action word: PLANT, WAIT, PREPARE, or DO NOT PLANT.
  • It explains the "why" in plain language, in both English and Kiswahili.
  • It leads with early warning: the risk level and how much lead time a farmer has to act (for example, "prepare your land, the short rains are about 12 weeks away").
  • It reaches everyone: a web dashboard for officers, weekly SMS and email alerts, and a USSD line (*384#) that works on any basic phone with no smartphone and no data.

An officer-facing view translates the underlying signals (drought risk, rainfall condition, 30-day trend, season onset) into plain verdicts, with the raw figures kept as small print for credibility.

How we built it

A weekly Python pipeline pulls CHIRPS satellite rainfall (UCSB Climate Hazards Center), Open-Meteo forecasts, and ICPAC Geoportal layers. It computes the Standardized Precipitation Index and a 30-day rainfall anomaly, detects growing-season onset, and validates it against the CHIRPS climatology. A scikit-learn model converts those features into a planting recommendation with a confidence score.

SPI expresses a rainfall total as a standard-normal anomaly (fit to a gamma distribution, then transformed), which in its standardized form is:

$$ \text{SPI} = \frac{x - \mu}{\sigma} $$

The heart of the project is the translation layer. Raw indices mean nothing to a farmer, so a Llama 3.3 70B model (via Groq) rewrites the verified signals into a short advisory in English and Kiswahili. It is grounded only in the facts that were actually crossed that cycle, and every output passes a validation guardrail.

Everything is precomputed into PostgreSQL. The delivery channels (a **React

  • Vite + Tailwind** dashboard with Recharts and Leaflet, a Node / Express API, and a USSD webhook for Africa's Talking) only read, so every channel shows the same decision instantly. It deploys to Render from a single Blueprint file: managed Postgres, a Dockerized API, and the static dashboard.

Challenges we ran into

  • Making an LLM safe enough for real advice. A hallucinated planting message could hurt a family. We grounded the model in verified facts, validated every generation, and wrote a deterministic fallback that produces the same four-part advisory if the model fails or Groq is unavailable, so a bad output can never reach a farmer.
  • Speaking to people who do not read indices. "SPI +0.33" is meaningless in the field. We built a plain-language layer that leads with verdicts and lead time, and demoted the numbers to officer-only detail.
  • Demonstrating an in-season decision off-season. The live plant / wait / don't-plant path only activates during the rain windows. We added a demo scenario selector and seeded in-season data so the full decision path is always demonstrable, without ever changing what a real farmer sees.
  • Stateless USSD. Africa's Talking does not resend custom fields between steps, so we persisted session context in the database to keep each USSD journey consistent.

Accomplishments that we're proud of

  • A complete anticipatory pipeline that goes from satellite data all the way to a message on a feature phone.
  • A grounded, bilingual AI translation with a real safety net, not a raw model hooked to production.
  • True multi-channel parity: dashboard, SMS, and USSD all read one precomputed source, so the advice never contradicts itself.
  • Alignment with credible, regional science (CHIRPS and ICPAC), and a one-file reproducible deployment.

What we learned

  • The practical side of drought monitoring: SPI, rainfall anomalies, and growing-season onset, and how to sanity-check them against climatology.
  • How to make large language models trustworthy for high-stakes use through grounding, guardrails, and deterministic fallbacks.
  • Designing for the last mile, where a USSD menu on a feature phone matters more than a polished screen.
  • That the hardest and most valuable work in early warning is translation: turning correct data into an action someone will actually take.

What's next for MawinguOps

  • Expand beyond Machakos to more counties and crops, starting where drought risk is highest.
  • Wire the ICPAC Data Library onset and a combined drought index directly into the pipeline.
  • Run a real pilot with county extension officers and a farmer cooperative to measure whether the advisories change planting outcomes.
  • Add more languages, and extend the early-warning signal to pest, disease, and market-price alerts.

Built With

Share this project:

Updates

Submission history