LangGraph.js
TL;DR
LangGraph.js is the JavaScript and TypeScript edition of LangGraph from LangChain Inc., an MIT-licensed low-level runtime that models agents as graphs of nodes over shared state, with checkpointing, interrupts for human review and long-term stores. It suits TypeScript teams that want explicit control over multi-step or multi-agent flows instead of a prebuilt agent loop.
Key facts
| Type | Framework |
|---|---|
| Languages / SDKs | TypeScript, JavaScript |
| License | MIT |
| Pricing model | Open core |
| Orchestration pattern | Graph |
| GitHub stars | 3,327 (as of 2026-09-30) |
| GitHub forks | 593 |
| Last push | 2026-09-29 |
| Latest release | @langchain/langgraph-cli@1.5.1 |
| Repository | langchain-ai/langgraphjs |
| Website | www.langchain.com |
| Documentation | docs.langchain.com |
| Last verified | 2026-09-30 |
Key features
- Graph API:
StateGraphover aStateSchema(for example Zod fields), with nodes, fixed or conditional edges, andCommandfor routing from inside a node. (source) - Functional API that brings checkpointing and interrupts to code written with ordinary functions and control flow. (source)
- Checkpointers that save thread state at each step, with official savers for SQLite, PostgreSQL, MongoDB and Redis besides the in-memory
MemorySaver. (source) interrupt()pauses a node and returns a payload under__interrupt__;new Command({ resume })continues the same thread. (source)- Time travel: replay a thread from an earlier checkpoint or fork it with changed state. (source)
- Stores for long-term memory shared across threads, separate from per-thread checkpoints. (source)
- Subgraphs: a compiled graph can serve as a node of another graph, the building block for multi-agent designs. (source)
- Add-on packages
@langchain/langgraph-supervisorand@langchain/langgraph-swarmfor supervisor and swarm-style agent teams. (source)
Architecture and orchestration pattern
Pattern: Graph
A LangGraph.js program is a StateGraph: a state schema, nodes that return partial state updates, and edges that choose the next node, either fixed or conditional. A node can also return a Command that updates state and names the next node. The runtime follows the Pregel model of super-steps, so nodes on parallel branches run in the same step. A Functional API offers the same runtime for code written with plain functions.
The library has no agent-role abstraction of its own. Multi-agent systems are built by composing graphs, since a compiled graph can be a node in a parent graph, or by using the supervisor and swarm add-on packages in the same repository. LangChain's JavaScript multi-agent guides (subagents, handoffs, router) run on this runtime, and its createAgent loop is built on LangGraph.
Persistence has two layers. Checkpointers save a thread's state after every step under a thread_id, which enables resumption, replay and forking; official savers cover SQLite, PostgreSQL, MongoDB and Redis. Stores keep data across threads for long-term memory. MemorySaver and MemoryStore are intended for development.
Human in the loop
Any node can call interrupt(value). The run stops, the checkpointer saves state, and the payload is returned to the caller in the __interrupt__ field. The caller resumes by invoking the graph again on the same thread_id with new Command({ resume: value }), which becomes the return value of interrupt(). The docs cover approve or reject gates, review-and-edit of generated content, and validation of human input. Since v1, StateGraph can declare typed interrupts in its constructor.
A checkpointer and a thread ID are required. On resume the node runs again from its first line, so side effects placed before the interrupt should be idempotent, and loops that call interrupt() repeatedly inside one node replay earlier iterations. Past checkpoints can be replayed or forked with edited state through time travel.
Protocols
| Protocol | Support | Note |
|---|---|---|
| MCP | Partial evidence | Client only, through the companion LangChain package @langchain/mcp-adapters (MultiServerMCPClient), whose docs page is labeled legacy; LangGraph.js has no MCP code of its own, and its JS dev server ignores local MCP settings. |
| A2A | Unknown | LangSmith's Agent Server A2A endpoint is documented against the Python langgraph-api package; no A2A route was found in the JS langgraph-api source, only an example stream transformer that formats events in A2A shape. |
| AG-UI | Partial evidence | LangChain's JS docs mount CopilotKit's runtime with LangGraphAgent next to a LangGraph deployment so it speaks AG-UI; the bridge is CopilotKit's package, not part of LangGraph.js, and the AG-UI README lists LangChain under partnerships. |
Best for
- TypeScript projects that need explicit, typed control over each step and branch of an agent
- Flows that must pause for a human decision and resume later from saved state
- Keeping agent state in your own SQLite, PostgreSQL, MongoDB or Redis database
- Teams that already use LangGraph in Python and want the same model in Node.js
Not for
- Getting a basic tool-calling agent running quickly; the docs point to LangChain's prebuilt agents or Deep Agents for that
- Python codebases, which use the separate LangGraph Python library
- Teams that want role and task abstractions supplied by the framework
Quickstart
npm install @langchain/langgraph @langchain/core import { Command, MemorySaver, START, END, StateGraph, StateSchema, interrupt } from "@langchain/langgraph";
import * as z from "zod";
const State = new StateSchema({ draft: z.string(), approved: z.boolean().nullable() });
const graph = new StateGraph(State)
.addNode("write", () => ({ draft: "Refund order 123" }))
.addNode("review", (state) => ({ approved: interrupt({ check: state.draft }) as boolean }))
.addEdge(START, "write")
.addEdge("write", "review")
.addEdge("review", END)
.compile({ checkpointer: new MemorySaver() });
const config = { configurable: { thread_id: "t1" } };
const first = await graph.invoke({ draft: "", approved: null }, config);
console.log(first.__interrupt__); // waiting for a reviewer
const done = await graph.invoke(new Command({ resume: true }), config);
console.log(done.approved); // true
Common pitfalls
@langchain/langgraphdeclaresnode >=18and needs@langchain/core(^1.1.48) andzod(^3.25.32 or ^4.2.0) as peer dependencies.- Model providers are separate packages; the docs use LangChain integrations such as
langchainplus a provider package and its API key. interrupt()only works with a checkpointer and athread_idin the config;MemorySaverloses state on restart.- On resume the interrupted node re-runs from the top, so keep side effects after
interrupt()or make them idempotent. - v1 deprecated the prebuilt
createReactAgentin favour of LangChain'screateAgent; the swarm add-on still only supportscreateReactAgent.
Pros
- v1 kept graph primitives and the execution model unchanged, so upgrades are mostly package bumps. (source)
- Official checkpoint savers for SQLite, PostgreSQL, MongoDB and Redis ship from the same project. (source)
- Interrupts can be declared with types in the
StateGraphconstructor, which constrains payloads and resume values. (source) - Usable without LangChain; the README says it is built by LangChain Inc. but does not require LangChain. (source)
Cons
- Deliberately low-level; the overview steers newcomers to LangChain's prebuilt agents first. (source)
- The
createReactAgentprebuilt is deprecated in v1, so older examples need migrating to LangChain'screateAgent. (source) - The swarm add-on has not been tested with LangChain 1.0 agents and only supports
createReactAgent. (source) - Resuming an interrupt re-executes the whole node, which can repeat non-idempotent side effects. (source)
- The JS dev server warns that local MCP features are not yet supported and ignores them. (source)
Alternatives
FAQ
Does LangGraph.js support MCP?
Partly. MCP tools come in through LangChain's separate @langchain/mcp-adapters package (MultiServerMCPClient). LangGraph.js itself has no MCP code, and its JS dev server ignores local MCP settings.
Is LangGraph.js free?
Yes, it is MIT-licensed. LangChain Inc. sells LangSmith plans for tracing and managed deployment, listed on its pricing page.
How does LangGraph.js relate to LangGraph for Python?
It is a separate repository and npm package (@langchain/langgraph) with the same graph, checkpoint and interrupt concepts. Some server features, such as the Agent Server A2A endpoint, are documented only for the Python server package.
Which Node.js version does it need?
@langchain/langgraph declares Node.js 18 or newer, with @langchain/core and zod as peer dependencies.
What is the current version?
The core package @langchain/langgraph was at 1.4.18 on 2026-09-25. The repository also releases the CLI and other packages under separate tags.
Sources
- LangGraph.js GitHub repository
- LangGraph.js core README
- @langchain/langgraph package.json
- @langchain/langgraph 1.4.18 release
- LangGraph.js releases
- JS langgraph-api server source (MCP warning)
- langgraph-swarm README
- langgraph-supervisor README
- LangGraph.js overview (docs)
- Install LangGraph.js (docs)
- Graph API (docs)
- Functional API (docs)
- Persistence (docs)
- Checkpointers (docs)
- Interrupts (docs)
- Time travel (docs)
- Stores (docs)
- Subgraphs (docs)
- What's new in LangGraph.js v1
- LangChain JS multi-agent guide
- LangChain JS MCP adapters (legacy docs)
- LangChain JS CopilotKit / AG-UI integration
- Agent Server A2A endpoint (docs)
- AG-UI README, supported integrations
- LangChain / LangSmith pricing
- LangGraph product page