Width.ai

What Is LangGraph? How It Works and How It Compares (2026)

Matt Payne
·
November 11, 2026

What is LangGraph, and why do teams building production agent systems reach for it?

Start with the problem it solves. A single agent loop works well in a notebook: it calls a tool, reads the result and answers.

Then the real system arrives. It has a dozen agents, retries when an output fails a check, a person who must approve the result, and runs that take minutes instead of seconds.

That system breaks in ways the demo never did. An agent overwrites another agent's work, a retry loses context, and a crash halfway through means starting again. LangGraph exists to keep the state of a system like that straight.

We build multi-agent systems for clients, including a LangGraph network of roughly fourteen agents for a Fortune 400 client. Things like explicit state, validation loops, and parallel execution is what made that system work, and it is also why LangGraph is the wrong choice for simpler jobs.

Key Focus Areas

  • LangGraph is an open-source framework from LangChain for building stateful agents and multi-agent systems as stateful graphs.
  • Its key components are a shared state, nodes that do the work, edges that decide what runs next, and checkpointers that save the state after each step.
  • Checkpoints give you persistent state, durable execution, human-in-the-loop interrupts and the ability to replay earlier runs.
  • It is lower-level than CrewAI or the OpenAI Agents SDK and code-first, unlike n8n: more control, more engineering.
  • Using LangGraph pays off when you need a complex system with many agents, validation loops, and human feedback loops. Those same benefits can make it hard to use for simple systems. 
  • We’ve used LangGraph for years and feel it has some serious benefits over systems like Jev Ai and OpenClaw that aren’t built for a level of built-in control. 

What Is LangGraph?

LangGraph is an open-source framework from LangChain for building AI agents and multi-agent applications as graphs. A shared state object passes through nodes connected by edges, including loops and conditional branches, and the framework saves that state as the graph runs.

  
    ✂️ The short answer    

What is LangGraph?

    

LangGraph is an open-source, MIT-licensed framework from LangChain for building AI agents and multi-agent systems as graphs. A shared state object passes through nodes, which do the work, connected by edges, which decide what runs next, including loops and conditional branches. Checkpoints save the state after each step, so agents can run for a long time, recover from failures and pause for human review.

  

‍

The LangGraph documentation describes it as "a low-level orchestration framework and runtime for building, managing, and deploying long-running, stateful agents." Low-level is the important word. LangGraph does not decide how your agent should think; it gives you granular control over what runs, in what order, with what state.

I find the precise control over the structure of agent flows to be incredibly valuable in systems where you want agents to be able to perform complex tasks in an open domain, but you want control over the flow with validations and guardrails. 

How LangGraph Relates to LangChain and LangSmith

LangChain is the higher-level framework: models, tools, retrievers, document loaders and a prebuilt agent loop. LangGraph is the runtime underneath LangChain agents. You can use LangGraph without LangChain's components, and the docs say so directly.

LangSmith is the third piece of the LangChain ecosystem. It provides tracing, evaluation and deployment for agents built with either, and it works with other frameworks too. LangGraph Platform is now called LangSmith Deployment, and LangGraph Studio is now LangSmith Studio.

How LangGraph Works: State, Nodes, Edges and Checkpoints

A LangGraph application is a graph structure, much like a state machine, that you define in code. The table summarizes the core concepts, and the sections after it explain why each one matters once a system is in production.

  

How LangGraph works

  

LangGraph's core concepts, and why each matters in production

  
                                                                          
ConceptWhat it isWhy it matters in production
StateA typed schema shared by every nodeEvery step reads and writes one record you can inspect
ReducersRules for merging updates into state, such as appending messagesParallel nodes do not overwrite each other
NodesFunctions or agents that read state and return updatesEach step is small, testable and traceable
EdgesFixed or conditional links between nodes, including loopsRetries and review loops are explicit, not hidden in a prompt
CheckpointersSave the state after each step (memory, SQLite, Postgres; Redis via integrations)Resume after a crash, keep memory across turns, replay past runs
InterruptsPause a run for a person to approve, edit or reject, then resume at that nodeHuman review without losing the run's state
SubgraphsA graph used as a node inside another graphLarge multi-agent systems stay modular
StreamingStream tokens, state updates and events as the graph runsUsers see progress; engineers see what happened
  
  

