Lesson 09.02 · Phase 09 · Frameworks & SDKs

LangGraph: state graphs

LangGraph is your Phase 3 loop drawn as a graph. Nodes return partial state, reducers merge it, conditional edges decide what runs next, and a checkpointer saves state after every step. Those checkpoints are what give you pause-for-approval, resume-after-crash and time travel. Build the four parts by hand and the library stops being magic.

Learning objectives

  • Implement a state graph with nodes, reducers, conditional edges and a recursion limit.
  • Explain why reducers exist and what goes wrong without one.
  • Add a checkpointer and use interruptbefore to pause an agent for human approval, then resume it from a fresh process.
  • Port the same agent to the real langgraph library and match its behaviour.

Your agent issues refunds. Legal says no refund goes out without a person approving it. In a plain while-loop that means blocking a thread on input() while a human goes to lunch, and if the process restarts you lose the conversation and the half-finished task.

Loading the full lesson…