Design Assessment Against Published Approaches
This page maps the ZOL retrieval pipeline onto techniques described in the published literature, and records the project's own evaluation results with their limits. It makes no claim that the pipeline is better than other systems: the project has not run a dated, sourced head-to-head comparison against any other system. Where figures appear they are self-reported: produced by the project's own question sets and scoring, not independently audited. The system is a pilot built for ZOL; this documentation is not an official ZOL publication.
The evaluation figures on this page come from the project's golden evaluation set (version 3.6, 302 questions), in a definitive baseline run on 2026-03-21 (see thesis Chapter 4). That score measures entity recall and must-refuse behaviour only. It is not evidence of answer correctness or grounding, and it did not prevent the dosing incident of 1 June 2026 (see the Safety overview). The pipeline description reflects the pilot as documented at that time, with embeddings from OpenAI text-embedding-3-large (@openai2024embeddings) and SNOMED CT integration (@snomed_international).
Overview
The pipeline combines several techniques that are described in the literature: contextual retrieval (Anthropic, 2024), hybrid search with Reciprocal Rank Fusion (@cormack2009rrf), cross-encoder reranking (@nogueira2019passagererank), optional ColBERT late-interaction reranking (@khattab2020colbert), and knowledge-graph-style authority routing (@sarmah2024hybridrag, @edge2024graphrag). A SNOMED CT terminology layer (Belgian edition, Dutch descriptions) supports entity resolution for Dutch medical terms. The sections below say, for each, what is implemented and what the project has (and has not) measured.
Pipeline Architecture
Techniques implemented
1. Contextual embeddings (Anthropic's Contextual Retrieval)
Status: implemented.
Each chunk is embedded as enriched text: a generated chunk context, canonical questions, and the raw text. This implements the technique in Anthropic's Contextual Retrieval, for which Anthropic reports a 35% reduction in top-20 retrieval failures from contextual embeddings and 49% when combined with BM25 (Anthropic's own benchmark; the project has not reproduced it on its own corpus). The context and questions are generated during ingestion and concatenated with the chunk text at embedding time.
2. Hybrid search with Reciprocal Rank Fusion
Status: implemented (ADR-0020).
Dense vector search (semantic) and BM25 keyword search (lexical) are combined with Reciprocal Rank Fusion with k=60 (Cormack et al., 2009). RRF is score-agnostic, which is why it was preferred to a weighted linear combination (see Hybrid Search Strategy).
3. Cross-encoder reranking
Status: implemented (ADR-0024).
After retrieval and fusion, results pass through Jina Reranker v2 (API), with BGE-reranker-v2-m3 as a local fallback. The cross-encoder jointly scores each query-document pair, which is typically more accurate than bi-encoder similarity. An escalated ("Think Harder") mode retrieves more candidates and reranks to a wider final set. Taxonomy results are pinned (excluded from reranking and prepended after), since their relevance is determined by entity matching rather than text similarity. The project's own Dutch reranker test is in Reranking.
4. Keyword rescue
Status: implemented (a project-specific addition).
When specific query terms (long, not stop words) do not appear in any retrieved result, a direct content search fetches a few additional chunks. This handles the long tail of rare medical terms where neither embeddings nor BM25 produce relevant results.
5. Taxonomy with authority routing
Status: implemented.
PostgreSQL taxonomy entities (doctors, departments, conditions, treatments, campuses) provide structured relationships. For department-routing questions (which department handles a condition), the taxonomy is treated as the authoritative source over vector search when they conflict, because vector search can surface tangential mentions of conditions in unrelated department pages. This follows the general direction of GraphRAG-style work and adds an explicit authority rule: taxonomy over vector for structural routing, vector over taxonomy for content details.
On the project's golden set, all condition-to-department questions passed in the 2026-03-21 run (self-reported; entity recall and must-refuse only), including a small group tagged as needing taxonomy routing to be answered correctly.
6. Multi-signal metadata boosting
Status: implemented.
Beyond similarity and reranking, the pipeline applies domain-specific boost signals based on enriched document metadata (category relevance, conversation continuity, content keyword presence, authority dampening, and more). See Stage 6: Metadata Boosting.
7. Page summary context
Status: implemented.
Page summaries (generated during ingestion) are not embedded; they are prepended to the first chunk of each document at context assembly time. This gives the model document-level context without adding summarisation noise to the embedding vector.
8. SNOMED CT medical terminology integration
Status: implemented (always-on).
The pipeline integrates the SNOMED CT Belgian edition (roughly 356 thousand concepts and 656 thousand Dutch description rows; see @snomed_international and @bodenreider2004umls for the parent UMLS framework) for terminology expansion at query time. Three resolution strategies operate in cascade:
| Strategy | Mechanism | Example |
|---|---|---|
| Synonym expansion | SNOMED synonyms via a pre-built cache | voorhuidvernauwing → Nauwe voorhuid |
| IS_A hierarchical expansion | Walk up the ancestor tree (bounded depth), trying each ancestor through the taxonomy | specific subtype → parent condition → department |
| Finding-site routing | Body structure → department mapping (curated) | structure of urethra → Urologie |
This follows the controlled-vocabulary query-expansion approach reviewed by Bhogal et al. (2007) and applied to biomedical queries by BMQExpander (Mao et al., 2024). See SNOMED CT Terminology for the architecture and the project's small evaluation.
9. ColBERT multi-vector reranking (optional)
Status: implemented, off by default.
An optional extra reranker uses BGE-M3 in ColBERT mode for late-interaction scoring: per-token embeddings scored by MaxSim (for each query token, the best-matching passage token, summed). This preserves fine-grained term-level matching, which is relevant for Dutch compound words, similar doctor surnames, multi-entity queries, and colloquial-to-clinical terminology mismatch. It runs after the primary cross-encoder. The literature suggests modest gains from late interaction; the project has not measured the effect on its own data, which is why it is off by default. See Reranking.
Embedding model: text-embedding-3-large
The pilot uses OpenAI text-embedding-3-large (3,072 native dimensions, truncated to 1,536 so pgvector's HNSW index can hold them) via the OpenAI API. The selection reasoning (Dutch quality on published benchmarks, removal of a self-hosted service, operating cost) is recorded in ADR-0048 and Embedding Models. Third-party Dutch-benchmark results (MTEB-NL; Banar & Lotfi, 2025) informed the choice; this page does not reproduce or rank benchmark scores, and the project has not run its own comparison of embedding models on its Dutch medical content.
The system migrated through three embedding models: nomic-embed-text (768d, ADR-0005) → BGE-M3 (1,024d, ADR-0033) → text-embedding-3-large (1,536d, ADR-0048). The first two migrations were quality-driven; the third was driven primarily by voice-channel latency (the cost of running the local embedding model on CPU) and removed an on-premises service.
Possible improvements
These are ideas, not commitments, and no figure below has been measured by the project.
- Enable ColBERT reranking. Implemented but off. It would need empirical validation on the golden set before use, and it adds latency.
- Deeper SNOMED IS_A expansion. The current expansion walks a few levels up the ancestor tree. Deeper traversal, or combining it with finding-site routing, could resolve additional edge cases.
- Dutch-specific fine-tuned embedding model. The MTEB-NL paper introduced E5-NL models fine-tuned for Dutch (see also @muennighoff2022mteb). Since the pilot already uses a hosted embedding API, the question is whether a possible small gain justifies a new self-hosted dependency.
- Late chunking. Late chunking embeds entire documents first and then splits the embeddings. The contextual-embedding approach already addresses the same problem, so these are competing solutions.
- Adaptive embedding dimensions. text-embedding-3-large supports native dimension reduction (Matryoshka embeddings); the 1,536-dimension truncation is already used for index compatibility.
Evaluation results (self-reported)
The system is evaluated on the project's 302-question golden evaluation set (version 3.6) across 21 categories, with expected entities, expected source pages and safety annotations per question. The denominator of 299 reflects three non-deterministic or cache-test items excluded from the headline rate. Confidence intervals follow @efron1993bootstrap; the broader evaluation methodology draws on @es2023ragas, @thakur2021beir, @voorhees2002philosophy and @manning2008ir.
Results of the definitive baseline run, 2026-03-21
All figures below are self-reported: the project's own 302-question golden set, run on 2026-03-21.
| Metric | Value | Source |
|---|---|---|
| Pass rate | 99.0% (296/299) | thesis Chapter 4, Table 4.1 |
| Entity recall | 0.932 (95% CI [0.916, 0.965]) | thesis Chapter 4, Table 4.2 |
| Condition-to-department routing | 46/46 | condition-department category |
| SNOMED terminology questions | 33/33 | SNOMED category |
| Median response time | 7,829 ms | thesis Chapter 4, Table 4.3 |
These are self-reported figures from one run on the project's own question set, scored by the project itself. The pass rate reflects entity recall and must-refuse behaviour only. Automated-judge scores for faithfulness are not cited here because the judge was silently not running after mid-May 2026, so no valid current figure exists.
Retrieval quality metrics
The evaluation framework tracks ranking-aware retrieval metrics:
| Metric | What It Measures |
|---|---|
| NDCG@5 | Whether relevant documents appear at the top of results |
| MRR | How quickly the first relevant document appears |
| Precision@5 | What fraction of top-5 results are relevant |
| Recall@5 | What fraction of relevant documents appear in top-5 |
| Entity Recall | Whether expected entities appear in the response |
These metrics use the expected source pages from the golden question set as ground truth, with URL prefix matching and graded relevance (a retrieved URL that is a sub-path of the expected URL receives partial credit).
Historical limitation (resolved): Early evaluation reports (before 23 February 2026) showed near-zero ranking metrics. This was a measurement artifact: the golden questions defined expected source pages at a coarse department-page level, while the system correctly retrieved specific sub-pages.
See Golden Questions for the evaluation methodology.
Latency optimisation (ADR-0034)
Profiling in February 2026 found end-to-end response times that were too slow for interactive use. The main causes were the main LLM response (the largest share; since resolved by routing all calls directly to the OpenAI API), a long intent-classification prompt, a blocking follow-up-suggestion step, and retrieval plus reranking (a small share).
Optimisations applied
- Direct OpenAI routing for the main RAG response
- True token streaming enabled by default (the first words appear much sooner)
- Asynchronous follow-up suggestions, decoupled from the critical path
- Slimmed intent prompt (fewer examples, roughly half the tokens)
- Rate-limit retry with exponential backoff
The timings recorded during the sprint were approximations and are not reproduced here; the only dated, method-stated latency figure is the 2026-03-21 baseline run above. See Pipeline Latency for the timing description and configuration choices.
References
Foundational
- Lewis, P., et al. (2020). Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. NeurIPS 2020. Seminal RAG paper.
- Robertson, S. & Zaragoza, H. (2009). The Probabilistic Relevance Framework: BM25 and Beyond. Foundations and Trends in Information Retrieval, 3(4). BM25 scoring function.
- Cormack, G. V., Clarke, C. L. A., & Buettcher, S. (2009). Reciprocal Rank Fusion outperforms Condorcet and Individual Rank Learning Methods. SIGIR 2009. RRF algorithm.
- Karpukhin, V., et al. (2020). Dense Passage Retrieval for Open-Domain Question Answering. EMNLP 2020. Dense retrieval paradigm.
- Malkov, Y. A. & Yashunin, D. A. (2018). Efficient and Robust Approximate Nearest Neighbor Search Using HNSW Graphs. IEEE TPAMI, 42(4), 824–836. HNSW index algorithm.
Embedding and Retrieval Quality
- Chen, J., et al. (2024). BGE M3-Embedding: Multi-Lingual, Multi-Functionality, Multi-Granularity. BGE-M3 is used for ColBERT reranking only, not primary embeddings.
- Banar, N. & Lotfi, E. (2025). MTEB-NL and E5-NL: Embedding Benchmark and Models for Dutch. First comprehensive Dutch embedding benchmark.
- Reimers, N. & Gurevych, I. (2019). Sentence-BERT: Sentence Embeddings Using Siamese BERT-Networks. EMNLP 2019. Foundation for modern sentence embeddings.
- Anthropic. (2024). Introducing Contextual Retrieval. reports a 49% retrieval-failure reduction (Anthropic's own benchmark).
Context Filtering and Enrichment
- Wang, Z., et al. (2023). Learning to Filter Context for Retrieval-Augmented Generation (FILCO). Context filtering to shorten prompts.
- Günther, M., et al. (2024). Late Chunking: Contextual Chunk Embeddings Using Long-Context Embedding Models. Alternative context-preserving approach.
Reranking
- Nogueira, R. & Cho, K. (2019). Passage Re-ranking with BERT. Cross-encoder reranking paradigm.
- Bruch, S., et al. (2023). An Analysis of Fusion Functions for Hybrid Retrieval. ACM TOIS. Systematic comparison of RRF vs. linear combination.
Knowledge Graph RAG
- Peng, B., et al. (2025). Retrieval-Augmented Generation with Graphs (GraphRAG). Comprehensive GraphRAG survey.
- Sarmah, B., et al. (2024). HybridRAG: Integrating Knowledge Graphs and Vector Retrieval. Hybrid KG+vector RAG formalisation.
Medical Terminology and ColBERT
- Bhogal, J., Macfarlane, A., & Smith, P. (2007). A Review of Ontology Based Query Expansion. Information Processing & Management, 43(4), 866–886. BMQExpander pattern for controlled vocabulary expansion.
- Khattab, O. & Zaharia, M. (2020). ColBERT: Efficient and Effective Passage Search via Contextualized Late Interaction over BERT. SIGIR 2020. Late-interaction multi-vector reranking.
- Santhanam, K., et al. (2022). ColBERTv2: Effective and Efficient Retrieval via Lightweight Late Interaction. NAACL 2022. Compressed ColBERT with residual quantization.
- Bodenreider, O. (2004). The Unified Medical Language System (UMLS): Integrating Biomedical Terminology. Nucleic Acids Research, 32(Database), D267–D270. Foundation for medical terminology integration.
RAG Surveys
- Gao, Y., et al. (2024). Retrieval-Augmented Generation for Large Language Models: A Survey. Comprehensive RAG taxonomy (Naive/Advanced/Modular).
- Fan, W., et al. (2024). A Survey on RAG Meeting LLMs: Towards Retrieval-Augmented Large Language Models. Current landscape and future directions.