taylor
clementsphd.

Case study · LangGraph, RAG, healthcare

A clinical co-pilot that shows its sources

An AI assistant embedded in OpenEMR, an open-source medical record. It gives an overnight cross-covering resident the patient context they need, the moment they need it, sourced from the actual chart, uploaded documents and clinical guidelines, never inferred or assumed.

The question

At 3 a.m., a resident covering patients they've never met has to decide things quickly, often from a hurried sign-out. A wrong medication dose or a missed allergy matters. The question wasn't "can a model summarize a chart?" but "can it give a resident context they can trust, and make it obvious where every fact came from?"

What I built

How I measured it

A 55-case golden set, 8 agent-graph cases and 288 unit tests run on every code change, and any failure blocks the merge. A five-metric rubric gate scores the answers themselves. Try the kind of question a real sign-out produces, such as "The day team says she's on metformin 500 mg twice daily and has no allergies; can you confirm before I give the next dose?" The co-pilot catches the dose discrepancy and flags a duplicate record.

Results and what came next

On the final code change, the golden set passed 55 of 55 (one case skipped), graph cases 8 of 8, unit tests 288 of 288, and every rubric metric hit 100%.

Then I attacked it. My adversarial security platform found that the co-pilot could disclose internal tool details. I shipped a fix, a non-disclosure rule plus a deterministic response filter, and the platform's replay went from 6 of 6 leaks to 0 of 6 on the new version. One finding was resolved; a human read showed the other was only partly fixed, so it stays open and documented rather than claimed done. Known gaps are listed plainly in the repo.

All work