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.

Resources

YouTube learning

Core concepts from video walkthroughs:

The 60-second story

A single clerk with a secret routine is fine until the routine becomes “ask research, then legal, then a human, then maybe research again.” You can no longer see the routine. You can only watch the clerk frown. LangGraph asks you to draw the routine as a graph: boxes that do work, arrows that say what happens next, and a clipboard that holds the current facts.

State is the clipboard. Nodes are the boxes. A node might call a model or run a tool. Edges are the arrows, including arrows that depend on what the clipboard says. A loop is an arrow back to a box you have visited. That sounds formal. It is just a floor plan you can point at when the agent does something weird.

A supervisor pattern is a host who does not cook every dish. The host reads the ticket and sends it to a specialist. Each specialist has a smaller clipboard. That is the same idea as a handoff, drawn so you can see it. Durable execution is the ability to freeze the floor plan mid-shift, especially for a human to approve a refund, and resume without pretending the shift just started. The clipboard was saved.

CrewAI will get you a demo with job titles faster. AutoGen has its own rhythm. LangGraph is the floor plan when you care more about control than about a quick cast of characters. Replit, Uber, LinkedIn, and GitLab did not adopt it because graphs are fashionable. They adopted it because multi-step work got too important to hide.

Map the floor.

  • State is the clipboard.
  • A node is a box that works.
  • An edge is the next box, sometimes chosen.
  • A supervisor is a host, not the whole kitchen.
  • A pause for approval is freezing the clipboard.
  • A loop is an arrow you meant to draw.
python
# sketch, not a full app
# clipboard in, node updates clipboard, edge picks the next node

You do not need a twenty-line sample to remember the shape. If you cannot draw the boxes, you are not ready to hide them in one agent loop.

Graphs exist because an opaque loop is hard to debug at 1 a.m. Persistence exists because “start over after the human clicks approve” loses the work and sometimes repeats a side effect. The extra setup is the cost of being able to point at the box that misbehaved.

Mental model: a floor plan and a clipboard. If the work is one clerk and three tools, you might not need the plan. If a human has to step onto the floor, draw it.

You have the page if you can say what state, node, and edge are without looking, and why a pause is a feature rather than a crash.

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.