« Track Overview · Warmup · Hitchhiker's · Deep Dive · Principal Deep Dive · Core Contributor · Staff Notes
Phase 18 — Framework Deep Dive: LangGraph
Answers these JD lines: Citi names LangGraph explicitly in both agentic-AI roles ("ReAct, ReWOO, and Google ADK-style orchestration," "LangChain, LangGraph, LlamaIndex"); Temporal integrates it. LangGraph is the most-used low-level agent orchestration framework in 2026, and a principal-level interview will probe whether you understand its execution model, not just its API.
This begins the Frameworks Deep-Dive part of the track (Phases 18–23). Phases 00–17 taught you to build the mechanisms framework-agnostically; these phases teach you to understand each real framework's execution model cold — by building a faithful miniature of it and studying the real API at depth. That combination — "I've reimplemented its core engine and I use it" — is what separates a principal candidate from someone who's followed a tutorial.
Why this phase exists
Most engineers can write a LangGraph StateGraph, add a couple of nodes, and call invoke. Far
fewer can explain why it's a graph and not a chain, what a reducer actually does, how the
checkpointer makes an agent durable and resumable, or how interrupt() implements
human-in-the-loop. Those are the questions that get asked at the staff/principal level, because
they reveal whether you can debug a stuck graph, design a reliable one, and reason about
concurrency and state — which is the whole job.
The key insight, and the thing this phase drills, is that LangGraph is a Pregel / Bulk- Synchronous-Parallel (BSP) message-passing system: the graph runs in discrete super-steps, within a super-step every active node sees the same state and their writes are combined by reducers, and only then does the next super-step begin. Everything else — reducers, fan-out/fan-in, persistence, interrupts, streaming — follows from that one design decision.
Concept map
- StateGraph + channels + reducers: state is a set of named channels, each with a reducer that
says how a node's write combines with the current value (overwrite vs append/
add_messages). - The super-step (Pregel/BSP) loop: run active nodes → merge writes via reducers → follow edges
→ repeat, guarded by
recursion_limit. - Edges: normal (
add_edge) and conditional (add_conditional_edgeswith a router) — how the graph branches and loops. - Persistence (checkpointer): a checkpoint saved per super-step, keyed by
thread_id, enabling durability, multi-turn memory, time-travel, and resume. - Human-in-the-loop (
interrupt/Command): pause the graph mid-node for human input, resume where it left off — built on the checkpointer. - The bigger picture: subgraphs, the functional API (
@entrypoint/@task), streaming modes, multi-agent (supervisor/swarm), and LangGraph Platform.
The labs
| Lab | You build | Proves you understand |
|---|---|---|
| 01 — StateGraph Engine From Scratch | the Pregel/BSP super-step engine: channels, reducers, nodes, normal + conditional edges, compile/invoke/stream | the actual execution model — why reducers exist, how loops/branches work, recursion limits |
| 02 — Persistence & Checkpointing | a MemorySaver-style checkpointer with thread_id, get_state/get_state_history, update_state, and time-travel | how LangGraph agents become durable, remember across turns, and support time-travel/resume |
| 03 — Human-in-the-Loop & Interrupts | interrupt() + Command(resume=...) and static interrupt_before/after breakpoints | how HITL/approval works, and why it requires a checkpointer |
Integrated scenario
A Citi wholesale-banking agent must draft a payment, pause for a human to approve, and only then
execute. In LangGraph that's a StateGraph with an agent node (drafts), a conditional edge to a
human_approval node that calls interrupt() (pauses, surfaces the draft), and — on Command(resume= approved) — an execute node. The checkpointer (a PostgresSaver in prod) makes the pause durable
so the graph can wait hours for the approval, resuming exactly where it stopped. You built all three
mechanisms here, so you can design and defend that graph — and debug it when a node loops or a
reducer clobbers state.
Deliverables checklist
-
All three labs green under
LAB_MODULE=solution pytestand your ownlab.py. - You can explain the Pregel/BSP super-step model and why reducers exist.
-
You can explain how the checkpointer +
thread_idgive durability, memory, and time-travel. -
You can explain
interrupt()vsinterrupt_beforeand why HITL needs a checkpointer.
Key takeaways
- LangGraph is a graph because agents branch, loop, and fan out; the super-step model makes that well-defined, and reducers make concurrent writes safe.
- Persistence isn't an add-on — it's the substrate for memory, durability, time-travel, and HITL.
- Cross-links: the super-step loop is Phase 01's agent loop generalized; the checkpointer is Phase 08's durable execution; interrupts are Phase 10's human-in-the-loop.