Retrieval Improvements Roadmap
This document describes improvements to the retrieval pipeline based on findings from the project's February 2026 A/B experiment (see Query Decomposition) and gap analysis. Query decomposition (item 3) was implemented on 2026-02-17 behind a feature switch -- see ADR-0032. The embedding-migration item (item 1) has now seen two completed migrations: BGE-M3 in February 2026 (ADR-0033) and text-embedding-3-large in April 2026 (ADR-0048). Item 2 remains planned.
1. Embedding Model Migrations
The original BGE-M3 migration was completed in February 2026 (ADR-0033). It was subsequently superseded by a second migration to OpenAI text-embedding-3-large (1,536-dim, OpenAI API) in April 2026 — see ADR-0048 and @openai2024embeddings. See Embedding Models for the current state. BGE-M3 still survives in the stack as the optional ColBERT reranker model only.
The original embedding model (nomic-embed-text, 768 dimensions) was primarily trained on English data with limited multilingual coverage. It was not benchmarked on MTEB-NL (the Dutch embedding benchmark), making its Dutch retrieval quality unknown. The A/B experiment revealed that structurally similar Dutch medical queries could produce dangerously similar embeddings, contributing to semantic cache contamination.
Migration Summary
| Property | nomic-embed-text (initial) | BGE-M3 (Feb–Apr 2026) | text-embedding-3-large (current — ADR-0048) |
|---|---|---|---|
| Dimensions | 768 | 1,024 | 1,536 (truncated from 3,072) |
| Context Window | 8,192 tokens | 8,192 tokens | 8,191 tokens |
| Languages | English-primary | 100+ languages | Strong multilingual |
| Provider | Ollama | Ollama | OpenAI API |
| Cost | Free | Free | $0.13 / 1M tokens |
| Retrieval Modes | Dense only | Dense + Sparse + ColBERT | Dense only (ColBERT delegated to BGE-M3) |
| Architecture | nomic-bert | XLM-RoBERTa | OpenAI proprietary |
| Status | Replaced Feb 2026 | Replaced Apr 2026 (still used for ColBERT) | Current |
Outcomes
- Better-documented Dutch retrieval: BGE-M3 had a published Dutch benchmark result, whereas nomic had none
- Improved semantic cache discrimination: Higher-dimensional embeddings produce more distinctive vectors for similar-but-different queries
- Better multilingual support: Improved cross-lingual embedding quality (per the model documentation and ADR-0048)
- ColBERT support: Future option for late interaction retrieval (multi-vector matching per token)
2. UMCU Dutch Medical Terminology Enrichment
Problem
The taxonomy at the time of writing contained only a few dozen manually curated aliases per category (conditions, treatments, examinations). While these cover the most common patient queries, they miss thousands of Dutch medical terms, patient-friendly synonyms, and colloquial expressions. The golden question gap analysis revealed that major conditions (astma, COPD, epilepsie, endometriose, Crohn, Alzheimer) and departments (Gastro-enterologie, Reumatologie, Infectiologie, Vaatchirurgie) had zero test coverage, partly because the taxonomy lacks the aliases patients would use to describe these conditions.
Proposed Solution
Integrate Dutch medical terminology from the UMCU Dutch Medical Concepts repository, which provides structured access to:
| Source | Semantic Types |
|---|---|
| UMLS (MeSH, MedDRA, ICD-10, ICPC) | Diseases, procedures, anatomy |
| SNOMED CT (Dutch edition) | Clinical terms, findings, procedures |
| HPO (Human Phenotype Ontology) | Rare diseases, phenotypes |
Together these provide hundreds of thousands of Dutch concept names.
What This Enables
The UMCU data includes patient-friendly Dutch synonyms -- exactly the vocabulary gap our system needs to bridge. For example:
| Patient types... | UMCU provides... | Maps to... |
|---|---|---|
| "zuurbranden" | pyrosis, brandend maagzuur, gastro-oesofageale reflux | Gastro-enterologie |
| "spataders" | varices, varicosis, varikeuze venen | Vaatchirurgie |
| "vergeetachtig" | geheugenstoornis, cognitieve achteruitgang, dementie | Geriatrie / Neurologie |
| "benauwdheid" | dyspnoe, kortademigheid, respiratoire insufficiëntie | Pneumologie |
Integration Architecture
The planned flow: generate Dutch concept tables from the UMCU repository (using the free UMLS and SNOMED CT Dutch sources), filter them to diseases, procedures and examinations, curate a subset of roughly two thousand of the most relevant terms, merge them into the hospital's alias configuration, and let the existing term resolver use the larger alias set.
Licensing
Both data sources are free:
- UMLS: Free license from NLM (US National Library of Medicine). Individual registration at UTS.
- SNOMED CT: Free for Belgian healthcare organizations via MLDS (Belgium is an IHTSDO member state).
Implementation Steps
- Register for UMLS (UTS account) and SNOMED CT (MLDS Belgian affiliate)
- Obtain the UMCU concept-table generator and produce the concept tables
- Filter for relevant semantic types: diseases/conditions, procedures/treatments, examinations
- Curate a subset of about two thousand of the most relevant terms (cross-reference with the department list)
- Merge into the hospital's search aliases and taxonomy alias maps
- Validate with the golden evaluation (ensure no false-positive routing)
- Document the data lineage and update this page
Expected Impact
- Many more condition/treatment aliases: with patient-friendly Dutch synonyms (a planning estimate, not a measured result)
- Better entity resolution: More queries correctly route to the right department
- Reduced "information not found" responses: Patient vocabulary matches expanded taxonomy
- Improved query enrichment: More terms available for the existing term-resolution step
Risks
- False positives: Overly broad matching could route queries to wrong departments
- Maintenance burden: Periodic updates needed when UMLS/SNOMED releases new versions
- Curation effort: Raw data needs manual filtering to avoid irrelevant medical jargon
Effort Estimate
A planning estimate of a few working days for registration, data import, curation, integration and validation.
3. Query Decomposition for Multi-Hop Reasoning
This improvement was implemented on 2026-02-17. See ADR-0032: Query Decomposition for full implementation details. It is behind a feature switch (off by default).
Problem
Multi-hop queries require traversing multiple entity relationships to construct an answer. For example:
"Welke dokter behandelt rugpijn op campus Sint-Jan?"
This requires three traversals: rugpijn → Fysische Geneeskunde (condition→department) → a doctor (department→doctor) → Sint-Jan (doctor→campus). The current pipeline rewrites this into a single query template, which may lose specificity or fail to capture all required entities.
The February 2026 A/B experiment (self-reported; see Query Decomposition) showed that multi-hop queries (2+ hops) had the lowest entity recall among non-safety categories, with hybrid retrieval improving 2-hop queries over the vector-only baseline -- but there is still room for improvement.
Proposed Solution
Implement query decomposition: detect multi-hop queries during intent classification and split them into sequential sub-queries, each targeting a single relationship traversal.
How It Works
Take the original query "Welke dokter behandelt rugpijn op campus Sint-Jan?". A small model splits it into three sub-queries: "Welke afdeling behandelt rugpijn?", "Welke dokters werken bij die afdeling?" and "Welke van die dokters werkt op campus Sint-Jan?". They execute in order against the taxonomy: the first resolves the condition to a department, the second lists that department's doctors, the third filters by campus. The sub-query results are merged and fed to the language model for response generation.
Implementation Architecture
Intent classification routes simple queries (0-1 hops) through the existing pipeline. Multi-hop queries (2+ hops) go to decomposition: a small model generates sub-queries with schema-validated structured output, each sub-query executes independently (taxonomy lookup or vector search), results are merged with deduplication, and the combined context goes to LLM generation.
When to Decompose
Not all queries benefit from decomposition. The system should decompose when:
- Multiple entities detected: Query contains 2+ entity types (e.g., condition + campus)
- Graph hops > 1: Intent classification detects a multi-hop pattern
- Compound question structure: Question contains "en", "welke...op welke", "waar...bij wie"
Simple queries (single entity, direct lookup) should bypass decomposition entirely.
Expected Impact
- Higher entity recall on multi-hop queries (the hypothesis at design time; the later outcome is discussed in Query Decomposition)
- Better 3-hop coverage: the weakest hop category in the February 2026 experiment
- More complete answers: each sub-query captures entities that a single query might miss
- Composable reasoning: future foundation for agentic RAG patterns
Risks
- Latency: an additional LLM call plus multiple lookups per multi-hop query
- Error propagation: if sub-query 1 returns the wrong department, sub-queries 2-3 chain the error
- Over-decomposition: simple queries might be unnecessarily split, reducing quality
- Complexity: requires robust fallback logic when sub-queries fail
Effort Estimate
A planning estimate of a few working days for implementation, testing and integration.
Priority Order
Based on impact-to-effort ratio and the principle of fixing fundamentals first:
| Priority | Improvement | Impact | Effort | Prerequisite |
|---|---|---|---|---|
| Implemented (Feb 2026, ADR-0033) | ||||
| Implemented (Apr 2026, ADR-0048) | ||||
| 2 | UMCU terminology enrichment | Medium-High | L | UMLS/SNOMED registration |
| Implemented (2026-02-17; schema-validated output helper since 2026-05-12) |
Dependency Chain
- Embedding migrations (1a, 1b) are both complete: BGE-M3 (Feb 2026) replaced nomic-embed-text, then text-embedding-3-large (Apr 2026, ADR-0048) replaced BGE-M3. BGE-M3 is retained as the ColBERT reranker model only. No retrieval-quality gain figures are claimed here: they were not measured on a dated, documented question set.
- UMCU terminology (2) would enhance the existing query rewriting and taxonomy resolution, is independent of the embedding model choice, and can run in parallel with (1) but be validated after it.
- Query decomposition (3) depends on accurate entity resolution (it benefits from 2) and on reliable taxonomy traversal, so it was implemented last.
Success Criteria
The criteria below were drafted before the embedding migration and the latency-optimisation sprint and have since been overtaken. The table reports the project's own self-reported results from one definitive evaluation run on 2026-03-21 against the 302-question golden set (version 3.6; see thesis Chapter 4): 296 of 299 scored questions passed (99.0%), with median end-to-end latency of 7.8 s. The golden-question score measures entity recall and must-refuse behaviour only; it is not evidence of answer correctness or grounding, and it was produced by the project itself, not independently. In particular, a pass rate on this set did not prevent the June 2026 dosing incident (see the Safety overview). The embedding and decomposition items have shipped; the remaining roadmap item is the UMCU enrichment.
| Original criterion | Status (self-reported) | Value from the 2026-03-21 run |
|---|---|---|
| Golden evaluation pass rate ≥ 90 % (146 questions, v2.4) | Met (overtaken by v3.6) | 99.0 % (296/299) |
| Entity recall ≥ 0.92 | Met | 0.932 (95% CI [0.916, 0.965]) |
| Multi-hop entity recall ≥ 0.93 | Met | multi-hop category 37/37 |
| Multilingual entity recall maintained at 1.00 | Met | multilingual category 16/16 |
| Median response time under 16 seconds | Met | P50 7,829 ms, P90 12,182 ms, P99 20,925 ms |
(A further criterion, "no safety regressions", is deliberately not reported here: the golden set's refusal category is not an adequate safety measure.)
References
- Banar, N., & Lotfi, E. (2025). MTEB-NL and E5-NL: Embedding benchmark and models for Dutch. arXiv preprint, arXiv:2509.12340. https://arxiv.org/abs/2509.12340
- Chen, J., et al. (2024). BGE M3-Embedding: Multi-lingual, multi-functionality, multi-granularity text embeddings through self-knowledge distillation. arXiv preprint, arXiv:2402.03216. https://arxiv.org/abs/2402.03216
- Gao, L., et al. (2022). Precise zero-shot dense retrieval without relevance labels (HyDE). arXiv preprint, arXiv:2212.10496. https://arxiv.org/abs/2212.10496
- Tan, S., et al. (2024). UMCU Dutch Medical Concepts (open-source terminology tooling).