LangGraph/Core Model
★ OverviewBeginner10 min

What is LangGraph?

Nodes, edges, and the state machine model. Why LangGraph over plain chains.

Quick Reference

  • Graphs beat chains — branches, cycles, and parallel execution are first-class
  • StateGraph is the main entry point: define state type, add nodes, add edges, compile()
  • compile() validates the graph and returns a CompiledGraph you can invoke or stream
  • START and END are special pseudo-nodes marking entry and exit points
  • Super-steps: each node execution is one super-step; the graph loops until END or recursion_limit

Why Graphs Beat Chains

Chains are linear — step A → step B → step C. Agents need more: branches (choose a path), cycles (loop back to retry), and parallelism (run steps concurrently). LangGraph models this as a state machine.

ChainLinear executionABCGraphBranch, loop, parallelizeABCDcycle

Chains are linear. Graphs branch, loop, and parallelize.