Concepts and names follow the LangGraph documentation as of October 2026.

‍

‍

What is LangGraph: a shared state, nodes for structure, generate and validate, a conditional retry edge, a human review interrupt and a checkpointer saving state after every step
A LangGraph graph: shared state, nodes, a conditional retry edge, an interrupt and a checkpoint after every step.

State and Reducers

State is a typed schema, usually a Python TypedDict or a Pydantic model, that every node reads and updates. Reducers decide how updates merge: one field can be overwritten, while a messages field appends. The Graph API docs show operator.add as a simple reducer.

This matters because a production system needs one record of what happened. When ten agents write to the same run, reducers stop them overwriting each other, and the state tells you exactly what each step saw.

Nodes and Edges

Nodes do the work. Each is a function, often an LLM call or an agent, that reads the state and returns an update. Edges decide what runs next. A normal edge always goes to the same node; a conditional edge picks the next node from the state, which gives you dynamic routing.

Conditional edges make the loops in cyclical graphs explicit. A validate node can send a failed draft back to the generate node with feedback, up to a set number of attempts. In a free-running agent that conditional logic hides in prompt engineering; in LangGraph it is a line of code you can read and test.

Checkpointers

A checkpointer saves the state after each step. The core options in the persistence docs are in-memory, SQLite and Postgres. Redis and MongoDB checkpointers are available as separate packages. Each run belongs to a thread, so a conversation or job can be picked up later.

Checkpoints give you three things. A run can resume after a crash instead of starting over. An agent can keep memory of user inputs and past actions across turns. And with time travel, you can replay a past run or fork it from an earlier step to explore a different path, which is a powerful debugging tool.

Interrupts and Human Review

An interrupt pauses a graph mid-run for human input, so a person can approve, edit or reject what an agent produced. The run waits, with its state saved, and resumes at the interrupted node when the person responds. That node reruns from its start, so code before the interrupt runs again. Interrupts need a checkpointer, because the state has to survive the wait.

Subgraphs and Multi-Agent Patterns

A subgraph is a graph used as a node inside another graph, which keeps large systems modular. LangChain's multi-agent docs now describe the main patterns as subagents called as tools, handoffs between agents, skills, routers that pick an agent, and custom workflows.

Streaming

LangGraph streams tokens, state updates and custom events while a graph runs. Users see progress, and engineers see each step as it happens rather than after the run ends.

Graph API and Functional API

LangGraph offers two ways to write the same thing. The Graph API, used in the example below, models workflows as explicit nodes and edges. The Functional API adds LangGraph features, such as checkpoints and interrupts, to ordinary Python functions with decorators.

Use the Graph API when the shape of the workflow matters and you want to see it. Use the Functional API to adapt existing workflows, adding durability to code that already exists. Both run on the same runtime.

Debugging With LangSmith

Agent systems fail in ways that are hard to see from the outside. An answer is wrong, but which step went wrong? LangSmith records a trace for every run: each node, each model call, the inputs and outputs, the tokens, the timing and other critical data points.

Pair traces with checkpoints and debugging becomes concrete. You find the step that failed, load the state from just before it, change the code or the prompt, and replay from that point. That loop is much faster than rerunning a long job from the start.

A Minimal Example of LangGraph's Key Features

Here is a two-node graph with a conditional retry edge. It generates a product title, validates its length and makes up to three attempts. The write_title function stands in for your LLM call.

from typing import TypedDict
from langgraph.graph import StateGraph, START, END
from langgraph.checkpoint.memory import InMemorySaver 
  
class State(TypedDict):    
  draft: str    
  attempts: int    
  passed: bool 

def generate(state: State) -> dict:    
  draft = write_title(state)            # your LLM call    
  
  return {"draft": draft, "attempts": state["attempts"] + 1} 
  
def validate(state: State) -> dict:    
  return {"passed": len(state["draft"]) <= 200} 
  
def route(state: State) -> str:    
  if state["passed"] or state["attempts"] >= 3:        
  	return END    
  return "generate"                     # retry with the same state 
  
