LangGraph
What it is
LangGraph is a low-level orchestration framework and runtime for long-running, stateful agents, from LangChain. You define a workflow as a graph of shared state, nodes, and edges, and you can mix deterministic steps with LLM-driven steps in the same graph. It focuses on orchestration — durable execution, streaming, and human-in-the-loop — and it does not prescribe prompts or an agent architecture.
That makes LangGraph different from a ready-made agent harness. If you want a standard agent loop, LangChain’s docs suggest Deep Agents or LangChain agents first. Use LangGraph when you need explicit control over state and control flow: when a step must always run, when a run must pause for a human, or when it must resume after a failure exactly where it stopped.
Who made it
LangGraph is made by LangChain, Inc. The documentation is at docs.langchain.com, and the source is on GitHub under the langchain-ai organisation.
- Official docs: https://docs.langchain.com/oss/python/langgraph/overview
- GitHub: https://github.com/langchain-ai/langgraph
What it does
LangGraph lets you build agents that remember, pause, and recover. Its core features are persistence, which checkpoints state so a run can resume after a failure or a pause; human-in-the-loop, which stops execution so a person can inspect or edit state before it continues; memory, both short-term state for a thread and longer-term memory across sessions; and streaming, which sends tokens, state updates, and events as the graph runs.
You can build sequences, branches, and loops. Because LangGraph supports cycles, an agent can call a model, use a tool, check the result, and loop back — the pattern behind most agents. You can also build multi-agent graphs, where different nodes are different agents, and subgraphs that handle part of a task. LangGraph works on its own and does not require LangChain, although docs examples often use LangChain for models and tools.
How it works
A graph has three parts. State is a shared snapshot of the application, usually a typed schema, that every node can read and update. Nodes are functions that do work: they read state, call a model, run code, or call a tool, and return updates. Edges are fixed or conditional transitions that decide which node runs next.
You build a graph with StateGraph, add nodes and edges, then compile it. LangGraph runs the graph in discrete super-steps, in the style of Google’s Pregel system. Send lets you run the same node once per item when the number of items is only known at run time, and Command lets a node update state and route to the next node, including resuming after an interrupt. A checkpointer is required for interrupt() to pause and resume, and LangGraph checkpoints at node boundaries, so a resumed run restarts from the beginning of the node where it stopped. A recursion limit caps how many super-steps one run may take.
How to start
- Install LangGraph with
pip install langgraphin Python, or the matching package for JavaScript. Check the official docs for the current install command. - Read the LangGraph overview and quickstart in the docs, which build a small calculator agent.
- Define your state schema first: what data every step needs to share.
- Write one node per step, each a function that takes state and returns updates. Keep each node small and testable.
- Add edges between nodes, compile the graph with a checkpointer, and run it with a thread ID so you can resume it.
- Add one interrupt for human review before any step that changes data, and test pausing and resuming before you deploy.
The docs offer two APIs: the Graph API, described above, and a Functional API. Start with the Graph API unless the docs for your use case say otherwise.
Who it is for
LangGraph is for developers who need control, durability, and human oversight in an agent. It suits support agents that must pause for approval, research agents that run for a long time, and workflows that mix fixed business rules with AI decisions. It is for people comfortable writing Python or TypeScript and designing state and control flow by hand. It is not the fastest way to build a simple chatbot, and it is not a no-code tool.
Watch out for
LangGraph is low-level on purpose: it gives you control, but you write more code than with a ready-made harness, and you must design your state schema carefully. A bad schema makes every node harder to write. Older tutorials may link to langchain-ai.github.io/langgraph, which is now mostly stale for Python — use docs.langchain.com. The open-source library is free under the MIT licence, according to third-party summaries of the project, but LangGraph deployment tooling and LangSmith are separate products with their own terms — check the official docs before you assume a feature is free. Finally, long-running graphs can use many model calls, so set limits, add interrupts, and test failure and resume behaviour before you trust a graph in production.