Orchestrating Agentic State Machines with LangGraph
summary
Prototype implements a 4-agent pipeline—transcription, structured extraction, summarization to SOAP, and a consistency checker—orchestrated as a LangGraph state machine with retries, routers and audit logs. Extraction uses Pydantic schemas as an API contract, validates outputs, retries on malformed JSON, and logs prompt versions. Demo runs on a local 2.57B model, extracts six symptoms, three vitals, one diagnosis and two prescriptions, generates SOAP notes, and flags an omission (shortness of breath) via the consistency agent.
AI-written summary · about
chapters (24)
- 0:00Intro: Orchestrating Agent State Machines for Clinical Documentation
- 0:15What “Agentic” Means (Engineering View): Nodes, State, and Routing
- 0:50The Clinical Scribe Use Case + 4-Agent Pipeline Overview (SOAP)
- 2:41Why This Matters: Documentation Burden, Burnout, and System Impact
- 4:13Why Not One Big Prompt: Accuracy, Auditability, and Debuggable Workflows
- 5:36Why Clinical Notes Are Hard: Messy Dialog, Negation, Time, Uncertainty
- 7:56What We’re Building: Inputs/Outputs, Pipeline, and Two Key Design Choices
- 11:01Why LangGraph: State Machines for Branching, Retries, and Traceability
- 13:38LangGraph Vocabulary Crash Course: State, Nodes, Edges, Routers, Cycles
- 15:34The Shared MedicalScribeState: Audit Logs, Errors, and Testability
- 20:39Schemas & Structured Extraction: Pydantic Models as an API Contract
- 22:27Node Implementation Template + Transcription Agent Responsibilities
- 24:58Extraction Agent Deep Dive: Validation Retries and Negation Handling
- 29:34Negation, temporal qualifiers & deterministic normalization in extraction
- 31:04From structured encounter to SOAP note: summarization constraints & editable sections
- 32:15Reducing hallucinations: structured inputs, no-new-facts prompts & low temperature
- 34:33Consistency agent: catching omissions, contradictions & invented facts
- 35:27Consistency checks taxonomy: hard rules vs semantic judging vs safety scans
- 37:56Graph orchestration with LangGraph: explicit routing, safe failures & debugging
- 41:09End-to-end demo walkthrough: transcription → extraction → SOAP → consistency
- 47:54Retrieval grounding: mapping diagnoses to ICD-10/SNOMED as a pipeline node
- 48:32Measuring quality per agent: datasets, metrics & iteration strategy
- 51:07Production readiness: PHI, redaction, prompt injection, monitoring & human review
- 53:54Setup, key takeaways & next steps (feedback loop, better grounding)
related talks
01h 59mBuilding Agentic and Multi-Agent Systems with LangGraph
29mBuilding Modular AI Agents with LangGraph, MCP, and
01h 03mAgents Everywhere
29mTransparent Multi-Agent AI
25mFrom LangChain to LangSmith and LangGraph: the Future of AI
30mGraphs as the Backbone of Scalable Agentic Apps
30mBuilding Robust, Secure LLM and Agentic AI Workflows
32mBuilding Multi-Agent Systems: From Concepts to Collaboration
