Inspiration

Over 33 million smallholder farmers in Nigeria — and hundreds of millions across Africa — make daily decisions about their crops with almost no access to expert advice. An agronomist costs money they don't have. The internet is unreliable or expensive. When a disease hits a maize farm in Kano or a cassava plot in Ogun State, farmers often lose entire harvests simply because they had no one to ask.

I built AgriMind because African farmers deserve expert-level agricultural guidance — and they deserve it in their own language, on the hardware they already own, without needing Wi-Fi or a data subscription.

What it does

AgriMind is a fully offline AI farming assistant that runs on any 8 GB laptop with no internet connection, no cloud API, and no GPU.

Farmers can:

  • Diagnose crop diseases from symptom descriptions (yellowing leaves, brown spots, wilting)
  • Identify pests and get integrated pest management advice — organic and chemical options
  • Get planting calendars tailored to West and East African seasons (rainy, dry, harmattan)
  • Manage irrigation with water-stress detection guidance
  • Improve soil with locally available fertiliser recommendations
  • Identify the most profitable crops to grow based on current market demand

AgriMind speaks 4 languages — English, Hausa, Yoruba, and Nigerian Pidgin — so farmers across Nigeria and West Africa can get advice in the language they think and work in.

How we built it

The architecture is deliberately simple so it can run on constrained hardware:

  • Frontend: A single index.html file — pure HTML, CSS, and vanilla JavaScript. Zero npm, zero build step, zero dependencies. Open it in any browser.
  • Backend: A server.py using Python's standard library only (http.server, urllib). No pip install required whatsoever.
  • AI Model: Ollama running phi3:mini (Microsoft Phi-3 Mini — 2.3 GB, runs on 4 GB RAM). The model is served locally at localhost:11434.
  • Multilingual engine: Language-specific system prompts instruct the model to respond in Hausa, Yoruba, or Nigerian Pidgin. The entire UI — labels, quick questions, welcome messages, crop context tags — switches language instantly.

The full stack fits inside a single folder. Anyone can run it with one command: python server.py

Challenges we ran into

  1. Getting quality agricultural responses from a small model** Phi-3 Mini (2.3B parameters) is not as capable as large cloud models. I solved this by engineering a detailed, domain-specific system prompt that frames AgriMind as a confident agronomist rather than a generic assistant — specifying African crops, African seasons, and requiring treatment options from organic to chemical. This dramatically improved response quality.

2. Multilingual accuracy in an offline model Hausa and Yoruba are low-resource languages. Small models can hallucinate or mix languages. I handled this with strict language instructions in the system prompt and by pre-translating all UI text, quick questions, and welcome messages — so even if the model struggles with a term, the interface itself is always in the correct language.

3. Zero-dependency constraint The challenge requires commodity hardware with no assumptions about installed software. I deliberately avoided Flask, FastAPI, React, or any framework. Python's built-in http.server is all that's needed. The frontend is one HTML file with all CSS and JS inline.

Accomplishments that we're proud of

What we learned

  • Small language models (2–4B parameters) can deliver genuinely useful domain-specific answers when guided by well-crafted system prompts — the prompt engineering matters more than model size.
  • Truly offline software forces you to strip away assumptions you didn't know you had (CDN fonts, npm packages, API keys, environment variables).
  • Localisation is not just translation — Hausa and Yoruba speakers interact with technology differently, so the tone and phrasing of quick questions had to feel natural, not mechanical.
  • Africa's real infrastructure constraint is not just bandwidth — it's reliability. A solution that works 100% of the time offline beats a smarter solution that needs connectivity. ## What's next for AgriMind

Built With

  • css3
  • external
  • hausa-language-prompting
  • html5
  • nigerian-pidgin-nlp
  • no
  • ollama
  • phi3:mini-(microsoft-phi-3-mini)
  • python
  • python-http.server-(stdlib)
  • vanilla-javascript
  • yoruba-language-prompting
Share this project:

Updates