PROJECT · RETRIEVAL / LLM
HAGA FolderAssistent
Built for HagaZiekenhuis through the Gezond Verstand think tank. Hospitals hand out patient information leaflets (folders, in Dutch) about everything from a gastroscopy to recovering after hip surgery. This makes a collection of 1,600+ of those leaflets searchable the way a patient would actually ask: in plain language, with answers that come straight from the leaflets and say which one they came from. It started as a prototype and is now running as a pilot at the hospital.
01 · THE PROBLEM
The information patients need usually exists. It is just buried in one of 1,600 leaflets, written in medical register. A patient searches for an everyday phrase; the leaflet says gastroscopie. Plain keyword search misses the paraphrase. Pure embedding search has the opposite weakness: it can glide past the exact terms that matter in this domain, like drug names, department names and procedure names, where a near-match is simply wrong.
On top of that, this is a medical setting. An answer that sounds right isn't good enough; every answer has to be traceable to a source document, and the system has to say so when the leaflets don't cover a question.
02 · THE APPROACH
It's in a live pilot at the hospital, so this stays at the level of the approach rather than the production internals.
INGESTION
Leaflets → text extraction → chunks that keep their source metadata (which leaflet, which section)
KEYWORD INDEX
Exact terms, names, abbreviations
EMBEDDING INDEX
Meaning and paraphrase
QUERY ENRICHMENT
The question is first turned into a fuller, leaflet-style draft, which is what actually gets searched. This closes the gap between how a patient asks and how a leaflet is written.
RETRIEVAL + FUSION
Both indexes are queried in parallel and their two ranked lists merged, by rank, into one candidate set
GENERATION
A language model answers using only the retrieved text, and cites the leaflets it drew from
03 · WHY IT WORKS THIS WAY
Hybrid retrieval, not one or the other. Dutch medical text splits neatly into two failure modes. Keyword search wins when the query contains the exact term, like a medicine, a department or an abbreviation. Embeddings win when the patient describes the thing instead of naming it. Running both and merging the results covers each side's blind spot with the other's strength.
Rank fusion instead of score mixing. A keyword score and a cosine similarity live on different scales, and any weighted average of the two needs constant re-tuning. Fusing on rank, the position each document takes in each list, lets the two retrievers combine without calibrating their scores against each other.
Closing the vocabulary gap. A five-word patient question sits far from a formal leaflet paragraph in embedding space. Drafting a hypothetical answer first (full sentences, in roughly the register the leaflets use) and searching with that lands much closer. The draft is never shown to the user; it exists only to make retrieval better.
Grounded answers with sources. The generation step is deliberately boring: answer from the retrieved text, name the leaflet, and refuse when the leaflets don't cover the question. In a patient-facing system, a confident guess is worse than no answer. That refusal-first behaviour is exactly the property a hospital needs before it will trust a system like this in a pilot.