builder = StateGraph(State)
builder.add_node("generate", generate)
builder.add_node("validate", validate)
builder.add_edge(START, "generate")
builder.add_edge("generate", "validate")
builder.add_conditional_edges("validate", route)
graph = builder.compile(checkpointer=InMemorySaver()) 
  
graph.invoke({"draft": "", "attempts": 0, "passed": False},             
  {"configurable": {"thread_id": "sku-123"}})

The design behind this is deliberate. In Building LangGraph, LangChain explains that it built on the BSP/Pregel algorithm: the runtime runs in steps, supports loops and saves snapshots of the computation state at intermediate stages. The documentation also credits Pregel and Apache Beam as inspiration.

What LangGraph Is Used For

What is LangGraph used for in practice? Complex task automation, wherever an agent system needs control, durability or review. The common patterns are:

  • Multi-agent workflows with validation loops: several specialized agents, each output checked and regenerated on failure.
  • Long-running research and analysis agents: problem-solving jobs that run for minutes, call many external tools and must survive interruptions.
  • Human-approved workflows: compliance, finance and healthcare work where a person signs off before anything changes.
  • Agentic RAG: retrieval augmented generation that plans, searches vector stores more than once for relevant documents and validates its evidence before answering.
  • Support and operations assistants: conversational agents that maintain context across turns and hand off between specialists.
  • Code and test generation: agents that write code, run it and fix it in loops.

LangChain lists deployments on its Built with LangGraph page. It says Klarna's assistant serves 85 million active users and cut customer resolution time by 80%, and that AppFolio doubled response accuracy and saved more than 10 hours a week. Those are LangChain's reported figures. It also names LinkedIn, Uber and Elastic.

Signs Your AI Workflows Have Outgrown a Single Agent

Most teams start with one agent and a few tools, and that is the right start. These signs say it is time for more structure or a more complex framework:

  • Prompts keep growing to handle cases that should be separate steps.
  • You cannot tell which part of a run produced a bad answer.
  • A failed tool call or timeout means rerunning the whole job.
  • Someone needs to approve outputs and agent actions before they reach a customer or a system.
  • Different steps need different large language models, tools or rules.

Each of those maps to one of LangGraph's key features: separate nodes, tracing per step, checkpoints, interrupts and per-node configuration.

For retrieval specifically, my guide to moving to agentic RAG covers the architecture, and my analysis of whether agentic RAG is worth it covers when the extra cost pays off.

‍

Build Agentic RAG You Can Measure and Improve

The playbook we use on client builds, drawn from more than 100 agentic RAG systems. It shows how to set one up, how to evaluate it so you know what is failing, and how to improve the answers it gives.

  • How we build agentic RAG systems on real client projects

  • How we evaluate them, so you know what to fix next

  • How we improve results once evaluation shows the gaps

  • The exact tools we use, and how they fit your existing stack

  
    Free ebook: The Agentic RAG Playbook    

Build Agentic RAG You Can Measure and Improve

    

The playbook we use on client builds, drawn from more than 100 agentic RAG systems. It shows how to set one up, how to evaluate it so you know what is failing, and how to improve the answers it gives.

                                                    
How we build agentic RAG systems on real client projects
How we evaluate them, so you know what to fix next
How we improve results once evaluation shows the gaps
The exact tools we use, and how they fit your existing stack
    Get the free playbook →  

‍

LangGraph vs Other AI Agent Frameworks

LangGraph is one of several serious agent frameworks. The axis that separates them is how explicitly you control state and flow, and what you get for durability and human review. 

  

LangGraph vs other agent frameworks

  

How LangGraph compares with the other agent frameworks (October 2026)

  
                                                                          
