AfyaPulse: Real-Time Rural Health Intelligence
Inspiration
In rural Kenya, especially in counties like Kakamega, the "Last Mile" of healthcare is often a black hole for data. While the Ministry of Health has sophisticated tools at the national level, the Community Health Promoters (CHPs) in the villages rely on paper or delayed reporting. We were inspired by the "Pulse" of the community—the idea that even without a smartphone or a data bundle, a simple USSD signal could be the early warning system that stops the next zoonotic outbreak before it reaches the city.
What it does
AfyaPulse is an end-to-end disease surveillance system that bridges the gap between basic feature phones and advanced AI.
- For CHPs: A zero-data USSD interface allows for instant reporting of human symptoms (fever, rash) or animal health crises.
- For Health Officers: A "Movie-like" Kibana Command Center visualizes these reports on real-time heatmaps.
- For Decision Makers: An Elastic AI Assistant, powered by the Agent Builder, acts as an on-call epidemiologist to analyze trends and suggest interventions.
How we built it
The architecture is designed for extreme accessibility and high-performance analysis:
- Frontend (Accessibility Layer): We used the Africa’s Talking USSD Gateway to capture data from any GSM phone.
- Backend (Ingest Layer): A Python Flask server hosted on Render handles the USSD callbacks and structures the data.
- The Brain (Elastic Stack):
- Elasticsearch: Stores reports with Geo-point mapping for spatial analysis.
- Ingest Pipelines: We built a
disease-triage-pipelinethat enriches raw inputs with risk scores using simple logic:
$$Risk = \sum (SymptomWeight \times Frequency)$$
- Kibana: Used for the Dark-Mode Command Center and Maps.
- Agent Builder: We leveraged RAG (Retrieval-Augmented Generation) to connect an LLM to our private
health-reportsindex, allowing for natural language querying of live outbreak data.
Challenges we ran into
The biggest hurdle was the "Cold Start" and "Latency" issues. Africa’s Talking requires a response in $< 10$ seconds, but free-tier cloud servers often "sleep." We had to optimize our Flask initialization and implement a "Keep-Alive" strategy to ensure the USSD session wouldn't timeout during the critical handshake. We also faced Encoding Challenges (Latin-1 vs UTF-8) when passing API keys through headers, which taught us the importance of strict string sanitization in Python.
Accomplishments that we're proud of
- The "Invisible" Tech: We successfully integrated a 1990s technology (USSD) with 2026 AI (Elastic Agent Builder).
- Zero-Data Mapping: Seeing a dot appear on a map in Kakamega within 2 seconds of hitting "Send" on a basic phone simulator was our "Eureka" moment.
- Localized Intelligence: Training the AI Agent to recognize the specific geography and health context of Western Kenya.
What we learned
We learned that Data Inclusion is just as important as Data Intelligence. If your AI is only trained on data from people with iPhones, you are missing 70% of the population. We also deepened our understanding of Elasticsearch Ingest Pipelines and how they can be used to "clean" messy human input before it ever hits the database.
What's next for AfyaPulse
- SMS Alerts: Implementing Elastic "Watcher" rules to send an automatic SMS back to the CHP when the AI detects a high-risk cluster in their village.
- Multi-Lingual Support: Adding Swahili and Luhya language processing to the USSD menu.
- Offline Maps: Developing a lightweight version of the dashboard that can be cached for use by sub-county officers in low-connectivity areas.
Built With
- africa's-talking
- elasticsearch
- kibana
- python-package-index
- render
- ussd

Log in or sign up for Devpost to join the conversation.