All resources

Authority AI Editorial

LangGraph: building agents as graphs

A directed graph of glass nodes floating in dark space, connected by luminous violet lines, with one path through the graph lit while the rest stay dim.

LangGraph is a low-level orchestration framework and runtime for building agents whose control flow you define as a graph rather than as one long prompt loop. It comes from LangChain Inc, the team behind LangChain, but it does not require LangChain to use. The reader this is for is someone building or running agents who needs precise control over what happens at each step, when the agent should pause for a human, and how the agent recovers if a step fails partway through a long run.

What it does

LangGraph organizes an agent around three pieces: nodes, edges, and state. A node is a unit of work, either deterministic code or a call to a language model. Edges are the directional paths between nodes, including built-in START and END markers, and they can branch conditionally based on what a node returned. State is the data structure that flows through the graph and persists as the agent moves from node to node, so an agent can hold onto context across many steps or across a session that resumes later. You define nodes, connect them with edges inside a StateGraph, compile the graph into a runnable object, and invoke it with input. Because the graph is explicit, you can inspect exactly which path an agent took and reason about failure points the same way you would with any other pipeline, rather than trying to infer the path from a transcript of model outputs.

How you use it

Install it with pip install -U langgraph and build directly against the Python API, or use the JavaScript and TypeScript equivalent, LangGraph.js, if that is your stack. LangGraph exposes durable execution, meaning a compiled graph can persist through failures and resume from the last completed step instead of restarting a long-running job from scratch. It also supports human-in-the-loop interrupts: you can pause a graph at a defined point, inspect or edit the state, and resume it, which matters for anything where a person should approve an action before it runs. For teams that want a higher-level starting point instead of assembling a graph from scratch, LangChain also publishes Deep Agents, a package built on top of LangGraph aimed at agents that plan, delegate to subagents, and use a file system, and LangSmith for tracing and evaluating agent runs once they are built.

A close-up of one glass node with a glowing checkpoint ring around it and a thread of light leaving toward the next node.

What to know before adopting it

LangGraph is MIT licensed and open source, and the core package itself has no direct cost. It is Python-first, with a maturing JS/TS port, and it targets developers comfortable writing code rather than assembling agents in a visual builder. Running it standalone requires you to bring your own model provider and manage your own deployment, whether that is a container you operate or a serverless function. If you want managed deployment, observability, and a visual studio for prototyping graphs, LangChain sells that separately as LangSmith and LangSmith Deployment; those are commercial products layered on top of the open-source graph engine, not requirements to use LangGraph itself. The framework is described by its maintainers as low-level, so expect to write more explicit wiring than you would with a framework that ships opinionated agent templates out of the box.

Where it sits next to similar tools

LangGraph's closest comparison is CrewAI: both are Python libraries you import into code you control, rather than hosted platforms with a builder UI, but they start from different mental models. CrewAI organizes work around named agents with roles collaborating on tasks; LangGraph organizes work around an explicit state machine, which suits cases where you need to guarantee a specific sequence, add a manual approval gate, or recover cleanly from a crash midway through a run. Compared to AutoGPT's current platform, which is a hosted or self-hosted product with a drag-and-drop canvas and a marketplace, LangGraph is closer to infrastructure: something you build your own agent product on top of rather than a finished tool you point at a task. People wiring up their own agent instructions rather than a graph runtime sometimes reach for a fixed library instead, such as the AI Ultimate Skill Collection, which packages 3,029 ready-made skills in 12 packs that your agent follows step by step.

Sources