What is LangGraph?

LangGraph is an open source library, in Python and JavaScript, for building AI agents and workflows as graphs: each node is a function, each edge decides which node runs next, and a shared state object carries data between them. LangChain Inc builds it and calls it “a low-level orchestration framework and runtime for building, managing, and deploying long-running, stateful agents” docs.langchain.com. It runs the agent for you, including saving its state and resuming it after a crash, and leaves prompts, tools and business logic to your code.

LangGraph is MIT licensed, and its product page FAQ answers “Is it free?” with “Yes. LangGraph is an MIT-licensed open-source library and is free to use” langchain.com. On 20 October 2026, PyPI listed version 1.2.16 (released 16 October 2026, Python 3.10 or later) pypi.org. The same day, npm listed the JavaScript package @langchain/langgraph at 1.5.1 npmjs.com. The GitHub repository, created in August 2023, had 43,571 stars github.com. When LangChain announced the 1.0 releases on 22 October 2025, it promised “no breaking changes until 2.0” langchain.com.

The overview says LangGraph “does not abstract prompts or architecture” and is “focused entirely on agent orchestration”. You write more code than with a higher-level library, and in return you decide which steps a model controls and which are plain code. The docs describe this as the ability to “mix deterministic, hand-coded steps with LLM-driven agentic steps in the same graph”.

How does a LangGraph agent run?

You define a state schema, add nodes and edges to a StateGraph, compile it and invoke it. LangGraph then runs the nodes in rounds called super-steps and, if you attach a checkpointer, saves the state after each round.

The Graph API docs name three parts. State is the “shared data structure that represents the current snapshot of your application”, and the main documented way to define it is a Python TypedDict. Nodes are functions that read the state and return updates. Edges are functions too, and “They can be conditional branches or fixed transitions.” The docs sum it up as “nodes do the work, edges tell what to do next” docs.langchain.com.

Each key in the state has a reducer that decides how a node’s update is applied. With no reducer, a new value replaces the old one; with a reducer such as list addition, updates accumulate. This is how a list of messages grows across steps while a field like status is simply overwritten.

Execution is modelled on Google’s Pregel system, where “the program proceeds in discrete ‘super-steps’”. In the docs’ words, “Nodes that run in parallel are part of the same super-step, while nodes that run sequentially belong to separate super-steps”. The graph has to be compiled before it runs, and compiling is also where you attach a checkpointer. A checkpointer “saves a snapshot of graph state at each super-step, organized into threads” docs.langchain.com, and that snapshot is what lets a run pause and pick up later.

If you would rather not draw a graph, the Functional API adds the same persistence, memory, human-in-the-loop and streaming features to ordinary Python functions marked @entrypoint and @task, using normal if statements and loops for control flow docs.langchain.com.

A small accounts payable graph shows the parts working together (our example, not one from LangGraph’s docs).

One invoice through a LangGraph graph (our example)

Step list
  1. ExtractAn LLM node reads the invoice and writes vendor, amount and PO number into the state.
  2. MatchA plain Python node compares the invoice with the purchase order and receipt and writes match or mismatch into the state, with no model involved.
  3. RouteA conditional edge reads that field: a match goes to the posting node, a mismatch goes to a review node.
  4. Pause for reviewThe review node calls interrupt(). LangGraph saves the state through the checkpointer and waits, for minutes or days, until the graph is invoked again on the same thread.
  5. ResumeYour app resumes the run with a Command carrying the reviewer's decision, which becomes the return value of interrupt() inside the node.
  6. PostThe posting node writes to the ERP. If the server restarted while the run was waiting, a database checkpointer such as Postgres still holds the last checkpoint, and the thread ID resumes from there.

The pause in step 4 is documented behaviour. When an interrupt fires, “LangGraph saves the graph state using its persistence layer and waits indefinitely until you resume execution”. Interrupts “can be placed anywhere in your code and can be conditional based on your application logic” docs.langchain.com.

What is the difference between LangGraph and LangChain?

LangChain is the higher-level agent framework, and LangGraph is the lower-level runtime it runs on. LangChain’s create_agent gives you a working agent from a model, tools, a prompt and optional middleware; LangGraph is what you use when you want to define the steps yourself. In LangChain’s own words: “While LangChain is built on top of LangGraph, you don’t need to know LangGraph to use LangChain.” docs.langchain.com

The relationship used to point the other way. LangChain introduced LangGraph on 17 January 2024 as a “module built on top of LangChain to better enable creation of cyclical graphs, often needed for agent runtimes”. LangChain’s chains were, in the post’s words, “directed acyclic graphs”, and an agent needs a loop: the post describes it as “running an LLM in a for-loop” langchain.com. The 1.0 releases reversed it. The LangGraph v1 notes say “LangChain’s create_agent runs on LangGraph. Use LangChain for a fast start; drop to LangGraph for custom orchestration”, and LangGraph’s own prebuilt create_react_agent was deprecated in favour of LangChain’s create_agent docs.langchain.com. Tutorials from before October 2025 that present LangGraph as an add-on to LangChain describe the old arrangement.

