Project Story: Kenya Livestock Early Warning & Risk Monitoring System
Inspiration
In Kenya, livestock isn't just property; it’s a family’s savings account and primary livelihood. While working on software solutions, I noticed a recurring "Information Gap": when a cow or a flock of poultry shows symptoms, smallholder farmers often have to wait hours or days for a licensed vet. That delay can be the difference between a simple recovery and a total loss. I wanted to build a "digital first-responder" that provides immediate, localized triage to bridge that critical gap.
What it does
The system is an AI-powered MVP that acts as a preliminary triage assistant. A farmer selects their livestock type—ranging from dairy cattle to indigenous poultry—and describes the symptoms.
- Triage & Severity: It categorizes the case as LOW, MEDIUM, or HIGH risk.
- Localized Guidance: It provides immediate stabilization steps in English or Swahili and suggests county-specific vet contacts (e.g., Kiambu or Nakuru).
- Heuristic Monitoring: It features a "Session-only Herd View" that tracks cases in a single session, flagging potential outbreak patterns if multiple animals show high-risk symptoms.
- Safety First: It explicitly avoids drug dosages and emphasizes that it is a prototype, not a replacement for a professional veterinarian.
How we built it
The application is built using the Streamlit framework for a responsive, Python-based UI. The core "intelligence" is powered by the Gemini API, which I prompted to act as a veterinary assistant specialized in East African livestock.
- Logic: We implemented a "controlled flow" where the AI asks 2–3 targeted follow-up questions if the initial data is insufficient.
- Resilience: I built an Offline Fallback module that serves basic stabilization advice even if the API or network fails, ensuring the farmer is never left without a plan.
Challenges we ran into
- Hallucination Management: AI can sometimes be too confident. Preventing the model from suggesting specific antibiotic dosages was a major hurdle. I had to implement strict system-level constraints to ensure it only suggests "safe first steps" like isolation or hydration.
- Contextual Accuracy: Standard AI models might suggest Western farming solutions. I had to "ground" the assistant to recognize Kenyan contexts, such as local poultry breeds and specific county-level veterinary structures.
Accomplishments that we're proud of
- Multilingual Integration: Successfully implementing a Swahili toggle ensures the app is accessible to a wider demographic of farmers.
- Heuristic Risk Scoring: Developing a custom logic that translates AI descriptions into a numerical "Risk Index" (e.g., 25/60/90) to give farmers a clear, visual sense of urgency.
What we learned
Building this project taught me that in AgTech, user trust is the most valuable currency. A feature that works 90% of the time but gives one bad medical advice is a failure. I learned the importance of "Human-in-the-loop" design—where the software’s primary job is to get the user to a human expert (the vet) as safely as possible.
What's next for Livestock Early Warning System
- Persistent Outbreak Mapping: Moving beyond session-based data to a persistent database that can generate real-time heatmaps of disease spread for county officials.
- Computer Vision: Refining the photo-upload feature to identify common external symptoms (like skin lesions or eye discharge) with higher accuracy.
- USSD Integration: Expanding the service to feature-phone users who may not have access to a smartphone or stable data connection.
Log in or sign up for Devpost to join the conversation.