Healthcare Assistant
LangGraph-backed agentic assistant: FHIR-grounded patient lookups, PHI-audit-traceable tool calls, deterministic clinical safety triage, multi-intent fan-out, exposed via MCP for external clients.
Pluggable EHR layer — SQLite for the course demo, FHIR R4 against any HAPI / AWS HealthLake / Microsoft FHIR server in production. Conditions are SNOMED-coded; Observations are LOINC-coded. History summaries cite these directly.
Every patient-identifiable read or write produces one row in a separate SQLite DB (HIPAA 45 CFR 164.312(b) shape). The audit DB is intentionally distinct from the EHR DB — separation-of-duties so an EHR compromise can't silently erase the trail.
Pre-classifier between START and intent routing. Deterministic regex catches cardiac / stroke / suicide / anaphylaxis / severe-bleeding / altered-mental-status; emits a hardcoded 911/988/112/108 template and skips the LLM entirely. Informational guards suppress the obvious false positives.
The classifier may return multiple intents — LangGraph fans out to all relevant branches in parallel, then converges on the composer. State fields with multiple writers use Annotated reducers to avoid silent overwrites.
Mixed stream_mode=[updates, messages] surfaces node-progress AND composer tokens in the same loop. The chat bubble fills in real-time; node-progress badges animate in as each branch completes.
The 8 tools the LangGraph agent uses internally are also exposed via Anthropic's Model Context Protocol, so Claude Desktop (or any MCP client) can drive the same booking / records / history / search / audit operations.
Routing eval (14 cases — plumbing + safety classifier) plus adversarial eval (20 cases — jailbreaks, PHI isolation, dangerous advice, prompt injection, refusal quality). LLM-as-judge plus deterministic substring backstop; CI red-lines on safety < 3.
Every workflow invocation produces one JSONL trace row with timing, intents, backends, errors. Optional LangSmith auto-engages when LANGCHAIN_API_KEY is set for per-LLM-call flame graphs.