Case 07 · Vertical AI Applications / Healthcare & Medical Software

LangGraph Ambient Clinical Scribe with Human Approval

Applied-AI & Agent Orchestration Engineerslangchain.comAI & AutomationProduct EngineeringData & Integration
← All case studies

LangChain/LangGraph is an MIT-licensed framework for stateful, human-in-the-loop AI agents. We built the agent and orchestration layer for an ambient medical scribe — an auditable graph that drafts a SOAP note, waits for clinician approval, then writes it into the client's FHIR backend.

The challenge

A clinical-documentation startup wanted an ambient AI scribe that listens to a visit transcript, drafts a structured SOAP note, and requires explicit clinician sign-off before anything is saved. For clinical-safety review they needed controllable, auditable agent behavior — not a black box.

  • Guaranteeing a mandatory human-in-the-loop approval gate before any note touched the patient record.
  • Grounding the draft in the patient's prior records via retrieval so notes were accurate, not hallucinated.
  • Making every agent run auditable for clinical-safety review, with a typed, schema-validated note as output.
Our solution

We modelled the scribe as a LangGraph state machine — transcribe → retrieve_patient_context → draft_SOAP_note → human_approval (interrupt) → write_to_FHIR — using the checkpointer to pause at approval, enforcing a Zod schema on output, and tracing every run for audit.

  • A LangGraph graph whose checkpointer halts at a human_approval interrupt until a clinician signs off, so nothing is written without consent.
  • A retrieval step that grounds the draft in the patient's prior FHIR records via a vector store before the note is generated.
  • Schema-enforced output written back as a FHIR DocumentReference, with every execution traced (visit_id as metadata) for clinical-safety auditing.

A customized view of the system we shipped for this engagement — the components and how requests and data flow between them.

retrieveinterruptwritetrace🖥️Scribe App🕸️LangGraph StateMachine📐Vector Store(Qdrant)Human ApprovalGate🔎LangSmith Audit🏥FHIRDocumentReference
PythonLangGraphLangChainVector Store (Qdrant)FHIR R4Zod / PydanticKubernetesLangSmith
Delivered an ambient scribe where no note is ever saved without explicit clinician approval.
Grounded every draft in the patient's prior FHIR records to cut hallucinated content.
Made all agent runs auditable, with schema-validated FHIR DocumentReference output.
Direct value addedGives the client a safe, controllable clinical-AI product they can defend in front of a clinical-safety board — built on a permissively-licensed framework they fully own.
Why it mattersClinical AI must be controllable and auditable. LangGraph's checkpointing and human-in-the-loop interrupts let us build an agent that's safe by construction, not by hope.

Before — manual bottleneck flow

1Late-Night EMR TypingBottleneck
Physician · 2–3 hours

Doctor reconstructs notes from memory and scribbles, typing into a clunky EMR after hours.

2Compliance Re-ReadBottleneck
Reviewer · 1 hour

Notes are re-checked for omissions and compliance, adding another delay.

3Black-Box AI DistrustBottleneck
Safety Board · Blocks rollout

Earlier auto-generation tools couldn't be audited, so they were never approved for use.

After — automated optimized flow

1Grounded Draft
LangGraph Agent · 4 secs

The graph retrieves prior FHIR context and drafts a schema-valid SOAP note.

2Clinician Approval Gate
Physician · 30 secs

The graph pauses at a human_approval interrupt; nothing is saved until sign-off.

3Audited FHIR Write
FHIR Connector · Instant

The approved note is written as a DocumentReference and the run is traced for audit.

Portrait of Dr. Meredith Shaw
Our safety board would never have signed off on a black box. Because the approval step is built into the workflow and every run is traceable, we could actually show them how it behaves before a single note was saved. That's what got it into clinic.
Dr. Meredith Shaw at Clinical AI

Have a problem like this?

Tell us your goal and we'll turn it into a structured plan — from idea to stable, scalable reality.

Contact us