LangGraph.js

Framework · Last verified 2026-09-30

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

LangGraph.js key facts. Data as of 2026-09-30.
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: StateGraph over a StateSchema (for example Zod fields), with nodes, fixed or conditional edges, and Command for 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-supervisor and @langchain/langgraph-swarm for 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

MCP, A2A and AG-UI support for LangGraph.js. See the full matrix.
ProtocolSupportNote
MCP Partial evidence
checked 2026-09-30
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
checked 2026-09-30
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
checked 2026-09-30
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

Install not yet verified by this site. What this means

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/langgraph declares node >=18 and needs @langchain/core (^1.1.48) and zod (^3.25.32 or ^4.2.0) as peer dependencies.
  • Model providers are separate packages; the docs use LangChain integrations such as langchain plus a provider package and its API key.
  • interrupt() only works with a checkpointer and a thread_id in the config; MemorySaver loses 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 createReactAgent in favour of LangChain's createAgent; the swarm add-on still only supports createReactAgent.

Official quickstart

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 StateGraph constructor, 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 createReactAgent prebuilt is deprecated in v1, so older examples need migrating to LangChain's createAgent. (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

Unknown fields: protocols.a2a: searched the LangChain TypeScript docs index, the LangGraph.js README and a code search of langchain-ai/langgraphjs for 'a2a'. The Agent Server A2A page lists langgraph-api >= 0.4.21, a Python package version; the JS libs/langgraph-api source has no A2A route, and the only A2A code is an example stream transformer under examples/streaming. Whether LangSmith-hosted JS deployments expose /a2a is not stated.