Washington Health Summary (WAHS) · Team Strategy & Design Rationale
Why WAHS pairs verbatim-first condensation with modular enrichers and Gemma 4.
When a patient asks a question about a multi-clinic health record, an AI system must never see another patient's data, must keep large multi-year exports within reliable attention limits, must answer quickly, and must link every claim back to its source FHIR record. This guide explains the strategy the UW CIRG & WAHS team converged on, what we tested and retired along the way, and the November 26 benchmark evidence behind our shipped defaults.
Default model & context pin:wahs-26b (Gemma 4 26B on UW CIRG H200, with wahs-12b and wahs-e4b selectable) pinned at 64knum_ctx for zero model reloads and sub-second warm prefill across every UI budget preset.
Default chart budget & enrichers:16k Auto chart budget with core-enriched (4 of 5 generalizable modules): temporal, terminology_kb, note_rag, and overflow_lookup, plus opt-in guideline_kb (5/5).
Zero duplicated clinical logic across surfaces: The Web App (shl-ips), Mobile Companion, and Explorer Sandbox (wahs-demo.openclinai.org) are thin presentation clients over wahs-engine.
+33.8 pts
Verbatim-first condensation lift on Gemma 4 26B over raw FHIR JSON (45.1 → 78.9, n = 450).
+7.5 pts
Additional Run 3A lift from core-enriched (4/5 modules) at 32k (72.3 → 79.8, 0 unsafe).
85.2 / 100
Run 3B 16k Tier-2 retrieval recovery on Gemma 4 26B (+8.0 pts, 0 unsafe), beating 32k baseline.
Four lessons from building patient-mediated clinical Q&A
1. Raw FHIR Is Not LLM-Ready
Structure beats brute-force context length
A single multi-year FHIR R4 export reaches 7,099 entries and 22 MB of nested JSON, repeated vitals, and Base64-encoded notes. Even when a full record fits inside a 128k window, stuffing raw FHIR loses 30+ benchmark points compared with structured condensation, and stuffing 128k condensed tokens still underperforms focused 16k–32k windows by 8–10 points due to long-context attention dilution.
2. Keep the Prefix Clean; Enrich in the Suffix
Fast follow-ups require two prompt regions
Early prototypes injected question-specific hints inside the chart ledger, invalidating the GPU's KV cache on every turn and mutating clinical records before the model saw them. Separating an immutable [1]..[N] chart prefix from an append-only enricher suffix preserves sub-second warm follow-up prefill and lets evaluators ablate every module cleanly.
In our November 16 H200 benchmark, multi-step agentic tool loops over 2k summaries scored 65.8–69.4 / 100 with 7–10 confirmed unsafe answers out of 75 cases because models skipped tool calls or missed subtle cross-clinic risks. Deterministic pre-turn note_rag + overflow_lookup at 16k achieved 85.2 / 100 with 0 unsafe answers in one single fast pass.
4. One Warm 64k KV Slot
Match KV-cache allocation to real clinical ceilings
Dynamically resizing Ollama's num_ctx per prompt forced 30-second model reloads whenever a user switched budgets, while requesting 128k caused GPU memory spills and timeouts. Pinning WAHS_OLLAMA_NUM_CTX=65536 costs zero extra cold-load time vs 32k (29.3s vs 30.2s) and gives instant warm reuse across every preset from 2k to 64k.
Iteration Discipline
What we tried, what we retired, and why
Keeping the architecture lean meant actively deleting prototypes and workarounds once standalone wahs-engine proved cleaner and stronger.
Earlier Prototype
Disposition
Why We Retired or Quarantined It & What Replaced It
med-agent-hubwahs-* profiles
Retired
Bundling WAHS inside the multi-EHR Hub created cross-project dependency drift and duplicated condensation code. Replaced by standalone wahs-engine ↗ with zero EHR or SQL dependencies.
Browser-side JS condensation & KB in wahs-demo
Retired
wahs/demo/index.html previously carried ~7,000 lines of client-side KB rules, precomputed Oct 31 JS snapshots, and regex redaction that drifted from the real engine. Replaced by a zero-business-logic thin UI calling isolated wahs-sandbox-engine.
Cloud Run wahs-gpu-auth-relay
Retired
A separate Cloud Run OAuth proxy fragmented sign-in between the sandbox and the Web/Mobile apps. Replaced by the unified VM wahs-auth-gate Google whitelist cookie shared across wahealth, wahs-web, wahs-mobile, and wahs-demo.
Heuristic graph.py reconciliation
Quarantined
Regex-heavy cross-clinic graph rules risked overfitting synthetic fixtures and produced bracketed pseudo-citations. Quarantined behind WAHS_ALLOW_EXPERIMENTAL_ENRICHERS=true; replaced by standards-based terminology_kb (CIEL/RxNorm/LOINC/ACIP) + numeric-only citation rules.
2k Agentic Tool-Calling Loops
Retired
Multi-step tool loops over tiny 2k charts scored 65.8–69.4 / 100 with 7–10/75 unsafe answers. Replaced by 16k verbatim-first condensation + single-pass note_rag and overflow_lookup.
Dynamic 128k Ollama num_ctx
Retired
Triggered >120s KV-cache overallocation stalls and browser timeouts. Replaced by warm 64k pin (WAHS_OLLAMA_NUM_CTX=65536) plus immediate context_ready and 15s SSE keepalives.
Published Evidence · November 26, 2026
Two-judge blinded H200 evaluation results
All November 26 studies were judged blindly across two independent frontier evaluator passes (gpt-6.2-sol and claude-opus-5-5, median axis score with strict-majority consensus for confirmed unsafe answers).
Tested on dense longitudinal charts where 16k activates Tier 2 note excerption/omission (Marcus Vance: 63 excerpted notes; Maurice Auer: 27 excerpted + 102 omitted notes) (full report ↗):
Profile & Budget Arm
Gemma 4 26B (Harm)
Gemma 4 12B (Harm)
Gemma 4 E4B (Harm)
baseline @ 16k
77.2 (0)
79.7 (0)
64.7 (1)
baseline @ 32k (2× chart tokens)
76.3 (0)
78.0 (0)
69.9 (1)
rag-overflow @ 16k
85.20 harm
70.2 (0)
72.7 (1)
core-enriched @ 16k (Default)
80.20 harm
82.70 harm
72.2 (1)
3. Budget Sweep (n = 192) & Engine vs. Raw FHIR (n = 450)
Across dense longitudinal patients (Budget Sweep ↗), condensing into 32k/16k consistently beat unbounded 128k stuffing (26B: 82.2 at 32k / 79.1 at 16k vs 74.1 at 128k; 12B: 81.7 vs 71.1). Against raw FHIR JSON (Engine vs Raw FHIR ↗), even un-enriched wahs-engine baseline gained +33.8 pts on 26B (45.1 → 78.9), +30.8 pts on 12B (47.1 → 77.9), and +30.5 pts on E4B (43.3 → 73.8).
Model Selection & Deployment Tiers
Three swappable Gemma 4 tiers on UW CIRG H200 or local hardware
Primary Default
wahs-26b (Gemma 4 26B-A4B MoE)
Sparse mixture-of-experts model activating ~4B parameters per token. Delivers the best synthesis depth, retrieval recovery (85.2 at 16k), and sub-second warm TTFT on UW CIRG H200 at 64knum_ctx.
Compact Workhorse
wahs-12b (Gemma 4 12B)
Dense 12B model that reached 84.1 / 100 (0 unsafe) with core-enriched in Run 3A and runs cleanly on a single 24 GB GPU or 32–64 GB Apple Silicon workstation.
Edge / Low-VRAM
wahs-e4b (Gemma 4 E4B)
Ultra-fast 4B tier for laptops and rapid triage. Benefits strongly from full-enriched (59.3 → 76.2, 0 unsafe in Run 3A), closing much of the gap with larger models.
Security & Privacy Boundaries
Zero-privilege data access and decoupled selective disclosure
wahs-engine enforces per-user isolation by construction: production deployments hold zero HAPI admin credentials, refuse to start if pointed at fhir-internal, forward the patient's Keycloak JWT through fhir-auth on every turn, strip any foreign Patient/ references before extraction, and keep conversation history out of server databases. Patient-controlled selective disclosure (SMART Health Links & HL7 DS4P) remains cleanly in the WAHS sharing layer rather than relying on implicit prompt regexes.
Shared Vocabulary
Plain-English glossary
wahs-engine
Standalone OpenAI-compatible Python middleware that fetches scoped FHIR R4 records via fhir-auth, condenses them verbatim-first, runs modular enrichers, and attaches x_wahs citations.
Verbatim-First Condensation
3-tier deterministic compression (Tier 0 verbatim, Tier 1 uniform series folding, Tier 2 IPS safety core + note water-filling) that never mutates clinical facts and logs every omission in [2] Completeness Manifest.
core-enriched (4/5)
Default enricher profile combining temporal, terminology_kb, note_rag, and overflow_lookup in the append-only turn suffix (with guideline_kb opt-in for 5/5).
X-WAHS-Prefix-Hash
Short SHA-256 fingerprint of the query-invariant system prompt + condensed chart prefix used for LRU reuse and GPU KV-cache verification.
num_ctx (64k Pin)
Ollama KV-cache context size pinned at 65,536 tokens so toggling chart budgets from 2k to 64k never triggers cold model reloads or 128k VRAM spills.
[N] / [P] / [K] Citations
Inline source markers mapped in x_wahs.citation_map to FHIR chart entries ([N]), retrieved clinical note passages ([P]), and public guideline snippets ([K]).