Why LangGraph
PyPI
State and Nodes
A StateGraph is built around a state schema — usually a TypedDict — and a set of nodes, each a plain function that receives the current state and returns a partial update, not the whole state.
Conditional Edges
A plain addedge("a", "b") always routes from a to b. addconditional_edges routes based on a function of the current state — this is how a graph loops an agent node against a tool node until the model stops requesting calls.
Checkpointing
A checkpointer saves the graph's state after every step, keyed by a thread_id. Compile with one and any run becomes resumable — after a crash, a restart, or a deliberate pause for human review.
Human in the Loop
interrupt() pauses a graph mid-run, persists its full state via the checkpointer, and waits — no polling, no separate queue. A Command(resume=...) call later continues execution from that exact point with the human's input folded in.
Multi-Agent
A single agent with more tools is usually simpler and cheaper than several agents talking to each other. Multi-agent earns its complexity when one model juggling every tool starts picking the wrong one, or when responsibilities are cleanly separable (a researcher, a writer, a reviewer) and keeping their contexts and system prompts separate improves each one's accuracy.