Ask a general chatbot how to treat malaria in a child and you will usually get a sensible answer. It might even be correct. But it will rarely be the answer a Kenyan clinical officer would give, because it was not written from the Kenyan guidelines, and it will not tell you which document it came from.

That gap is why we built Tabibu Health the way we did. Tabibu is a health assistant for Kenyans, in English, Kiswahili and Sheng. The rule behind every clinical answer is simple: if Tabibu can't point to the Kenyan document it came from, it shouldn't say it.

This post walks through how that rule is enforced, from the documents we ingest to the citation chips on screen, and where it still falls short.

Start with the right documents

Grounding is only as good as what you ground in. Tabibu's knowledge base is built from a manifest that lists every source with its publisher, URL, licence and a precedence tier. The ingest script refuses any source that is missing one of those. The manifest also keeps a denylist: an unlicensed naturopathy PDF that slipped into an early build was purged in August 2026 and can't come back.

Today the production knowledge base holds 7,519 chunks. The biggest Kenyan sources are:

Bar chart of chunks per source: Kenya National Medicines Formulary 2023, 1,544; MoH Clinical Guidelines for Levels 2 and 3, 1,214; Quality Obstetric and Perinatal Care, 789; NASCOP Integrated HIV, STI and Viral Hepatitis Guidelines 2026, 609; National Family Planning Guidelines 7th edition 2025, 603; NCD Strategy, 221; Kenya Essential Medicines List 2023, 203

Alongside those are the 2013 national immunisation policy, the Basic Paediatric and Obstetric Protocols, five NTLD-P tuberculosis and lung-health documents, the Kenya Malaria Policy 2024, the Mental Health Policy, and nine Kenyan statutes and regulations, including the Health Act, the Digital Health Act and the Social Health Insurance Act. Four WHO documents make up about 13% of the chunks: the Essential Medicines List, IMCI and two mhGAP mental health guides.

Choosing sources also meant choosing what to leave out. The current national malaria treatment guideline link was dead when we ingested, and the 2010 edition we could find has outdated dosing. We left it out rather than risk teaching the model old doses. When newer guidance replaced older documents (the 2022 HIV guidelines, an older WHO list, an earlier version of the Health Act), we removed the old versions from the production collection instead of hoping the ranking would sort it out.

Every chunk carries its provenance: source title, publisher, URL, page or section, publication date, last reviewed date, precedence tier and licence. A chunk without provenance is dropped at query time. It never reaches the model.

Find the right passage, in the user's language

Chunks are about 1,400 characters, with 180 characters of overlap. Headings are carried down into each chunk and tables are never split, because a dosing table cut in half is worse than no table at all.

When a question comes in:

  1. Kiswahili and Sheng are translated first. If the question contains Swahili or Sheng markers, a small model translates it to English at temperature 0 before searching. On our held-out test questions, this raised the share of Swahili questions with the right passage in the top 5 from 31% to 54%. If translation fails or times out, we search with the original text.
  2. Dense and keyword search are combined. We pull 30 candidates by embedding similarity, rescore them with BM25, and merge the two rankings with reciprocal rank fusion. The top 5 go to the model. Keyword matching matters for drug names and acronyms (SHIF, KEPI, PMTCT) that embeddings blur together.
  3. Weak matches are cut. Passages below a similarity score of 0.45 are dropped. We picked that number on a development split. Between 0.25 and 0.45, recall barely moved, but the number of out-of-scope questions that still got passages fell from 15 of 15 to 8 of 15. That is a small test set of 15 questions, and 8 still slip through, which is why the labelling and refusal rules below exist.

Animated diagram: a Kiswahili question is translated to English, searched by dense and keyword search, fused into a top 5 with weak matches below 0.45 dropped, re-ranked so Kenyan guidelines sit above WHO, then answered with a citation that opens a sources drawer

One question through the pipeline: translation, hybrid search, the 0.45 cut, Kenyan-first ranking and a checked citation. A simplified illustration, not a recorded trace.

Kenyan guidance outranks everything else

A WHO document and a Kenyan guideline can disagree, usually because Kenya has adapted a recommendation to local drugs, supply or resistance patterns. For a Kenyan patient, the Kenyan document governs. So retrieval scores are weighted by who wrote the source:

PRECEDENCE_WEIGHT = { PrecedenceTier.KE_NATIONAL_GUIDELINE: 1.00, # MoH national guidelines PrecedenceTier.KE_PROGRAMME_GUIDELINE: 0.92, # NASCOP, NTLD-P, KEPI ... PrecedenceTier.KE_STATUTE: 0.85, # Acts and regulations PrecedenceTier.WHO: 0.78, PrecedenceTier.OTHER: 0.60, } 

There's also a hard rule on top of the weights: if a Kenyan national guideline scores within 0.12 of the best non-Kenyan passage, every Kenyan passage is ranked above every foreign one. The model is told the same thing in plain words: when sources disagree, the Kenyan one governs, and always name the source and its year.

Cite the passages, label everything else

The instruction the model gets with its search results is short:

Use the passages below where they answer the question, and cite them inline as [1], [2] in the order given; name the source and its year. Where a Kenya national guideline passage and a WHO passage disagree, the Kenyan one governs.

Not every health question is in a guideline, though. "Why do I feel tired after lunch?" deserves an answer. When the passages don't answer the question, Tabibu can give general information, but it must open that part with a visible label: General health information, not from Kenyan guidelines, and cite nothing for it. If the model leaves the label off a substantial general answer, code adds it.

Anything specific to Kenya (SHA cover, the immunisation schedule, essential medicines, prices, helplines) is different. It has to come from a retrieved passage or a tool. If nothing relevant is retrieved for a question like that, Tabibu doesn't improvise. It says:

I could not find this in the Kenyan clinical guidelines I have access to, so I am not going to guess. Please speak to a pharmacist, clinical officer or doctor…

Emergencies skip all of this. Before any model runs, a deterministic check in English, Kiswahili and Sheng looks for red flags across 15 categories, such as chest pain, heavy bleeding in pregnancy or suicidal thoughts. A match returns a fixed message pointing to 999 or 112 (or the local numbers for users outside Kenya). We test that check against 261 red-team cases, because an emergency is the worst place for a model to be creative.

Check every citation in code

Telling a model to cite is not the same as getting real citations. Models invent plausible URLs, cite a document they were never shown, or attach a correct link to the wrong claim.

So we don't trust the model's citations. During each turn, every passage that retrieval returns is recorded in a per-turn ledger. After the model answers, an output check compares every link in the answer against that ledger. A link whose host and path weren't retrieved in that turn is a violation. The link is removed (the words stay, the URL goes) and the answer is checked again before it's sent.

The sources the user sees don't come from the model's text at all. They come from the ledger: title, publisher, year, URL, a short snippet and the dates. They're sent to the app as a separate event once the answer has finished.

Show the sources where people read

In the app, each [1], [2] marker becomes a small tappable chip, but only if it matches a real source from the ledger. A marker with no matching source stays plain text. Tapping one opens a sources drawer (from the right on desktop, from the bottom on mobile) with the publisher, the document title linked to the original, the publication and review dates, and a snippet from the source. The drawer's labels and dates follow the user's language, English or Kiswahili.

General answers carry a "General information" badge instead, so you can tell at a glance which answers come from Kenyan guidelines and which don't.

Where it still falls short

Being honest about the gaps is part of the point.

  • Retrieval isn't good enough yet. On our first baseline (2 October, development copy of the corpus), precision at 5 was 37.7% against a target of 60%. That measures how many of the top 5 passages are relevant. The biggest cause wasn't the tuning but gaps in the corpus: the answer simply wasn't in the documents we had. A different measure, whether the expected source appears anywhere in the top 5, is now 77% on our held-out test questions against the current collection. But only 62% of the expected facts make it into the top 5, so there's still a lot of room.
  • A citation bug we only found by measuring. In one eval run, 15 of 83 citations failed to resolve, and every one pointed to the same document, the Social Health Insurance (General) Regulations. Its URL contains parentheses, "(General)", and our own link-matching pattern cut the URL at the first closing parenthesis, so the citation never matched what was retrieved. That's still open, and it's the next fix.
  • Grounded doesn't automatically mean safe. The Formulary is a real Kenyan source, and in October we found Tabibu could quote prescription doses from it, for drugs like morphine and methotrexate. The citations were accurate. The doses still shouldn't go to a member of the public without a clinician. We widened the rule-based dose check on 5 October, and its regression tests use the exact sentences that leaked. It lowers the chance of a quoted dose; a rule-based check can't guarantee it.
  • Page numbers aren't shown yet. Every chunk knows its page or section, and the model sees it, but the drawer doesn't display it. That's next.
  • No clinician-graded citation audit yet. Our checks prove that a cited document was actually retrieved. They don't prove that the document supports the sentence it's attached to. That needs clinicians, and it's the next step.

On Saturday, 28 November, I'll publish the full numbers: how we evaluate Tabibu, what the model comparisons showed, and the failures we found along the way.

If you're building health AI for a country whose guidelines are not the internet's default, I'd like to hear how you handle grounding and conflicting sources. Message me on LinkedIn. You can try Tabibu at tabibu.org.