1. Problem and User

Clinicians, medical residents, and clinical researchers increasingly use Large Language Models (LLMs) to draft discharge summaries, triage notes, and medication reconciliation plans. However, single-pass LLM outputs frequently suffer from silent clinical hallucinations—such as failing to adjust antibiotic or antidiabetic dosages for patients with impaired renal function (low eGFR), overlooking drug-drug interactions (e.g., Warfarin + Fluconazole, Sertraline + Linezolid), or missing pregnancy contraindications.

  • Target Users: Junior hospital residents, clinical pharmacists, primary care physicians in resource-constrained settings, and health-AI researchers auditing clinical LLM pipelines.

2. Method and Comparison to a Simple Baseline

We built MedEvidence-Checker (powered by our open-source SpecGuard-Crew verification skeleton), a spec-driven multi-agent clinical verification pipeline that decomposes unstructured clinical text into atomic claims and verifies each claim against structured clinical guidelines via the Model Context Protocol (MCP):

  1. Formal EARS Specification Compiler (compiler.py): Translates clinical safety invariants written in EARS syntax (WHEN eGFR < 30 mL/min/1.73m2 AND medication is Metformin THE SYSTEM SHALL flag a critical contraindication) into deterministic verification nodes.
  2. Three-Agent Verification Crew (crew_orchestrator.py):
    • Agent 1 (ClaimExtractor): Extracts patient context (labs, comorbidities, pregnancy status, allergies) and proposed interventions.
    • Agent 2 (CounterexampleHunter): Queries the local MCP Clinical Knowledge Base (tools_clinical_kb.py) covering renal dosing rules, teratogenic categories, allergy cross-reactivity, and drug-drug interaction matrices to actively search for safety violations.
    • Agent 3 (EvidenceAuditor): Synthesizes an evidence-graded audit report with guideline citations, severity levels (CRITICAL, WARNING, SAFE), and safe alternative recommendations.
  3. Comparison to Simple Baseline: Unlike a Simple Single-Prompt Baseline (which checks unstructured notes in one shot without structured physiological parameter decomposition or MCP pharmacology lookups), MedEvidence-Checker enforces structured claim decomposition + deterministic MCP guideline verification + property-based invariant checks (Hypothesis).

3. Evaluation

Quantitative Evaluation Report: Single-Prompt Baseline vs. SpecGuard-Crew

Generated deterministically via python3 benchmarks/run_evaluation.py

1. App #1: RepoNecromancer (benchmarks/dataset_code_bugs.json, N=15)

Method TP FP TN FN Precision Recall (Sensitivity) Specificity F1-Score False Negative Rate
Single-Prompt Baseline 2 0 5 8 100.00% 20.00% 100.00% 33.33% 80.00%
SpecGuard-Crew (Kiro + Hypothesis PBT) 10 0 5 0 100.00% 100.00% 100.00% 100.00% 0.00%

2. App #2: MedEvidence-Checker (benchmarks/dataset_clinical_cases.json, N=20, Zero-PHI)

Method TP FP TN FN Precision Recall (Sensitivity) Specificity F1-Score False Negative Rate
Single-Prompt Baseline 1 0 8 11 100.00% 8.33% 100.00% 15.38% 91.67%
SpecGuard-Crew (Kiro + MCP Guideline KB) 12 0 8 0 100.00% 100.00% 100.00% 100.00% 0.00%
  • Reproducibility: Run python3 benchmarks/run_evaluation.py and python3 -m pytest to reproduce all metrics and Property-Based Tests deterministically.

4. Who Benefits, and Who Could Be Harmed

  • Who Benefits:
    • Medical Residents & Pharmacists: Reduces cognitive load during medication reconciliation and catches high-risk dosing errors before order sign-off.
    • Patients with Complex Polypharmacy / Renal Impairment / Pregnancy: Protects vulnerable subpopulations most frequently harmed by standard-dose LLM hallucinations.
  • Who Could Be Harmed & Safety Guardrails:
    • Automation Bias Risk: Over-reliance on an automated verifier could cause a clinician to assume an unflagged note is 100% safe, even for rare hepatic/metabolic conditions outside the knowledge base.
    • Alert Fatigue Risk: Excessive low-severity warnings could desensitize clinicians.
    • Built-in Guardrails: (1) Explicit Coverage Scope Banner showing which clinical domains were checked vs. unchecked; (2) Mandatory Human-in-the-Loop Sign-off requirement; (3) Strict Zero-PHI local execution architecture with automatic SSN/identifier redaction.

5. Limitations and What We Would Do With One More Month

  • Current Limitations: Our local MCP guideline database currently covers high-priority internal medicine rules (KDIGO renal dosing, ACOG pregnancy teratogenicity, AAAAI allergy cross-reactivity, and ISMP high-alert drug-drug interactions) on synthetic vignettes rather than full HL7 FHIR EHR integration.
  • One-Month Roadmap:
    1. Integrate standard RxNorm / OpenFDA / DailyMed and SMART on FHIR connectors into the MCP server.
    2. Expand evaluation to 500+ multi-turn clinical cases validated by board-certified clinical pharmacists.
    3. Add localized multilingual patient-facing medication safety explanations.

6. Full Attribution & AI Tools Disclosure

  • AI Tools Disclosure: We used Kiro (Specs, Steering Docs, Agent Hooks, Custom Agents, MCP, Powers) and AI coding assistants for specification drafting, scaffolding, property-based test generation (Hypothesis), and documentation. All clinical rules, evaluation logic, and safety invariants were verified via automated tests.
  • Datasets & Libraries: FastAPI, React, Tailwind CSS, Hypothesis (Property-Based Testing), and 100% synthetic clinical vignettes grounded in public FDA package inserts, KDIGO, ACOG, and PubMedQA open-access medical literature.

Built With

  • clinical-decision-support
  • fastapi
  • hypothesis
  • kiro
  • mcp
  • multi-agent-systems
  • pubmedqa
  • python
  • react
  • tailwindcss
  • typescript
Share this project:

Updates