Skip to main content

07. Frameworks & Libraries

LangGraph Checkpointing, Human Approval and Multi-Agent

Checkpointing persists LangGraph state so runs can pause, resume, and recover. Human approval interrupts the graph before risky actions. Multi-agent graphs put supervisor and specialist nodes on the same shared state β€” with those durability and HITL controls available on every hop.

What you will learn

  • Explain checkpoints, threads, and resume
  • Design a human-approval interrupt before side effects
  • Sketch a multi-agent LangGraph with shared state
  • Know when HITL and checkpoints are required
  • Answer interview questions with short, solid answers
Graph steps persisting checkpoints for resume
Interview staple: checkpoints snapshot state per thread so work can stop and continue safely.

Definition

A checkpoint is a saved snapshot of graph state (and metadata) after steps, keyed by a thread/run id. With a checkpointer, LangGraph can resume after crashes, wait for humans, or time-travel to prior states for debugging.

Human approval (HITL) uses interrupts: the graph pauses at a boundary, surfaces a payload to a person, then resumes with approve / edit / reject. Multi-agent LangGraph maps roles to nodes (or subgraphs) that read/write the same state under supervisor routing.

Introduction

This lesson (#4 in Frameworks & Libraries) follows LangGraph Fundamentals. You know nodes, edges, state, and routing β€” now add durability, HITL, and multi-actor layouts.

Next: CrewAI Fundamentals β€” a different multi-agent framework centered on crews and tasks.

Why these features matter

  • Long jobs survive deploys and timeouts
  • Risky tools wait for a human gate
  • Multi-role products get explicit topology + shared memory
  • Ops can audit and replay a thread_id

Checkpointing

Attach a checkpointer (in-memory for dev; SQLite/Postgres-style stores for prod). Every run needs a stable thread_id.

Steps writing checkpoints to a store for later resume
thread_id + checkpoint store = resume, recover, and inspect history.
  • thread_id - isolates one conversation / job
  • Snapshot - state after node(s) complete
  • Resume - continue from last checkpoint
  • Replay / fork - debug or branch from an earlier snapshot
  • Retention - TTL and PII policy for stored state

Human approval

Interrupt before irreversible side effects: refunds, emails, deploys, deletes. Show the human the planned action and relevant state.

Interrupt waiting for approve edit or reject then resume
Approve continues; edit patches state; reject takes a safe edge to END.
  • Where - before tool nodes with write authority
  • Payload - action summary, diffs, risk flags
  • Outcomes - approve, edit state, reject/escalate
  • Timeouts - escalate or auto-reject if no human response
  • Audit - who approved what, when, on which checkpoint

Multi-agent graphs

Implement supervisor–worker or pipeline specialties as nodes. Route with conditional edges; optionally nest subgraphs per domain.

Supervisor node routing to research coder reviewer agents on shared state
Same MAS ideas β€” expressed as LangGraph nodes with shared state and optional HITL.
  • Supervisor node - plan and route
  • Specialist nodes - research / code / review allowlists
  • Shared state - artifacts, statuses, budgets
  • Checkpoints - pause a crew mid-flight safely
  • HITL - approve merges or high-risk worker actions

Compose the three

  • Dev - MemorySaver checkpointer + simple interrupt
  • Prod - durable store + auth-gated approval UI
  • Multi-agent - one thread_id for the whole crew run
  • Budgets - still enforce max steps even with resume

Failure modes

  • Missing thread_id - cannot resume coherently
  • Checkpointing secrets - redact before persist
  • HITL without timeout - jobs stuck forever
  • Approve-all UX - humans rubber-stamp; show diffs/risk
  • Multi-agent without schemas - shared state becomes sludge

Program / implementation notes

Design interrupt points and state fields before coding UI. Keep approval APIs idempotent. Prefer structured pending_action in state over raw chat for the human form.

  • Related: Module 04 Human-in-the-Loop; Module 06 supervisor/workers
  • Next: CrewAI Fundamentals (Agents, Tasks, Crews, Processes)

Advantages and limitations

  • Advantage: durable, reviewable, human-gated agent runs
  • Advantage: multi-agent topology with one state model
  • Advantage: recover from failures without restarting from scratch
  • Limitation: checkpoint stores need ops (backup, retention, PII)
  • Limitation: HITL adds latency β€” use only on risky edges
  • Limitation: complex graphs need strong tests and budgets

Key points

  • Checkpoints snapshot state per thread_id for resume and recovery.
  • Human approval = interrupt before risky side effects.
  • Approve / edit / reject must be explicit outcomes with timeouts.
  • Multi-agent LangGraph = role nodes + routing on shared state.
  • Compose: durable store + HITL + supervisor/specialists.
  • Redact secrets; audit approvals; keep step budgets.

FAQs

Is a checkpointer required?

For demos, optional. For production resume, HITL, or crash recovery, yes β€” use a durable store keyed by thread_id.

How is interrupt different from just waiting in a node?

Interrupts integrate with checkpoints so the run can stop cleanly and resume later with human input, across process restarts.

Can each agent have its own thread?

Possible, but a single crew run usually shares one thread_id so the supervisor sees one coherent history. Separate threads fit separate user sessions.

What should humans see at approval time?

The proposed action, key state/diffs, risk level, and clear approve / edit / reject controls β€” not a raw token dump.

Interview questions

  1. What is LangGraph checkpointing?

    Answer Persisting graph state snapshots under a thread_id so a run can resume, recover, or be inspected later.

  2. How does human approval work in LangGraph?

    Answer The graph interrupts before a risky step, waits for human approve/edit/reject, then resumes from the checkpointed state.

  3. Why use thread_id?

    Answer It identifies one durable conversation or job so checkpoints and resumes stay isolated per user/run.

  4. How do you model multi-agent systems in LangGraph?

    Answer As supervisor and specialist nodes (or subgraphs) that update shared state, with conditional edges for routing.

  5. Name a HITL failure mode.

    Answer No timeout on interrupts β€” work stalls forever β€” or approval UIs that hide risk so humans rubber-stamp.

  6. When are checkpoints most valuable?

    Answer Long-running workflows, human gates, crash recovery, and auditing/replaying production agent runs.

Related topics

Practice task

Complete each numbered practice step in a notebook or doc before opening the next lesson.

  1. List 3 side effects in a support product that must interrupt for human approval.
  2. Design the approval payload fields (action, risk, diff, timeout_seconds).
  3. Sketch a supervisor + 3 specialist LangGraph and mark where checkpoints help.
  4. Write retention/redaction rules for checkpointed state (what never to store).
  5. Answer interview questions 1, 2, and 4 in two sentences each.