Skip to main content

Design Assessment Against Published Approaches

What this page is, and is not

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.

Scope of the evidence

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:

StrategyMechanismExample
Synonym expansionSNOMED synonyms via a pre-built cachevoorhuidvernauwing → Nauwe voorhuid
IS_A hierarchical expansionWalk up the ancestor tree (bounded depth), trying each ancestor through the taxonomyspecific subtype → parent condition → department
Finding-site routingBody 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.

Embedding-model lineage

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.

MetricValueSource
Pass rate99.0% (296/299)thesis Chapter 4, Table 4.1
Entity recall0.932 (95% CI [0.916, 0.965])thesis Chapter 4, Table 4.2
Condition-to-department routing46/46condition-department category
SNOMED terminology questions33/33SNOMED category
Median response time7,829 msthesis 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:

MetricWhat It Measures
NDCG@5Whether relevant documents appear at the top of results
MRRHow quickly the first relevant document appears
Precision@5What fraction of top-5 results are relevant
Recall@5What fraction of relevant documents appear in top-5
Entity RecallWhether 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​

  1. Direct OpenAI routing for the main RAG response
  2. True token streaming enabled by default (the first words appear much sooner)
  3. Asynchronous follow-up suggestions, decoupled from the critical path
  4. Slimmed intent prompt (fewer examples, roughly half the tokens)
  5. 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​

Embedding and Retrieval Quality​

Context Filtering and Enrichment​

Reranking​

Knowledge Graph RAG​

Medical Terminology and ColBERT​

RAG Surveys​