FrameworkModelControl of state and flowDurability and human reviewBest for
LangGraphExplicit graph of nodes and edges over shared stateHighest: you define every step and branchCheckpoints, interrupts, time travelComplex, long-running, reviewed agent systems
OpenClawSelf-hosted assistant you message from chat apps, extended with skills and pluginsLower: the agent decides each step; no built-in task structureMemory kept on your hardware; approval for new chat sendersPersonal and team assistants, fast to set up
CrewAIRole-based crews of agents, plus event-driven FlowsMedium: crews for autonomy, Flows for controlState and control in FlowsFast multi-agent prototypes and role-based teams
Microsoft Agent FrameworkAgents and workflows uniting Semantic Kernel and AutoGenMedium to high: graph-based workflowsCheckpointing and human-in-the-loop in workflows (.NET and Python)Microsoft and Azure-centered teams
OpenAI Agents SDKLightweight agents with handoffs and guardrailsLower: few primitives by designSessions (memory) and built-in tracingSimple to moderate agents, quick to ship
Google ADKCode-first agents with graph-based workflows (ADK 2.0) and workflow agentsMedium to high: graph workflowsCan deploy to Agent Runtime (formerly Vertex AI Agent Engine)Google Cloud and Gemini-centered teams
LlamaIndex WorkflowsEvent-driven, step-based workflowsMedium: steps and eventsContext serialization; durable runs via the DBOS runtimeRetrieval-heavy and document agents
Hermes AgentSelf-improving agent that writes its own skills and memory as it worksLower: dynamic, self-directed runs; no built-in task structurePersistent memory, built-in cron, command approvalLong-running assistants that improve with use, fast to set up
  
  

The axis that matters most: how explicitly you control state and flow, and what you get for durability and human review.

‍

A few notes on the other frameworks. CrewAI pairs role-based crews of agents with Flows, which it describes as structured, event-driven workflows that manage state. Microsoft Agent Framework reached 1.0 in April 2026 and unifies Semantic Kernel's foundations with AutoGen's orchestration; the AutoGen repository is now archived and points new users to it.

The OpenAI Agents SDK keeps a small set of primitives, agents, handoffs and guardrails, plus built-in tracing and sessions. Google's ADK offers workflow agents for sequential, parallel and loop execution, and ADK 2.0 adds graph-based workflows. LlamaIndex Workflows are event-driven steps, strongest when the core of the job is to retrieve data.

LangGraph vs LangChain Agents

Choosing between LangChain and LangGraph is a choice of level, not of vendor. Use LangChain's create_agent for a standard agent loop with tools and middleware; it runs on LangGraph underneath. Drop down to LangGraph when you need custom control flow, several agents, explicit retries or human review.

LangGraph vs CrewAI

CrewAI gets a multi-agent team working faster, because you describe roles and tasks rather than a graph. LangGraph takes longer to build and gives you more control: every step, branch and retry is explicit, and the state is saved after each one. Pick CrewAI for a quick role-based prototype and LangGraph when the system must be debugged, audited and run for a long time.

LangGraph vs Microsoft Agent Framework and the OpenAI Agents SDK

Microsoft Agent Framework is the natural pick for teams already building on .NET or Azure, since it supports both .NET and Python and carries forward Semantic Kernel and AutoGen. LangGraph is a common choice for Python-first teams that want fine-grained control over each step.

The OpenAI Agents SDK is the lightest of the three. It works with OpenAI models and many other providers, and its few primitives get a simple agent shipped quickly. As a system grows into many agents with loops and review, LangGraph's explicit graph and saved state give you more to work with.

LangGraph vs Google ADK and LlamaIndex Workflows

Google's ADK suits teams building on Google Cloud and Gemini. ADK 2.0 added graph-based workflows alongside its older sequential, parallel and loop workflow agents, and agents can deploy to Agent Runtime, formerly Vertex AI Agent Engine.

LlamaIndex Workflows suit systems where retrieval over documents is the main job. LangGraph is the broader choice when the hard part is the control flow between multiple agents rather than the retrieval itself.

LangGraph vs OpenClaw and Hermes

OpenClaw and Hermes Agent are open-source agents built to be easy to set up. Each installs with one command and a setup wizard, then runs as an assistant you can message from apps like Telegram, Slack or WhatsApp. OpenClaw keeps its state and long-term memory on your own hardware. Hermes, from Nous Research, adds a learning loop that writes new skills from its own experience.

That ease comes from leaving the structure to the model. Both are highly dynamic: the agent decides what to do next on each turn. Neither has a built-in way to lay out a task as a fixed sequence of steps with checks between them. Use them for dynamic workflows, such as an assistant that should adapt as it goes, and LangGraph when a task has a shape it must follow every time.

Case Study: A LangGraph System of About 14 Agents in Production

