
#Dr. Amina — AI Healthcare for Northern Nigeria
Northern Nigeria faces a critical healthcare information gap: limited access to doctors, low health literacy, and language barriers that leave millions without reliable medical guidance. Dr. Amina was built to close that gap.
#What It Does
Dr. Amina is a multilingual AI healthcare assistant that answers medical questions using retrieval-augmented generation (RAG) grounded in 648 verified health documents — not hallucinated medical advice. It combines:
- Google Gemini AI for natural language understanding and response generation
- Pinecone vector database for semantic search across the medical knowledge base
- Emergency detection using an LLM-based classifier with an 80% confidence threshold — directs users to the nearest hospital when it matters
- Hausa voice input via speech-to-text, because health literacy starts with language accessibility
- Supabase chat persistence so conversations carry context across sessions
#Solution Architecture
User Query
├─▶ Emergency Detection (Gemini, few-shot classified, runs in parallel)
│ → structured {is_emergency, confidence, condition, urgency, reason}
│ → alert only if is_emergency AND confidence ≥ 0.80
│
└─▶ RAG Pipeline
→ Gemini Embedding of the query
→ Pinecone Retrieval (top-k medical document chunks, cosine similarity)
→ Context Assembly (retrieved chunks injected into the prompt)
→ Gemini Generation → grounded response with source attribution
Emergency detection and document retrieval run as two separate concerns on every query, not one classifier bolted onto the other — a query can be both an emergency and answered with retrieved context, or neither, without one path blocking the other.
Emergency detection is few-shot classified, not keyword-matched. The prompt includes worked examples ("severe chest pain and difficulty breathing" → emergency/heart attack, "mild headache" → not an emergency) and requires Gemini to return structured JSON — is_emergency, a confidence score, the suspected condition, urgency level, and a reason — rather than a bare yes/no. Keyword matching alone misses phrasing like "my chest feels heavy," which is exactly the kind of real-world phrasing a rule list won't anticipate.
Built to degrade gracefully, not fail outright. If Pinecone or the embedding call is unavailable, the system falls back to a small curated set of hand-written, source-attributed medical snippets for common queries (e.g. morning sickness, fever in children) instead of returning an error or a hallucinated answer. Similarly, Supabase operations are wrapped so that a database hiccup degrades to session-only memory rather than crashing the conversation. In production the system runs on its primary path — live Gemini embeddings, Pinecone retrieval, and Supabase persistence — but the fallback exists specifically so a flaky third-party API doesn't take the whole assistant down for users who may have no other source of medical guidance.
#Key Engineering Decisions
- No fine-tuning — RAG was chosen over fine-tuning because medical accuracy requires traceable sources. Every response can be traced back to specific documents in the knowledge base.
- Confidence-gated emergency detection — rather than keyword matching (which misses "my chest feels heavy"), the system uses Gemini to classify emergency severity and only triggers alerts above 80% confidence.
- Hausa-first design — the voice input pipeline supports Hausa natively, not as an afterthought translation layer.
- Supabase for persistence — lightweight, real-time database that handles chat history without the overhead of a full backend.
- Graceful degradation over hard failure — retrieval and persistence both have fallback paths, so a third-party outage degrades the experience instead of breaking it entirely. For a health-guidance tool, staying partially available beats going fully offline.
#Tech Stack
| Component | Technology |
|---|---|
| LLM | Google Gemini AI |
| Vector DB | Pinecone |
| Backend | Python, Streamlit |
| Database | Supabase |
| Speech | Hausa voice-to-text |
| Deployment | Streamlit Cloud |
#Results
- 648 health documents indexed and retrievable
- Live deployment serving real users via Streamlit
- Sub-3 second response times for most queries
- Built and deployed during the DataFest Africa 2025 Hackathon