Skip to content

LangGraph (TypeScript)

Stateful, graph-based agents for TypeScript — StateGraph, createAgent and middleware, interrupts, Send and Command, streaming, persistence and production.

GroupMulti-Agent
Current versionv1.7.4
Bonds withTs

TypeScript port of LangGraph. Same graph-based mental model as the Python version — explicit state, durable checkpoints, conditional routing — with type-safe streaming, Zod/Standard Schema state, and ReducedValue/UntrackedValue field types. Ready-made agents come from createAgent in the langchain package.

Current version: @langchain/langgraph 1.7.4 (checked 2026-11-19). Node 20+.

Install

Terminal window
npm install @langchain/langgraph

Best for

Cycles, conditional routing, multi-agent coordination, streaming servers.

  • New in @langchain/core 1.3.0: tool-call arguments stream as tool-call-delta slices instead of block-delta snapshots (see Other additions). @langchain/langgraph is unchanged at 1.7.4.
  • 1.5.x — parallel writes are ordered by task path (as in Python), plus fixes to DeltaChannel, exit durability, interrupt resumption and node-cache persistence. No API removals.
  • 1.4.x — node-level timeout (NodeTimeoutError) and errorHandler; StateGraph.setNodeDefaults() for graph-wide retryPolicy/cachePolicy; cooperative draining with RunControl/GraphDrained; DeltaChannel (beta); RemoteGraph v3 streaming (1.4.0); GraphCallbackHandler for interrupt and resume events (1.4.17).
  • 1.3.0 — STREAM_EVENTS_V3_MODES; createGraphRunStream/GraphRunStream/SubgraphRunStream; stream transformers (createLifecycleTransformer, createMessagesTransformer, createSubgraphDiscoveryTransformer, createValuesTransformer).
  • 1.2.0 — Overwrite for bypassing a reducer.
  • 1.1.0 — StateSchema, ReducedValue and UntrackedValue, with Standard Schema support (Zod 4, Valibot, ArkType) and the schema utilities isSerializableSchema, isStandardSchema, getJsonSchemaFromSchema, getSchemaDefaultGetter.

See the comprehensive guide for details.

Terminal window
npm install @langchain/langgraph@1.7.4 @langchain/core
import { StateGraph, MessagesAnnotation, START, END, MemorySaver } from '@langchain/langgraph';
import { AIMessage, HumanMessage } from '@langchain/core/messages';
const graph = new StateGraph(MessagesAnnotation)
.addNode('respond', async (state) => ({
messages: [new AIMessage(`You said: ${state.messages.at(-1)?.content}`)],
}))
.addEdge(START, 'respond')
.addEdge('respond', END)
.compile({ checkpointer: new MemorySaver() });
const result = await graph.invoke(
{ messages: [new HumanMessage('Hello')] },
{ configurable: { thread_id: 'session-1' } }
);
console.log(result);

Ready? Start Zero → Hero Step 1 →


DateVersionChanges
2026-10-251.5.2Checked against @langchain/core 1.3.0 and langchain 1.5.19: install lines resolve, examples type-check under strict; added a note on tool-call-delta streaming.
2026-10-251.5.2Release notes rebuilt from the published packages (StateSchema and Standard Schema arrived in 1.1.0, Overwrite in 1.2.0); the per-node tracePolicy claim removed (no released JS version has it). Observability page rewritten with tested callback, GraphCallbackHandler, "tasks" stream and OpenTelemetry examples; middleware page gained custom hooks, execution order and a built-ins table; Express page gained token streaming per thread and a working container build; RunControl draining and DeltaValue examples added. Fixed the claim that interrupt() works without a checkpointer (it throws).
2026-10-211.5.2Examples type-check under strict (chained builders, typed addSequence steps); recommended tsconfig fixed; @langchain/community removed. New page for interrupts, Command, Send, subgraphs, the Functional API and time travel; production guide rewritten around checkpointers, node policies, testing with fakeModel and the LangGraph CLI; invented type-hierarchy diagram replaced.
2026-10-211.5.2Brought up to date with @langchain/langgraph 1.5.2 (from 1.3.5); current version now comes from the site’s version data. Removed the @langgraphjs/toolkit recommendation (that package is an npm security placeholder); agents now use createAgent from langchain. Fixed invented APIs and broken examples across the comprehensive guide, recipes, production guide, middleware and streaming pages (see the comprehensive guide’s revision history). Symbols and examples checked by installing the packages and running the key snippets.
2026-04-211.2.9Index redesigned with Zero → Hero + Jump-to-topic grid.
April 19, 20261.2.9Standard JSON Schema; new type utilities.
November 20251.0.2Initial TypeScript guide.

Note: Python implementation lives at LangGraph (Python).