LangGraph
A low-level library for building stateful, controllable agents as graphs, with checkpointing and human-in-the-loop.
LangGraph models an agent as an explicit state graph of nodes and edges, trading some abstraction for control. Its built-in persistence (checkpointing), human-in-the-loop interrupts, and streaming make it a common choice for production agents that need to be debuggable and resumable.
LangGraph is a low-level orchestration library for building agents as explicit state graphs: you define nodes (steps), edges (transitions), and a shared state object, and the agent's control flow becomes something you can see, test, and resume. It trades the one-line convenience of higher-level frameworks for control — which is exactly what production agents tend to need once they outgrow a demo.
It is aimed at engineers building durable, multi-step or multi-agent systems where you care about persistence, branching logic, and being able to pause for human input. Despite the name, LangGraph does not require the rest of LangChain.
Highlights
- Graph-based control flow — model loops, branches, and multi-agent handoffs as explicit nodes and edges instead of opaque prompt chains.
- Persistence / checkpointing — save and restore agent state, so runs are resumable and crash-safe.
- Human-in-the-loop — interrupt the graph for approval or input, then resume from the exact point.
- Streaming — stream tokens and intermediate steps for responsive UIs and debugging.
- Deployable — pairs with LangGraph Platform for hosted deployment, plus LangSmith for tracing.
In an AI-assisted workflow
from langgraph.graph import StateGraph, START, END
g = StateGraph(State)
g.add_node("retrieve", retrieve)
g.add_node("generate", generate)
g.add_edge(START, "retrieve"); g.add_edge("retrieve", "generate"); g.add_edge("generate", END)
app = g.compile(checkpointer=checkpointer) # resumable, interruptibleTIP
Reach for LangGraph when you need control and durability (checkpoints, HITL, branching). For quick role-based multi-agent setups, a higher-level framework like CrewAI is faster to start — see the framework comparison.
Good to know
LangGraph is open source (MIT) and free to self-host; the optional LangGraph Platform (hosted deployment) and LangSmith (observability) are commercial. It's lower-level than role-based frameworks, so expect to write more wiring in exchange for more control.
Frequently asked questions
- What is LangGraph?
- LangGraph is a low-level orchestration library for building agents as explicit state graphs: you define nodes (steps), edges (transitions), and a shared state object, so the agent's control flow becomes something you can see, test, and resume. Built-in checkpointing, human-in-the-loop interrupts, and streaming make runs durable and debuggable. Despite the name, it does not require the rest of LangChain.
- Is LangGraph free?
- Yes — LangGraph is open source under MIT and free to self-host. The optional LangGraph Platform (hosted deployment) and LangSmith (observability) are commercial.
- LangGraph vs CrewAI?
- LangGraph trades one-line convenience for control: explicit graphs, persistence, and human-in-the-loop, which production agents tend to need once they outgrow a demo. For quick role-based multi-agent setups, a higher-level framework like CrewAI is faster to start.
Related
- CrewAIA Python framework for orchestrating role-playing AI agents as collaborating 'crews', plus event-driven flows.
- OpenAI Agents SDKOpenAI's lightweight, open-source framework for agents — handoffs, guardrails, sessions, and built-in tracing.
- AutoGen (AG2)A multi-agent conversation framework where agents collaborate via message-passing, with group chat and code execution.
- Which Agent Framework in 2026? LangGraph vs CrewAI vs AutoGen vs OpenAI Agents SDK vs Claude Agent SDKA decision guide to the major AI agent frameworks — control vs. abstraction, multi-agent models, state and durability, and which fits your project.
- Mem0A memory layer for AI agents and apps — persistent, personalized long-term memory across sessions.
- Agent Tool Integration EngineerUse this agent to wire tools and function-calling into an agent loop reliably — clean tool schemas, errors fed back as observations, retries with limits, idempotency, and parallel calls. Examples — "connect our APIs as agent tools", "our agent calls tools wrong / ignores tool errors", "add function-calling with proper error recovery to our agent".
- LangChain vs LlamaIndex in 2026: Agents or Data?The classic framework confusion resolved — LangChain's agent loop and ecosystem vs LlamaIndex's data-and-documents depth — and when you'd genuinely use both.
- LangGraph vs CrewAI: Agent Frameworks Compared (2026)LangGraph vs CrewAI — explicit state-machine control vs role-based crew abstractions. Which agent framework fits your reliability bar and team.
- OpenAI Agents SDK vs LangGraph: Minimal vs Controllable (2026)OpenAI Agents SDK's three-primitive minimalism vs LangGraph's explicit graph and durable state — which agent framework matches your reliability bar in 2026.
- Agent Memory Architecture: Short-Term, Long-Term, and When to Use EachHow AI agents remember — working memory vs. persistent long-term memory, what to store, how to retrieve it, and how to keep context small.
- LangchainThe provider-agnostic agent framework, post-1.0: a standard create_agent loop on the LangGraph runtime, middleware hooks, and the largest integration ecosystem.
- Pydantic AIType-safe agent framework from the Pydantic team: validated structured outputs, dependency injection, durable execution, 'that FastAPI feeling.'