Inspiration
The story that started CivCare
My friend thought he had ulcers. He kept treating it as normal ulcers and continued taking beers and everything and when the ulcers burnt him, he would rush to the kitchen and get some ash then lick them which would neutralize it. Then it started getting worse, he felt like his chest was swelling and like his throat had a swelling, but we couldn't see any swelling on his throat, he kept saying that he felt the ulcers rise in his stomach pushing the oesophagus. So, when it got worse, he decided to go to the hospital, and while at the hospital a nurse referred him to a doctor who was a specialist in lungs and stuff, who then performed some tests on him that costed my friend 1500KSh. He was then prescribed some medication by that doctor which my friend took for some weeks but did not work. So he went back to the hospital later and this time a dermatologist met him at the waiting bay and took him in for consultation, after which she gave him some drugs and told him not to take certain foods and this actually got him better. It turned out he never had ulcers at all — the doctor said it was something called oesophagitis.
The problem is that my friend saw a lung specialist who ran Ksh 1,500 in tests — not because the symptom required it, but because he arrived with no history, couldn't articulate his symptoms clearly under stress, and the doctor had nothing to work from. CivCare submits a complete case file to the doctor before the patient is called in — symptoms, duration, self-medication history, allergies, risk score, and a full chat summary. The doctor reviews it before the consultation starts, so they already know who this person is and what's happening. Tests like the one that cost my friend Ksh 1,500 stop happening because the doctor isn't guessing anymore.
In Kenya, care rarely fails because hospitals don't exist — it fails in the gaps between them.
A sick person doesn't know if their symptoms are serious. They don't know which hospital to go to, or which doctor to see when they arrive. They queue for hours to repeat their story from scratch, leave with a prescription they don't fully understand, and then face recovery completely alone. Every one of those gaps is a place where people get scared, give up, or get worse.
We didn't want to build "another symptom checker." We wanted an AI that stays with you the whole way — from the first "I don't feel well" to the day you're fully healed — holding your hand through every step a normal person dreads doing alone.
The System We're Fixing
CivCare doesn't replace the hospital — it fixes the broken path to it. The "system people depend on" here is public healthcare access: the journey from "I feel sick" to "I've been treated." Today that journey fails people at every handoff, and CivCare repairs each one:
- People can't tell if a symptom is serious → so they either panic to an ER or dangerously wait at home. CivCare assesses risk from the patient's full context and routes them to the right level of care.
- Blind, first-come queues waste doctors on minor cases while critical patients wait. CivCare silently orders the queue by risk, so the same staff treat the sickest people first.
- Counterfeit and clashing medication harm people self-treating. MedScan flags counterfeit-risk drugs common in East Africa and dangerous interactions.
- Care ends at the hospital door — no follow-up. CivCare checks in every evening until you've recovered.
- The system never learns from its mistakes. Every doctor verdict trains CivCare, so it gets more accurate for the next patient.
What It Does
CivCare walks beside the patient from the very first message to full recovery:
- It listens. A warm AI health assistant chats with you — in English, Swahili, or Sheng — asking one gentle question at a time, the way a kind nurse would. You never feel interrogated.
- It figures out how serious it is. Quietly, in the background, it works out a risk score. You never see a scary diagnosis — that's deliberate. No panic, no self-diagnosis at 2 a.m.
- It tells you exactly where to go. Based on how urgent things are, it guides you to a hospital or an online consultation. Smart routing: When a patient is ready for referral, we geocode their location and query OpenStreetMap (Overpass) for nearby health facilities. We rank results by haversine distance and surface the closest options to the doctor, so referrals reflect where the patient actually is — not a static directory. If it's an emergency, it doesn't ask whether you'd prefer to stay home — it warmly directs you to the nearest hospital, because some moments can't wait.
- It carries your story ahead of you. Tap "I've arrived" at the hospital and CivCare slips you into that hospital's doctor queue — and sends your full summary to the doctor before they call you. When the doctor calls you in, you already know their name and room. No re-explaining. No starting over.
- It connects you online when that's enough. For online visits, your payment is held safely in escrow, the doctor — already holding your AI summary — opens a video room, and you join right in the app.
- It makes sure you actually get better. After the doctor's verdict, you log the medicine you were given. CivCare then reminds you for every single dose and checks in with you each evening.
And here's the part we love most:
- It celebrates your healing with you. Every evening when you say how you're feeling, the AI reads your answer against your diagnosis and against how you felt yesterday and the day before — and replies like someone who's been paying attention: "It looks like that headache has finally settled, and now it's the chest pain that's easing — you're making real progress. Keep going." It's not a status bar. It's a companion noticing you're getting better, and telling you so.
What CivCare does not do: CivCare does not select which specialist a patient should see, and it does not automatically route a patient to a specific facility. Automating facility selection risks routing a high-risk patient to a clinic that cannot handle them — and that judgment belongs to the patient and their support network, not an algorithm. CivCare instead shows the patient all hospitals within a 30km radius and lets them choose. If a patient arrives at a facility that cannot handle their risk level, the hospital refers them onward — and CivCare transfers the complete case file with them, so the receiving facility inherits the full picture rather than starting blind. My friend saw two doctors and had to start his story from scratch both times. CivCare breaks that chain.
How the AI Reasons Through It
Why AI and not a rules-based symptom checker?
A referral directory or symptom checklist — the kind most Kenyan health apps use — maps symptoms to responses one at a time: fever → paracetamol, chest pain → hospital. It cannot simultaneously hold a patient's age, allergy profile, self-medication history, and regional disease prevalence and modify the output based on all of them together. It also cannot improve — it gives the same answer to the thousandth patient as it did to the first. My friend would have gotten the same wrong referral every time.
CivCare uses LLM reasoning (Llama 3.3 70B via Groq) because triage is not a lookup — it is a contextual judgment over a patient's full picture. The same chest symptom yields a different risk score for a 65-year-old with hypertension in a malaria-prone county than for a healthy 22-year-old in Nairobi. A decision tree cannot hold that context. An LLM can — and unlike a rules tree, it improves from every doctor verdict.
CivCare isn't one chatbot pretending to do everything. It's a team of specialised AI agents, coordinated by an orchestrator — and the patient experiences them as one caring voice.
- The Orchestrator runs the conversation, asking only the most useful next question and quietly extracting structured clinical facts. It knows when it has enough to route you — and it can never trap you in endless questions: if information is hard to extract (common with mixed Swahili/Sheng), a safety stop routes you with what it has rather than looping forever. True red-flag emergencies skip the questions entirely and escalate immediately. For facility selection, the Orchestrator surfaces all hospitals within a 30km radius and lets the patient choose — because routing a high-risk patient to the wrong facility is a decision too consequential to automate.
- The Triage Agent scores clinical risk (1–100) by applying NEWS2/HEART/Wells-style clinical reasoning — weighing symptom severity, duration, vital sign proxies from the conversation, age, pregnancy status, known conditions, and regional disease prevalence — into a single urgency score the doctor sees immediately. The patient never sees this; the doctor always does.
- The MedScan Agent guards against unsafe self-medication — checking drug interactions, allergy cross-reactions, and counterfeit-drug risk specific to East Africa — and can force a doctor route when it finds a dangerous clash.
- The Records Agent turns messy history and free-text doctor notes into a clean case file, so when a doctor opens a patient card they instantly see the risk score, possible diagnosis, chat summary, allergies, history, and current medications — and can handle each person with the care their background calls for.
And it learns — without ever retraining a model. Every doctor verdict, every accuracy rating, and every evening recovery check-in is cross-referenced against the AI's own original prediction. The system critiques itself, distils a short clinical lesson (prioritising its own mistakes), and feeds that lesson into future conversations. Over time it doesn't just learn what was wrong with a patient — it learns how people actually heal. Continuous improvement, no GPU fine-tuning. Handling low-data edge cases: In a rural Kenyan context the model often has little or no learned history for a rare presentation. Rather than guess, the system fails safe — ambiguous or unfamiliar cases are biased upward in risk and routed to a human clinician instead of being resolved autonomously. As doctors submit verdicts, our mismatch-prioritised loop seeds new lessons fastest for exactly the cases the AI got most wrong, so accuracy improves quickest where the data is thinnest.
Human-in-the-Loop and Responsible Design
CivCare's AI gathers symptoms, scores risk, and predicts a likely diagnosis — but it never confirms a diagnosis or prescribes treatment. That decision belongs entirely to a licensed doctor, because the AI can't perform a physical exam, can't be held accountable for harm, and must never become something a patient self-medicates from.
The biggest risk in health AI is over-reliance (automation bias) — treating a machine's guess as a verdict. We designed it out: the patient never sees their risk score or predicted diagnosis (no panic, no self-medication), and the doctor's verdict is the only output ever acted on. Because that verdict then trains the AI, a wrong AI answer carries no clinical harm — its job is to speed up the queue and inform the doctor, and every mistake is caught by the doctor and becomes a lesson the system learns from.
How We Built It
We started with the frontend, because we wanted to see the whole human journey before writing a single algorithm. We mapped out every screen a patient touches — the first chat, the waiting room, the "I've arrived" moment, the video call, the pharmacy log, the nightly check-in — and the doctor's side too: the live queue sorted by risk, and the full case file that opens when they tap a patient. Building the React patient and doctor portals first gave us the complete picture of what the AI actually needed to deliver.
Then we built the backend to bring those screens to life:
- Backend: FastAPI (Python) on Railway, SQLAlchemy over Supabase Postgres, WebSockets for the live doctor queue, and APScheduler for medication reminders and the evening recovery check-ins.
- The AI brain: Groq-hosted Llama 3.3 70B for conversation and clinical triage reasoning, and Llama 3.1 8B Instant for fast extraction, scoring, and the self-improving loop.
- Consultations & insight: Daily for in-app video, and Recharts for the doctor analytics dashboards.
Challenges We Ran Into
- Getting four agents to work as one mind. A single model answering everything is just a chatbot. Making separate agents hand structured data to each other — triage feeding the doctor's case file, MedScan able to override the route, the records agent summarising for the doctor — without them contradicting each other was the hardest architectural problem we solved.
- Reducing hallucination in a place where it's dangerous. We constrained each agent to a narrow job with a strict output structure, forced the triage logic onto recognised clinical scoring frameworks, and made a human doctor the final authority on every diagnosis and prescription. Additionally, doctors explicitly rate AI accuracy on every verdict — low-rated predictions surface immediately to the RLHF loop so systematic hallucination patterns are caught and corrected before they repeat, not discovered months later.
- Keeping people safe without scaring them. Letting the AI reason like a clinician internally while never showing the patient a diagnosis, yet always escalating a real emergency, took careful, deliberate design.
- Actually closing the loop. Wiring the doctor's verdict and the patient's recovery back into the model's future prompts — not just saving it to a database — was the hard, beautiful part that makes CivCare improve.
What We Learned
The biggest wins didn't come from a smarter model. They came from removing the handoffs where people get lost — carrying records ahead, telling someone exactly where to go, and checking in each evening did more to reduce fear and confusion than any single prediction.
We also learned two things we'll carry forward:
- A system of specialised agents collaborating beats one model trying to reason about everything. Splitting the work made CivCare more accurate, safer, and easier to trust — one giant prompt would only ever be a clever chatbot.
- AI in healthcare must keep a human in the loop. The AI's job is to speed up and inform a doctor, never to replace their judgment. The moment it tries to be the doctor, it becomes dangerous.
What's Next
- Leave no one behind. We are building out full USSD and SMS support so patients with no smartphone and no internet get the exact same care loop — this is our top priority, because they're who CivCare exists for.
- Full referral handoff. When a hospital cannot handle a patient's risk level, a doctor initiates a referral through CivCare that transfers the complete case file to the receiving facility — so the chain of care never resets to zero. The UI is built; backend wiring is next.
- Pilot with a clinic partner using real, consented, anonymised outcomes.
- Expand language coverage and offline-first flows.
- Formally validate the triage risk score with clinical partners.
AI Tools Disclosure
In line with the hackathon rules, we disclose all AI tools used to build CivCare:
- Antigravity IDE and its built-in AI agents (free) — our primary AI-assisted development environment, used to generate, build, and test the codebase.
- Claude Opus 4.8, accessed free via v0 by Vercel (free) — used for problem-statement research, system reasoning, and architecture review.
- Claude Sonnet 4.6 (free) — for generating the synthetic symptoms used to test the triaging system.
- Groq-hosted Llama 3.3 70B and Llama 3.1 8B Instant — the AI models that power the product itself.
All code was assembled and directed by the team.
Built With
- africas-talking
- apscheduler
- daily
- fastapi
- groq
- llama
- m-pesa
- postgresql
- python
- railway
- react
- recharts
- sqlalchemy
- supabase
- vercel
- websockets
Log in or sign up for Devpost to join the conversation.