Evaluation
Tested on 60 sample questions with known correct answers (a “gold set”). The main figures are for the setup in use, dense retrieval. Hybrid search, which scored lower, is shown beside them for comparison. Out-of-scope questions are scored separately on whether they were refused: a system tuned only to find answers will answer everything, even questions it should decline.
gemini-embedding-001 · top_k=5 · min_score=0.655 · run 2026-08-05T03:08:04Z
End to end, through the agent
The score threshold alone refuses 75% of out-of-scope questions. A higher threshold refuses more of them, but it also starts declining questions it should answer (see the threshold sweep below). The ones that get through are clearly on topic: they ask for a diagnosis, a drug dose or a product recommendation. A similarity score can't tell these apart from a fair question about the same blood marker. The answer-writing step can, and in this test it declined all of them.
gemini-2.5-flash · zero hallucinated citations: the harness asserts every cited id was in the retrieval result
The in-scope questions it declined all ask for a personal diagnosis. The search found the right brief (HbA1c is the brief for “am I prediabetic”), and declining to diagnose is also the right call. They count as misses only because the gold set checks retrieval, not answers:
- lay-02 am I prediabetic — model_declined
- lay-05 is my thyroid underactive — model_declined
- lay-16 my periods have stopped and I get hot flushes — model_declined
Why hybrid retrieval was dropped
Hybrid search is the usual recommendation, and this demo was first built with it. But testing different weights for the keyword part (BM25) showed it never helped here: the more weight it got, the worse the results. BM25 locks onto a word that many briefs share, such as “cholesterol”, and pushes all of them above the one that answers the question. The code is still there, but it is off by default.
| BM25 weight | top-1 | MRR |
|---|---|---|
| dense-only | 96% | 0.979 |
| 0 | 96% | 0.979 |
| 0.1 | 96% | 0.979 |
| 0.2 | 94% | 0.969 |
| 0.3 | 92% | 0.958 |
| 0.4 | 90% | 0.944 |
| 0.5 | 90% | 0.944 |
| 0.7 | 90% | 0.939 |
| 1 | 90% | 0.938 |
By case type
Results by question type. Each type is designed to catch a different kind of failure. The exact row settled the hybrid question: keyword search is meant to help with exact names, but dense retrieval already finds every one of them.
| case type | n | dense (shipped) | hybrid |
|---|---|---|---|
| confusable | 20 | 90% | 85% |
| exact | 12 | 100% | 100% |
| lay | 16 | 100% | 88% |
| oos | 12 | 75% | 75% |
Threshold sweep
Why min_score is 0.655 and not a rounder number. A higher threshold refuses more out-of-scope questions, but it also starts declining questions it could have answered. The chosen value gives the best combined score.
| threshold | answered correctly | correctly refused | combined |
|---|---|---|---|
| 0.51 | 96% | 8% | 78% |
| 0.53 | 96% | 17% | 80% |
| 0.54 | 96% | 17% | 80% |
| 0.56 | 96% | 17% | 80% |
| 0.57 | 96% | 25% | 82% |
| 0.59 | 96% | 33% | 83% |
| 0.60 | 96% | 33% | 83% |
| 0.62 | 96% | 42% | 85% |
| 0.63 | 96% | 58% | 88% |
| 0.65 | 94% | 75% | 90% |
| 0.66 | 94% | 75% | 90% |
| 0.68 | 92% | 75% | 88% |
| 0.69 | 83% | 92% | 85% |
| 0.71 | 79% | 100% | 83% |
| 0.72 | 71% | 100% | 77% |
| 0.74 | 67% | 100% | 73% |
| 0.76 | 48% | 100% | 58% |
| 0.77 | 38% | 100% | 50% |
| 0.79 | 21% | 100% | 37% |
| 0.80 | 8% | 100% | 27% |
| 0.82 | 0% | 100% | 20% |
Remaining failures (5)
Shown in full, not hidden. A test set with zero failures has usually been edited to fit the system, not the other way round.
- conf-05confusablewhich liver enzyme tells me whether a high ALP is bone or liverexpected GGT · got ALP, GGT, ALT · best cosine 0.816
- conf-10confusablethe iron test that is not thrown off by inflammationexpected Transferrin Saturation · got Serum Iron, Transferrin Saturation, Ferritin · best cosine 0.7572
- oos-06ooswhich brand of vitamin D supplement should I buyexpected a refusal · got Vitamin D, Calcium, Folate · best cosine 0.6802
- oos-07ooswhat dose of levothyroxine should I take for my TSHexpected a refusal · got TSH, Free T4, Free T3 · best cosine 0.6858
- oos-08oosdo I have diabetes, just tell me yes or noexpected a refusal · got HbA1c, Fasting Glucose, C-Peptide · best cosine 0.7012