So what is LangGraph like at scale? We built an agentic system for Interpublic Group (IPG), a Fortune 400 holding company serving around 3,000 brands, including Kenvue and General Mills.

The Problem

IPG's teams needed Amazon product detail pages optimized across thousands of products and several retailers. Done by hand, the work was slow, inconsistent from analyst to analyst and expensive to scale, and every page had to respect brand guidelines and platform rules.

The Graph

The system is a LangGraph implementation built from roughly fourteen ReAct agent nodes, working as a coordinated network of specialized agents. They fall into three families.

  

Case study

  

Three families of agents in a LangGraph system of about 14 nodes

  
                                            
Agent familyWhat it does
ComplianceChecks generated content against brand guidelines and Amazon platform policy
Keyword analysisFuses internal Amazon keyword data with competitor keyword data into a keyword roadmap
Title and content generationDrafts titles, bullets, descriptions and specifications, with dedicated structuring and validation nodes
  
  

Every node runs a structure, generate, validate loop and returns targeted feedback when validation fails.

‍

The Quality Loop

Every node runs the same loop: structure, generate, validate. When validation fails, the node returns targeted feedback and regenerates. Validation combines deterministic checks, such as character limits, prohibited terms, keyword coverage and required fields, with a qualitative review by an LLM.

Every node enforces its output against a Pydantic model with rebuild logic. HHEM-2.1 (open version on Hugging Face), Vectara's open hallucination evaluation model, screens generated content against the verified source data. LangSmith traces every node and every LLM call across each run.

Why a Graph Suited This System

A system like this has many small, separate jobs, each with its own checks and its own failure handling. A graph makes each job a node with clear inputs and outputs, and makes every retry a visible edge rather than a hidden instruction.

Tracing every node then turns a wrong recommendation into a specific step to fix. With fourteen agents, that difference decides whether a team can maintain the system at all.

The Human Step

The system produces recommendations, not automatic publishes. Every brief is a client-ready document that a strategist reviews before any listing changes. The results were qualitative: efficient handling of many products in parallel from one run, consistent briefs that account for each retailer, and recommendations with an audit trail behind them for enhanced decision-making.

Lessons for LangGraph Users

Fourteen agents, each with its own loop and validation, is exactly the kind of system that falls apart without explicit structure. Our n8n comparison puts the lesson in one line: "The state discipline is what makes that many nodes survivable." The model matters less than knowing, at every step, what each agent saw and produced.

Other Agent Systems We Have Built

The same patterns, specialized agents, tool calls, validation and sources on every answer, run through our other generative AI agent work. Two examples show the kinds of systems a framework like LangGraph is specifically designed for.

Our Sales Search & Insights system ties HubSpot, Gmail and Google Docs together behind one conversational interface. Anyone on a team can ask whether someone followed up after a demo, or which deals are stuck in negotiation, and get an instant, sourced answer.

An insights pipeline also combs through CRM data for patterns nobody asked about: contacts going quiet, deals with no recent movement, support tickets drifting. It runs every day with a working memory of what came before, which is exactly the kind of long-running, stateful job explicit state is for.

Our deposition chat system uses natural language processing to answer plain-English questions across folders of legal transcripts that can run to thousands of pages. Each page is labeled with the people, organizations and topics it covers, so a question about one witness's overtime reads only the pages that matter.

Every answer cites the exact pages it drew from, and response length can be set from brief to detailed. Multi-step reading with citations is the agentic RAG pattern, and it depends on knowing exactly which pages each step used.

Common Mistakes When Starting With LangGraph

In our experience, teams new to LangGraph tend to make the same few mistakes. Each one is easy to avoid once you know it.

  • One giant node: putting the whole agent in a single node hides every step. Split work into small nodes, individual components you can test and trace.
  • Loose state: a state with untyped fields invites bugs. Define a schema, and use reducers for fields that several nodes write.
  • Unbounded loops: a retry edge with no exit can loop until the recursion limit stops it. Count attempts in the state and end the loop on purpose.
  • No checkpointer in production: without one, a crash loses the run and interrupts cannot work. Use a durable checkpointer such as Postgres.
  • No tracing: debugging a multi-agent run from logs alone is slow. Turn on tracing from the first day.
  • Using it for simple jobs: short automations and data pipelines do not need a graph. Save LangGraph for complex AI workflows that need its control.

