Logo Lanfrica

Breden21/smartfarmerai

Domain:

agriculturenatural language processing

Record type:

software
Creator:
Bre
Host:
AI-powered agricultural advisory for smallholder farmers in Zimbabwe # 🌾 SmartFarmerAI **AI-powered agricultural advisory for smallholder farmers in Zimbabwe** β€” accessible on any phone via USSD, WhatsApp, and web, built for 2G networks and near-zero data budgets. Built by Info Impact Solutions (Pvt) Ltd in partnership with the **Smallholder Agriculture Cluster Program (SACP)**, funded by IFAD/OPEC and the Government of Zimbabwe. ## The problem Zimbabwe's ~1.7M smallholder farmers face climate variability with limited access to timely, localized agricultural extension advice. Most extension apps assume a smartphone, mobile data, and English literacy β€” none of which can be assumed for this audience. ## The approach A **3-tier hybrid AI pipeline** that answers farmer questions as cheaply and quickly as possible, escalating only when needed: ``` Farmer question (USSD / WhatsApp / Web) β”‚ β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ TIER 1: Template Match β”‚ ~44 verified templates, β”‚ Local TF-IDF vector search, <50ms, free β”‚ sourced from SACP manuals β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ no confident match β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ TIER 2: Decision Engine β”‚ District + season + β”‚ Context-aware rules, DB-backed β”‚ weather + crop stage β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ no matching rule β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ TIER 3: LLM Fallback β”‚ Hugging Face free tier β”‚ For genuine edge cases β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` See `docs/ARCHITECTURE.md` for the full technical breakdown. ## Quick start ```bash # 1. Install dependencies pip install -r requirements.txt # 2. Configure environment (copy .env.example if present, or create .env with:) # HUGGINGFACE_API_KEY=... (Tier 3 LLM - free tier) # SUPABASE_DB_URL=... (Tier 2 Decision Engine - optional but recommended) # SUPABASE_URL / SUPABASE_ANON_KEY # 3. Run the gateway python gateway.py …