LangChain’s docs now sort the stack into three layers. Runtimes (LangGraph, alongside Temporal and Inngest) handle durable execution, streaming, human-in-the-loop and persistence. Frameworks (LangChain, alongside CrewAI, the OpenAI Agents SDK, Google ADK, LlamaIndex and Vercel’s AI SDK) provide abstractions and integrations. Harnesses such as Deep Agents are “opinionated, batteries-included frameworks with built-in tools and capabilities for building sophisticated, long-running agents” docs.langchain.com. Deep Agents adds “planning, subagents, filesystem tools, and context management on top of LangGraph” docs.langchain.com.

LangGraph, LangChain and the layers around them: what each one leaves to you (our summary of the vendors' docs, checked 20 October 2026)
LayerWhat it isWhat you writePick it whenWhat it leaves to you
LangGraph Runtime and low-level orchestration library (MIT)State schema, nodes, edges, and where to pauseSteps follow your process, branches depend on data, runs wait for people or must survive restartsPrompts, tools, and what goes into long-term memorydocs.langchain.com
LangChain (create_agent) Agent framework built on LangGraph (MIT)Model, tools, system prompt, optional middlewareThe agent is a model calling tools in a loop until it answersCustom control flow beyond the agent loopdocs.langchain.com
Deep Agents Harness built on LangGraphInstructions, tools, subagentsLong, open-ended tasks that need planning, subagents and a filesystemFine control over each stepdocs.langchain.com
LangSmith LangChain's commercial platform for tracing, evaluation and deploymentConfiguration; works with any of the aboveYou want hosted tracing, evals or managed deploymentFree Developer plan; Plus is $39 per seat per month plus usagelangchain.com
Trail Memory and context layer the agent consults for approved business rulesA retriever or MCP call from a nodeAgents must apply rules a named person approved, each cited to its sourceOrchestration; the agent runs elsewhere and calls Trail for rulestrailhq.com

Facts in this table were checked against the sources listed at the end of this page, between and .

When should you build with LangGraph directly?

Build with LangGraph when your process, not the model, decides the shape of the work: steps in a fixed order, branches chosen by data, parallel work, or long waits for a person. If the agent is a model calling tools in a loop until it has an answer, create_agent needs less code and runs on LangGraph anyway.

LangChain’s docs list the cases in general terms, for example “You’re building complex workflows that combine deterministic and agentic steps” for LangGraph and “You’re building straightforward agent applications without complex orchestration needs” for LangChain docs.langchain.com.

Signals that a project needs a LangGraph graph rather than create_agent alone (our rule)

Checklist
  • Some steps must be plain code in a set orderA three-way match before payment, a sanctions check before a refund. In a graph these are nodes with no model in them, so they run the same way every time.
  • A run waits hours or days for a personinterrupt() plus a checkpointer pauses anywhere inside a node and resumes on the same thread. LangChain has human-in-the-loop middleware for approving tool calls, which may be enough if approving tool calls is all the pausing you need.
  • Branches depend on data, not on the model's choiceConditional edges read the state, so an amount over a threshold always takes the approval path.
  • Work fans out and joinsNodes in the same super-step run in parallel, for example checking three suppliers at once before a decision node.
  • You need to replay or fork a past runCheckpointers let you "replay prior graph executions to review and / or debug specific graph steps", which helps when an auditor asks why a run went one way.
  • Several agents hand work to each otherA subgraph is a graph used as a node in another graph, so separate teams can build and test each agent on its own.

Our rule of thumb: if two or more of these apply, design the flow as a LangGraph graph from the start. With one, start with create_agent and move that part into a graph when it gets in the way. With none, LangGraph’s own overview points you elsewhere: “If you are just getting started with agents or want a higher-level abstraction, we recommend you use LangChain’s agents” docs.langchain.com.

How does LangGraph store memory between runs?

Through two persistence systems: checkpointers keep the state of one thread (short-term memory), and stores keep key-value data that any thread can read (long-term memory) docs.langchain.com.

Checkpointers come as separate packages: an in-memory saver for experiments, SQLite, which the docs call “Ideal for experimentation and local workflows”, and Postgres or MongoDB for production docs.langchain.com. Stores hold “arbitrary key-value data accessible from any thread”, organised by namespaces you choose. A store can also be configured with an embedding model, and then it “supports semantic search, allowing you to find memories based on meaning rather than exact matches” docs.langchain.com.

What goes into the store is up to your code. The memory concepts page says “Long-term memory is a complex challenge without a one-size-fits-all solution” docs.langchain.com. On the persistence, stores, memory and interrupts pages we found no mention of an approval step for writes to the store. Nor did we find source citations on stored items or access control on namespaces. On LangSmith’s Agent Server, access rules for store operations are custom auth handlers you write docs.langchain.com. That is fine for a user’s preferred language or a chat summary. It matters more when an agent saves “vendor X may skip the match” and every later run treats it as policy. Our guides on governing a memory layer for LLM agents and on choosing a memory layer for AI agents cover that problem, and LangGraph appears in the second.

Is LangGraph free, and what does LangChain charge for?

The library is free under the MIT licence, and you can run it on your own servers with your own database. LangChain charges for LangSmith, which the docs describe as “the platform for tracing, evaluation, prompts, and deployment across frameworks” docs.langchain.com.

LangSmith’s Developer plan costs “$0 / seat per month then pay as you go”, and the Plus plan costs “$39 / seat per month then pay as you go”, with “Access to Deployment, Engine, and more” langchain.com. The paid tier also changes who runs persistence. On LangChain’s Agent Server, “you do not need to implement or configure checkpointers or stores manually” docs.langchain.com. Self-hosting means running and backing up a production checkpointer, such as Postgres or MongoDB, yourself.

How a LangGraph agent can read approved business rules from Trail

LangGraph decides which node runs next; which company rules apply to the invoice in its state has to come from somewhere else. Trail, the memory and context layer for enterprise AI agents, covers that part: it turns policies, SOPs and documents into rules that a named person approves, and agents query it. Its homepage says it “ships a Model Context Protocol (MCP) server plus native retrievers for LangChain and LlamaIndex and plain REST/GraphQL APIs” trailhq.com. The main site explains what an MCP server is if that route is new to you.

Picture an invoice graph that extracts, matches, routes and pauses for review. A node before the decision step would call Trail through the LangChain retriever and write the returned rules into the state. LangGraph’s docs commonly use LangChain components to integrate models and tools. The how-it-works page for Trail’s Context Graph says what comes back is ordered rules, “each cited, each scored”. It also says “Where confidence is low, Trail says so and names what’s missing”, and that “your team sets the threshold below which an agent must stop and ask rather than proceed” trailhq.com. In LangGraph terms that threshold could map onto a conditional edge to an interrupt node. The two keep different records: LangGraph’s checkpointer holds the state of each run, and Trail holds the rules. On the rule side, “Nothing becomes available to an agent because a model inferred it”, and each rule carries “A named approver, with a timestamp” trailhq.com. An agent can flag a problem, but in Trail’s words “It can report. It cannot approve.” trailhq.com

Where it is not the fit: a chat assistant or a coding agent with no company rules to apply gets little from it, and LangGraph’s own checkpointer and store already cover conversation history and user preferences. Approving rules also takes an owner’s time. We found no page on trailhq.com that mentions LangGraph by name; the documented route is the LangChain retriever, MCP or the APIs, and we did not build or test that connection. For how rule layers compare on approval and versioning, see our AI rule engine comparison.

How we checked LangGraph’s docs, releases and licence

On 20 October 2026 we read LangGraph’s README, licence and release list on GitHub, and its PyPI and npm metadata. From LangChain’s docs we read the pages for the overview, Graph API, Functional API, checkpointers, stores, interrupts, persistence and memory concepts, plus the runtimes, frameworks and harnesses comparison, and the v1 release notes. We read the January 2024 and October 2025 announcements on LangChain’s blog for the history, the LangSmith pricing page, and the two top-ranking pages for these questions to see what they covered. Version numbers and star counts change often; they are as fetched that day. The invoice example, the layer table and the six-signal rule are our own synthesis. We did not write or run LangGraph code for this page. Trail publishes this page.

Frequently asked questions

What is LangGraph?

LangGraph is an open source library from LangChain Inc for building AI agents and workflows as graphs, where nodes are functions, edges choose the next node and a shared state carries the data. It adds the runtime parts an agent needs in production: checkpoints after each step, pauses for human input, and resuming after a failure. It is MIT licensed, with Python and JavaScript versions.

What is the difference between LangGraph and LangChain?

LangChain is the higher-level agent framework: its create_agent function gives you a model, tools, a prompt and middleware in a few lines. LangGraph is the lower-level runtime underneath, and LangChain's docs say LangChain 1.0 is built on top of it. Start with LangChain, and write a LangGraph graph when you need fixed steps, data-driven branches or long pauses for review.

Can you use LangGraph without LangChain?

Yes. The LangGraph README says it is built by LangChain Inc but can be used without LangChain. Nodes are ordinary functions, so they can call any model SDK or plain code; the docs commonly use LangChain components for models and tools but say you don't need LangChain.

Is LangGraph only for Python?

No. LangGraph.js is the JavaScript and TypeScript version, published on npm as @langchain/langgraph and also MIT licensed. On 20 October 2026 the latest npm release was 1.5.1 and the latest Python release on PyPI was 1.2.16.

Who uses LangGraph in production?

LangGraph's README says it is trusted by companies including Klarna, Replit and Elastic. We have not checked those companies' own accounts of how they use it.

Sources checked

Show 23 sources