The recursion limit is a useful safety net. The Graph API docs define it as the maximum number of super-steps a graph can run in one execution, so a runaway loop stops instead of running forever.

When LangGraph Is the Wrong Choice

LangGraph earns its complexity on complex workflows. On simple ones it is overhead. Skip it when:

  • The job is a short integration: an event triggers, data moves between SaaS tools and a single model call happens. A visual tool like n8n connects faster.
  • Nobody can own the code: LangGraph has a learning curve and demands engineering depth at every level, from state management to deployment.
  • One agent with a few tools is enough: LangChain's create_agent or a lighter SDK gets there with less code.
  • You need a quick role-based prototype: CrewAI's crews are faster to stand up.

Count the costs too. Integrations that fetch data from external services are custom code, production runs need a checkpoint database and a runtime you host or pay for, and the commercial tiers charge per seat. A common middle path is LangGraph for the agent backend behind an API, with a visual tool for triggers and integrations.

How to Decide

Ask four questions about the system you are planning. Does it have more than one agent or more than a few steps? Does it need to retry or loop when an output fails a check?

Does a person need to approve anything before it takes effect? Does a run last long enough that a crash would hurt? As a rule of thumb, if you answer yes to two or more, LangGraph is likely worth the engineering. If you answer no to all four, a simpler tool will serve you better.

Is LangGraph Free? Open Source, LangSmith and Deployment

The LangGraph library itself is free. LangGraph is open source under the MIT license, and you can run it on your own infrastructure at no cost beyond hosting.

The paid parts are LangSmith and managed hosting. LangChain's pricing page lists a free Developer seat with up to 5,000 base traces a month and a Plus plan at $39 per seat a month with up to 10,000. LangSmith Deployment, the managed hosting for stateful agents, is billed separately by compute and memory used, as of October 2026.

LangGraph Is for Agent Systems That Have to Hold Up

What is LangGraph in one line? The framework you choose when an agent system has to keep its state straight across many steps, retries and reviews. It costs more engineering than the alternatives, and it pays that back when the system is complex, long-running and must be debugged.

Frameworks are easy to demo and hard to run. If your agent system is past the demo stage, explicit state, validation and review are the work, and that is what we build.

‍

Past the Demo Stage? That Is the Work We Do

We build multi-agent systems that have to run in production: explicit state, validation loops, tracing and human review, on LangGraph when it fits.

  • A LangGraph system of about 14 agents in production for a Fortune 400 holding company

  • Validation loops with deterministic checks, schemas and hallucination screening

  • Tracing on every node, so failures can be found and fixed

  • Recommendations people review, not unchecked automation

  
    Custom agentic AI development    

Past the Demo Stage? That Is the Work We Do

    

We build multi-agent systems that have to run in production: explicit state, validation loops, tracing and human review, on LangGraph when it fits.

                                                    
A LangGraph system of about 14 agents in production for a Fortune 400 holding company
Validation loops with deterministic checks, schemas and hallucination screening
Tracing on every node, so failures can be found and fixed
Recommendations people review, not unchecked automation
    Talk to us about your agent system →  

‍

Frequently Asked Questions

What is a graph AI?

In artificial intelligence, the term covers two different things. In agent frameworks with graph-based architectures, like LangGraph, the graph is a control flow of steps and transitions. Among machine learning algorithms, a graph neural network is a model that learns from data shaped like a graph, with complex relationships such as social networks or molecules.

Which is better, CrewAI or LangGraph?

Neither is better everywhere. CrewAI is faster for role-based multi-agent prototypes; LangGraph handles complex production systems with more control, durable state and human review.

When to use LangChain vs LangGraph?

Use LangChain's create_agent for a standard agent with tools. Use LangGraph when you need custom control flow, several agents, explicit retries or human approval.

Is LangGraph open source?

Yes. LangGraph is MIT-licensed and free to self-host. LangSmith tracing and LangSmith Deployment are the paid, optional parts.

How can I build an AI agent using LangGraph?

Define a state schema, write nodes for each step, and connect them with edges, including conditional ones for retries. Then compile the graph with a checkpointer. The IBM explainer and the LangGraph docs are good starting points.

‍