LangGraph

LangGraph state, nodes, edges, multi-agent patterns, and durable execution.

LangChain's low-level orchestration framework, and the most widely used tool specifically for multi-agent systems in production — used internally at Replit, Uber, LinkedIn, and GitLab. Where the other four frameworks optimize for a single agent with tools, LangGraph's core abstraction is the graph itself.

Core concepts

  1. State, nodes, and edges: The whole framework is three primitives — state stores the current snapshot, nodes perform work (call an LLM, run a tool), edges decide what runs next, including conditional branches and loops. LangGraph Docs
  2. Why graphs over a single agent loop: Sequential flows, conditional branching, loops, and parallel execution are all explicit in the graph rather than hidden inside one opaque agent loop — easier to debug and reason about at scale.
  3. Supervisor and multi-agent patterns: A common pattern is a supervisor node routing work to specialist agent nodes, each operating in its own focused context — directly comparable to the handoffs pattern in OpenAI Agents SDK, but with more explicit control over the routing logic.
  4. Durable execution & human-in-the-loop: LangGraph 1.0 emphasizes persistence and the ability to pause a graph for human approval before a sensitive step, then resume exactly where it left off.
  5. LangGraph vs CrewAI vs AutoGen: LangGraph is lower-level and more flexible but needs more setup; CrewAI's role-based pattern (each agent has a job title, goal, and tools) and AutoGen are faster to start but less customizable — pick LangGraph when you need fine-grained control, CrewAI for fast iteration on a multi-agent demo.

Why it matters

Support bots and research pipelines have branching you can draw on a whiteboard. Checkpointing lets a run survive a crash or wait for a human to approve something.

Where people get stuck

  • Huge graphs nobody can diagram. If the team can't sketch it, debugging will hurt.
  • Saving a massive state blob on every step. Checkpoint cost and latency add up quickly.
  • Starting with LangGraph before you understand a plain tool loop. Graphs wrap the same primitives.

Try this

Draw classify, retrieve, answer on paper, then build the smallest LangGraph tutorial that matches your sketch.

Interview question

Why use a graph instead of a while loop?

Branching, parallelism, persistence and visualization become explicit. That pays off for non-linear or restartable workflows and is overkill for a straight tool chain.

Resources

YouTube learning

Core concepts from video walkthroughs:

Threads in the same domain as this chapter — go deeper on iHateReading without leaving the roadmap.

Python AI agent SDKs in 2026: OpenAI vs Pydantic-AI vs smolagents vs Strands cover

Python AI agent SDKs in 2026: OpenAI vs Pydantic-AI vs smolagents vs Strands

Same three-tool agent in four frameworks — pick by execution model and testing needs.

Agent harnessing: the part of building AI agents nobody talks about cover

Agent harnessing: the part of building AI agents nobody talks about

Loop, tools, memory, sandbox, and tracing live in your code — not the model weights.

AI Agent cover

AI Agent

What agents are and how they differ from a single chat completion.