Module DD-10 — LangGraph: Graph-Based State Machines

LangGraph: Graph-Based State Machines

The most architecturally distinct harness. Explicit nodes and edges. Super-step checkpoints. interrupt() for HITL. Used INSIDE Claude Code. The orchestration baseline and the Module 8 reference. 37/60 — maxes on Modules 1 (Loop) and 8 (State), both 5/5.

60
minutes
8
artifacts
3
sub-sections
LangGraph is the graph-based orchestration framework — not a terminal harness but a library for building harnesses as explicit state machines. Every other harness hides its loop inside an implicit while-true. LangGraph makes the loop a visible, testable, editable graph you draw before you run it. This is the largest architectural divergence in the roster. For a class of use cases the process IS the product: regulated workflows, compliance pipelines, multi-approval flows — use cases that do not want a smart loop that figures it out, but a declared graph where every transition is visible and every run is replayable from a checkpoint. interrupt() is the cleanest HITL primitive in the roster (structural, not behavioral — the model cannot route around it). And subgraphs provide declared multi-agent coordination: the C4 E09 pole, contrasted with CrewAI's emergent coordination.
Key Claims
Load-Bearing Claims

The loop IS the graph — the largest architectural divergence in the roster. Every other harness hides its loop in an implicit while-true. LangGraph makes the loop a declared, visible, testable, editable graph you draw before you run it. Nodes are functions (take state, do work, return a state update). Edges are transitions, with conditional edges expressing branching in code. Module 1 (Loop): 5/5 — the reference. This is the framework for when the process is the product.

Super-step checkpoints are the Module 8 reference at 5/5 — the finest-grained state model in the roster. State is serialized at every node boundary. The granularity is the STEP, not the session. A crash resumes from the last completed node. For multi-day, multi-human workflows this is the difference between 'resume from where you were' and 'resume from approximately where you were.' Every checkpoint is serializable, replayable, forkable, inspectable.

interrupt() is the cleanest HITL primitive in the roster — structural, not behavioral. The edge from propose to execute goes through an interrupt node. The model cannot route around the approval because the model does not control the edges — the graph definition does. A prompt-injected agent cannot skip the approval because the approval is a node in the graph topology, not a request in the prompt. Same principle as NemoClaw (DD-09): enforcement outside the agent's reach.

Subgraphs provide declared multi-agent coordination — the C4 E09 pole. A multi-agent system is a graph of subgraphs: each subagent is a node, edges between subagents are declared transitions in code. LangGraph is the declared-coordination pole; CrewAI (DD-12) is the emergent-coordination pole. The trade-off is the same as the single-agent case: declared edges are auditable and testable but rigid; emergent handoffs are flexible but opaque. The contrast defines the multi-agent axis the way NemoClaw-vs-Tau defines the governance axis.

After This Module
01
State LangGraph's defining thesis — the loop is an explicit, editable, testable graph — and explain why this is the largest architectural divergence in the roster.
02
Distinguish the three core primitives (nodes as functions, edges as transitions, state serialized at every node boundary as super-step checkpoints) and explain why each earns its 5/5 score (Module 1 Loop, Module 8 State).
03
Explain why interrupt() is the cleanest HITL primitive in the roster — structural, not behavioral — and why a prompt-injected model cannot route around it.
04
Apply the 'when is the graph right vs wrong' decision rule: the graph is right when the process is the product (regulated, auditable, multi-approval); the graph is wrong when the model could figure out the process (the graph-fights-the-model anti-pattern).
05
Connect LangGraph's subgraph pattern to multi-agent orchestration (Module 10) and to Course 4's E09 module — where LangGraph and CrewAI are the two poles of the declared-vs-emergent coordination axis.
Artifacts
01
Teaching Document
Teaching document — the loop-is-the-graph thesis (the largest architectural divergence), the three primitives (nodes, edges, super-step checkpoints), interrupt() as structural HITL (the cleanest in the roster), Module 8 reference (finest-grained state), the graph-right-vs-wrong decision rule, the subgraph multi-agent pattern and C4 E09 connection (declared vs emergent coordination), the 37/60 score profile; with learning objectives, anti-patterns, key terms, references
READ
02
Diagrams
5 Mermaid/n8n diagrams — the graph IS the loop (plan-execute-verify-interrupt-done), super-step checkpoints (crash-resume at node granularity), structural interrupt() vs naive behavioral HITL (two-track comparison), the graph-right-vs-wrong decision matrix (process-is-product vs emergent), the n8n state-machine workflow (nodes, edges, checkpoints, interrupt())
READ
03
Slide Deck
10 slides — reveal.js, dark theme, design-system teal; covers the thesis, the three primitives, structural HITL, the Module 8 reference, graph-right-vs-wrong, multi-agent subgraphs and C4 E09, the score profile, anti-patterns, the lab
READ
04
Teaching Script
Verbatim teaching transcript with [SLIDE N] cues, ~3,000 words spoken at ~140 wpm across 10 slide cues
READ
05
Flashcards
21 flashcards (TSV) — mix of recall, application, and analysis; covers the three primitives, super-step checkpoints, structural HITL, the decision rule, the graph-fights-the-model anti-pattern, the C4 E09 connection, the score profile
TEST
06
Exam
15 questions, 20/40/40 Bloom distribution (3 recall / 6 application / 6 analysis), 70% pass; validated JSON with rationale per question
TEST
07
Lab Spec
Build a LangGraph-Style State Machine — runnable simulation (Python 3.10+, type hints, no GPU, no external deps): nodes as functions, edges as a transition table, super-step checkpoints, interrupt() structural HITL the model cannot route around, the graph-fights-the-model anti-pattern, subgraph multi-agent coordination (~45-60 min)
DO
08
Module Web Page
Single-file HTML hub
HERE