LangGraph — used by Replit, Uber, LinkedIn, GitLab and more — is a low-level orchestration framework for building controllable agents. While langchain provides integrations and composable components to streamline LLM application development, the LangGraph library enables agent orchestration — offering customizable architectures, long-term memory, and human-in-the-loop to reliably handle complex tasks.
npm install @langchain/langgraph @langchain/core
[!TIP] If you're looking to quickly build agents, check out Deep Agents — a higher-level package built on LangGraph for agents that can plan, use subagents, and leverage file systems for complex tasks.
For an equivalent Python library, check out LangGraph and the Python docs.
LangGraph provides low-level supporting infrastructure for any long-running, stateful workflow or agent:
[!TIP] For developing, debugging, and deploying AI agents and LLM applications, see LangSmith.
While LangGraph can be used standalone, it also integrates seamlessly with any LangChain product, giving developers a full suite of tools for building agents. To improve your LLM application development, pair LangGraph with:
LangGraph is inspired by Pregel and Apache Beam. The public interface draws inspiration from NetworkX. LangGraph is built by LangChain Inc, the creators of LangChain, but can be used without LangChain.
Stores the last value received, but only made available after finish(). Once made available, clears the value.
Stores the result of applying a binary operator to the current value and each new value.
Reducer channel that stores only a sentinel in checkpoint blobs and reconstructs state by replaying ancestor writes through the reducer.
DeltaChannel avoids re-serializing the full accumulated valu
A Zod v4-compatible meta registry that extends the base registry.
This registry allows you to associate and retrieve metadata for Zod schemas, leveraging the base registry for storage. It is compatib
A registry for storing and managing metadata associated with schemas. This class provides methods to get, extend, remove, and check metadata for a given schema.
Abstract base class for persistent key-value stores.
Stores enable persistence and memory that can be shared across threads, scoped to user IDs, assistant IDs, or other arbitrary namespaces.
Feature
Abstract base class for persistent key-value stores.
Stores enable persistence and memory that can be shared across threads, scoped to user IDs, assistant IDs, or other arbitrary namespaces.
Feature
Stores the result of applying a binary operator to the current value and each new value.
One or more commands to update the graph's state and send messages to nodes. Can be used to combine routing logic with state updates in lieu of conditional edges
Final result from building and compiling a StateGraph.
Should not be instantiated directly, only using the StateGraph .compile()
instance method.
Reducer channel that stores only a sentinel in checkpoint blobs and reconstructs state by replaying ancestor writes through the reducer.
DeltaChannel avoids re-serializing the full accumulated valu
Represents a state field backed by a DeltaChannel.
Unlike ReducedValue (which stores the full accumulated value in every
checkpoint blob via BinaryOperatorAggregate), a DeltaValue field persists
A projection channel for StreamTransformers.
Implements AsyncIterable<T> so it can be iterated directly by
in-process consumers via run.extensions.<key>. Channels created with
StreamChannel.remot
Extend this class and pass an instance through callbacks to observe graph
interrupts and resumes. Lifecycle methods are always awaited, including when
other callbacks run in the background. Set `rai
Raised when a graph run exits early due to a drain request.
This indicates the graph stopped cooperatively at a superstep boundary because RunControl#requestDrain was called (e.g., in response to SIG
Primary run stream for a LangGraph execution.
Implements AsyncIterable over ProtocolEvent and exposes ergonomic projections for values, messages, subgraphs, output, and interrupts. Created by createG
In-memory key-value store with optional vector search.
A lightweight store implementation using JavaScript Maps. Supports basic key-value operations and vector search when configured with embeddings.
Failure context passed to a node-level error handler.
A node-level error handler is registered via
StateGraph.addNode(name, fn, { errorHandler }). The handler runs ONLY after
the failing node's Ret
Raised by a node to interrupt execution.
Raised when a node invocation exceeds one of its configured timeouts.
Does not extend GraphBubbleUp (so it flows through the normal node error path) and is intentionally treated as retryable by t
Bypass a reducer and write the wrapped value directly to a BinaryOperatorAggregate channel.
Receiving multiple Overwrite values for the same channel in a single
super-step will raise an InvalidUpda
Represents a state field whose value is computed and updated using a reducer function.
ReducedValue allows you to define accumulators, counters, aggregators, or other fields whose value is determined
Exception raised when an error occurs in the remote graph.
Run-scoped control surface for cooperative draining.
Intended for a single graph run. Create a fresh RunControl per run; reusing a control after RunControl#requestDrain leaves it drained.
Safe to us
A message or packet to send to a specific node in the graph.
The Send class is used within a StateGraph's conditional edges to
dynamically invoke a node with a custom state at the next step.
Imp
A graph whose nodes communicate by reading and writing to a shared state.
Each node takes a defined State as input and returns a Partial<State>.
Each state key can optionally be annotated with a
Error thrown when invalid input is provided to a StateGraph.
This typically means that the input to the StateGraph constructor or builder did not match the required types. A valid input should be a S
StateSchema provides a unified API for defining LangGraph state schemas.
A run stream for a child subgraph within a parent graph execution.
Extends GraphRunStream with a parsed name and index extracted from the last segment of the namespace path. The segment is expected t
Represents a state field whose value is transient and never checkpointed.
Use UntrackedValue for state fields that should be tracked for the lifetime of the process, but should not participate in dur
The Pregel class is the core runtime engine of LangGraph, implementing a message-passing graph computation model inspired by [Google's Pregel system](https://research.google/pubs/pregel-a-system-for-l
A projection channel for StreamTransformers.
Implements AsyncIterable<T> so it can be iterated directly by
in-process consumers via run.extensions.<key>. Channels created with
StreamChannel.remot
A node that runs the tools requested in the last AIMessage. It can be used either in StateGraph with a "messages" key or in MessageGraph. If multiple tool calls are requested, they will be run in para
Utility class for working with channels in the Pregel system. Provides static methods for subscribing to channels and writing to them.
Channels are the communication pathways between nodes in a Prege
The Pregel class is the core runtime engine of LangGraph, implementing a message-passing graph computation model inspired by [Google's Pregel system](https://research.google/pubs/pregel-a-system-for-l
The RemoteGraph class is a client implementation for calling remote
APIs that implement the LangGraph Server API specification.
For example, the RemoteGraph class can be used to call APIs from de
A projection channel for StreamTransformers.
Implements AsyncIterable<T> so it can be iterated directly by
in-process consumers via run.extensions.<key>. Channels created with
StreamChannel.remot
A projection channel for StreamTransformers.
Implements AsyncIterable<T> so it can be iterated directly by
in-process consumers via run.extensions.<key>. Channels created with
StreamChannel.remot
Abstract base class for persistent key-value stores.
Stores enable persistence and memory that can be shared across threads, scoped to user IDs, assistant IDs, or other arbitrary namespaces.
Feature
Abstract base class for persistent key-value stores.
Stores enable persistence and memory that can be shared across threads, scoped to user IDs, assistant IDs, or other arbitrary namespaces.
Feature
Stores the result of applying a binary operator to the current value and each new value.
The main stream object returned by chat model streaming.
Implements AsyncIterable<ChatModelStreamEvent> for raw event access
and PromiseLike<AIMessage> for simple await usage.
One or more commands to update the graph's state and send messages to nodes. Can be used to combine routing logic with state updates in lieu of conditional edges
Final result from building and compiling a StateGraph.
Should not be instantiated directly, only using the StateGraph .compile()
instance method.
Reducer channel that stores only a sentinel in checkpoint blobs and reconstructs state by replaying ancestor writes through the reducer.
DeltaChannel avoids re-serializing the full accumulated valu
Represents a state field backed by a DeltaChannel.
Unlike ReducedValue (which stores the full accumulated value in every
checkpoint blob via BinaryOperatorAggregate), a DeltaValue field persists
A projection channel for StreamTransformers.
Implements AsyncIterable<T> so it can be iterated directly by
in-process consumers via run.extensions.<key>. Channels created with
StreamChannel.remot
Extend this class and pass an instance through callbacks to observe graph
interrupts and resumes. Lifecycle methods are always awaited, including when
other callbacks run in the background. Set `rai
Raised when a graph run exits early due to a drain request.
This indicates the graph stopped cooperatively at a superstep boundary because RunControl#requestDrain was called (e.g., in response to SIG
Primary run stream for a LangGraph execution.
Implements AsyncIterable over ProtocolEvent and exposes ergonomic projections for values, messages, subgraphs, output, and interrupts. Created by createG
In-memory key-value store with optional vector search.
A lightweight store implementation using JavaScript Maps. Supports basic key-value operations and vector search when configured with embeddings.
Failure context passed to a node-level error handler.
A node-level error handler is registered via
StateGraph.addNode(name, fn, { errorHandler }). The handler runs ONLY after
the failing node's Ret
Raised by a node to interrupt execution.
Raised when a node invocation exceeds one of its configured timeouts.
Does not extend GraphBubbleUp (so it flows through the normal node error path) and is intentionally treated as retryable by t
Bypass a reducer and write the wrapped value directly to a BinaryOperatorAggregate channel.
Receiving multiple Overwrite values for the same channel in a single
super-step will raise an InvalidUpda
The Pregel class is the core runtime engine of LangGraph, implementing a message-passing graph computation model inspired by [Google's Pregel system](https://research.google/pubs/pregel-a-system-for-l
Represents a state field whose value is computed and updated using a reducer function.
ReducedValue allows you to define accumulators, counters, aggregators, or other fields whose value is determined
Exception raised when an error occurs in the remote graph.
Run-scoped control surface for cooperative draining.
Intended for a single graph run. Create a fresh RunControl per run; reusing a control after RunControl#requestDrain leaves it drained.
Safe to us
A message or packet to send to a specific node in the graph.
The Send class is used within a StateGraph's conditional edges to
dynamically invoke a node with a custom state at the next step.
Imp
A graph whose nodes communicate by reading and writing to a shared state.
Each node takes a defined State as input and returns a Partial<State>.
Each state key can optionally be annotated with a
Error thrown when invalid input is provided to a StateGraph.
This typically means that the input to the StateGraph constructor or builder did not match the required types. A valid input should be a S
StateSchema provides a unified API for defining LangGraph state schemas.
A projection channel for StreamTransformers.
Implements AsyncIterable<T> so it can be iterated directly by
in-process consumers via run.extensions.<key>. Channels created with
StreamChannel.remot
A run stream for a child subgraph within a parent graph execution.
Extends GraphRunStream with a parsed name and index extracted from the last segment of the namespace path. The segment is expected t
Represents a state field whose value is transient and never checkpointed.
Use UntrackedValue for state fields that should be tracked for the lifetime of the process, but should not participate in dur
Hydrate channels from a checkpoint, reconstructing any DeltaChannel
whose value is absent from channel_values by replaying ancestor writes.
For most channels (and for delta channels with a DeltaSna
Return the set of DeltaChannel names that should snapshot now.
A channel snapshots when EITHER its accumulated update count reaches
snapshotFrequency OR the total supersteps since its last snapshot
DeltaChannels a branch starting from this checkpoint must snapshot.
A checkpoint's pending writes belong to the child that consumed them, and nothing records which child that was. A new branch snapsh
Synthetic task id for exit-mode writes of a superstep after the anchor's own.
Sorts after every real task id, in step order, so replay keeps them after the anchor's own superstep whether a saver orde
Synthetic task id for exit-mode DeltaChannel writes.
Embeds the superstep in the first UUID group so ORDER BY task_id, idx
preserves chronological order while remaining a valid RFC UUID (required b
Structural check for a DeltaChannel without importing it (avoids an
import cycle: delta.ts imports base.ts).
Get the config schema for a graph.
Get the input schema for a graph.
Get the output schema for a graph.
Get the state schema for a graph.
Get the update schema for a graph.
Creates a GraphRunStream with built-in transformers and kicks off the background pump that feeds raw stream chunks through the transformer pipeline.
Built-in transformers are registered in this order
Create the built-in lifecycle transformer.
Marked as a NativeStreamTransformer so the run stream
factory can expose _lifecycleLog via a dedicated getter
(run.lifecycle) rather than through `run.e
Creates a StreamTransformer that groups messages channel events into
per-message ChatModelStream instances.
A new ChatModelStream is created on message-start and closed on
message-finish. Con
Create the subgraph discovery transformer.
Registering this transformer against a mux replaces the legacy inline behavior that previously lived in StreamMux.push. The mux no longer knows about the su
Creates a StreamTransformer that captures values channel events
into a local StreamChannel. Only events whose namespace exactly
matches path are recorded; events from child or sibling namespaces
are
Define a LangGraph workflow using the entrypoint function.
Function signature
The wrapped function must accept at most two parameters. The first parameter is the input to the function. The
Filter a lifecycle StreamChannel to only the entries whose namespace lies within the subtree rooted at path.
Returns an AsyncIterable whose iterator yields every entry whose
namespace either equals
Filter a SubgraphDiscovery channel to only the direct children of a given namespace.
Returns an AsyncIterable whose iterator yields stream handles for
discoveries whose namespace is exactly one seg
A helper utility function that returns the LangGraphRunnableConfig that was set when the graph was initialized.
Note: This only works when running in an environment that supports node:async_hooks and
A helper utility function that returns the input for the currently executing task.
Note: When called without arguments, this relies on node:async_hooks /
AsyncLocalStorage, which is available in
Get the JSON schema from a SerializableSchema.
A helper utility function for use with the functional API that returns the previous state from the checkpoint from the last invocation of the current thread.
This function allows workflows to access
Detect if a schema has a default value by validating undefined.
Uses the Standard Schema ~standard.validate API to detect defaults.
If the schema accepts undefined and returns a value, that val
A helper utility function that returns the BaseStore that was set when the graph was initialized
Used for subgraph detection.
A helper utility function that returns the LangGraphRunnableConfig#writer if "custom" stream mode is enabled, otherwise undefined.
Interrupts the execution of a graph node.
This function can be used to pause execution of a node, and return the value of the resume
input when the graph is re-invoked using Command.
Multiple inte
True when payload is a lightweight checkpoint envelope (not a full-state
Pregel checkpoints debug payload).
A type guard to check if the given value is a Command.
Useful for type narrowing when working with the Command object.
Checks if the given graph invoke / stream chunk contains interrupt.
Whether error was thrown because a resume value didn't match the interrupt's
responseSchema, directly or as the cause of a wrapping error (such as one
from agent middleware). The resume fails on
Type guard that tests whether a transformer is a NativeStreamTransformer.
Type guard that checks whether a value is a NodeError.
Type guard to check if a given value is a SerializableSchema, i.e.
both a Standard Schema and a Standard JSON Schema object.
Type guard to check if a given value is a Standard Schema V1 object.
Experimental. Batch reducer for use with DeltaChannel.
Processes all writes in one pass — dedup by ID and RemoveMessage
tombstoning — without calling messagesStateReducer.
This reducer is ba
Reducer function for combining two sets of messages in LangGraph's state system.
This reducer handles several tasks:
left and right message inputs to arrays.Manually push a message to a message stream.
This is useful when you need to push a manually created message before the node has finished executing.
When a message is pushed, it will be automaticall
Define a LangGraph task using the task function.
Tasks can only be called from within an entrypoint or from within a StateGraph. A task can be called like a regular function with the following diff
Reducer function for combining two sets of messages in LangGraph's state system.
This reducer handles several tasks:
left and right message inputs to arrays.A conditional edge function that determines whether to route to a tools node or end the graph.
This function is designed to be used as a conditional edge in a LangGraph state graph to implement the c
Maps a protocol event method to its subscription Channel.
Returns undefined for unrecognized methods so that new server-side
channels (e.g. from extension transformers) don't break existing
subscri
Whether namespace starts with prefix.
Segments are compared literally first; if the prefix segment itself contains
no :, the candidate segment is also compared after its dynamic suffix is
strip
@langchain/langgraph/stream — backend toolkit for the v2 streaming protocol.
This entrypoint collects the primitives needed to build a custom transport or server on top of the Agent Streaming Proto
Whether value names a protocol subscription channel — either a base
channel ("messages", "values", …) or a named custom channel
("custom:<name>"). Unknown/future method names return false,
m
Returns whether an event should be delivered for a subscription definition.
When the definition carries a since replay cursor, events at or before
that sequence number are excluded — letting the sa
Strip dynamic suffixes (after :) from a namespace segment.
Server-emitted namespaces contain runtime-generated suffixes like
"fetcher:abc-uuid", while user-supplied subscription filters are typic
True when payload is a lightweight checkpoint envelope (not a full-state
Pregel checkpoints debug payload).
Reducer function for combining two sets of messages in LangGraph's state system.
This reducer handles several tasks:
left and right message inputs to arrays.Creates a GraphRunStream with built-in transformers and kicks off the background pump that feeds raw stream chunks through the transformer pipeline.
Built-in transformers are registered in this order
Create the built-in lifecycle transformer.
Marked as a NativeStreamTransformer so the run stream
factory can expose _lifecycleLog via a dedicated getter
(run.lifecycle) rather than through `run.e
Creates a StreamTransformer that groups messages channel events into
per-message ChatModelStream instances.
A new ChatModelStream is created on message-start and closed on
message-finish. Con
Create the subgraph discovery transformer.
Registering this transformer against a mux replaces the legacy inline behavior that previously lived in StreamMux.push. The mux no longer knows about the su
Creates a StreamTransformer that captures values channel events
into a local StreamChannel. Only events whose namespace exactly
matches path are recorded; events from child or sibling namespaces
are
Define a LangGraph workflow using the entrypoint function.
Function signature
The wrapped function must accept at most two parameters. The first parameter is the input to the function. The
Filter a lifecycle StreamChannel to only the entries whose namespace lies within the subtree rooted at path.
Returns an AsyncIterable whose iterator yields every entry whose
namespace either equals
Filter a SubgraphDiscovery channel to only the direct children of a given namespace.
Returns an AsyncIterable whose iterator yields stream handles for
discoveries whose namespace is exactly one seg
A helper utility function that returns the LangGraphRunnableConfig that was set when the graph was initialized.
Note: This only works when running in an environment that supports node:async_hooks and
A helper utility function that returns the input for the currently executing task.
Note: When called without arguments, this relies on node:async_hooks /
AsyncLocalStorage, which is available in
Get the JSON schema from a SerializableSchema.
A helper utility function for use with the functional API that returns the previous state from the checkpoint from the last invocation of the current thread.
This function allows workflows to access
Detect if a schema has a default value by validating undefined.
Uses the Standard Schema ~standard.validate API to detect defaults.
If the schema accepts undefined and returns a value, that val
A helper utility function that returns the BaseStore that was set when the graph was initialized
Used for subgraph detection.
A helper utility function that returns the LangGraphRunnableConfig#writer if "custom" stream mode is enabled, otherwise undefined.
Interrupts the execution of a graph node.
This function can be used to pause execution of a node, and return the value of the resume
input when the graph is re-invoked using Command.
Multiple inte
True when payload is a lightweight checkpoint envelope (not a full-state
Pregel checkpoints debug payload).
A type guard to check if the given value is a Command.
Useful for type narrowing when working with the Command object.
Checks if the given graph invoke / stream chunk contains interrupt.
Whether error was thrown because a resume value didn't match the interrupt's
responseSchema, directly or as the cause of a wrapping error (such as one
from agent middleware). The resume fails on
Type guard that tests whether a transformer is a NativeStreamTransformer.
Type guard that checks whether a value is a NodeError.
Type guard to check if a given value is a SerializableSchema, i.e.
both a Standard Schema and a Standard JSON Schema object.
Type guard to check if a given value is a Standard Schema V1 object.
Experimental. Batch reducer for use with DeltaChannel.
Processes all writes in one pass — dedup by ID and RemoveMessage
tombstoning — without calling messagesStateReducer.
This reducer is ba
Reducer function for combining two sets of messages in LangGraph's state system.
This reducer handles several tasks:
left and right message inputs to arrays.Manually push a message to a message stream.
This is useful when you need to push a manually created message before the node has finished executing.
When a message is pushed, it will be automaticall
Define a LangGraph task using the task function.
Tasks can only be called from within an entrypoint or from within a StateGraph. A task can be called like a regular function with the following diff
Attach formatted agent names to the messages passed to and from a language model.
This is useful for making a message history with multiple agents more coherent.
Stores the last value received, assumes that if multiple values are received, they are all equal.
Note: Unlike 'LastValue' if multiple nodes write to this channel in a single step, the values will be
A channel that switches between two states
Stores the value received in the step immediately preceding, clears after.
A channel that waits until all named values are received before making the value available.
This ensures that if node N and node M both write to channel C, the value of C will not be updated until N
A configurable PubSub Topic.
Should not be instantiated directly. See Annotation.
Stores the last value received, assumes that if multiple values are received, they are all equal.
Note: Unlike 'LastValue' if multiple nodes write to this channel in a single step, the values will be
The Pregel class is the core runtime engine of LangGraph, implementing a message-passing graph computation model inspired by [Google's Pregel system](https://research.google/pubs/pregel-a-system-for-l
Type bag for ConditionalEdgeRouter that accepts schema types. Unlike GraphNodeTypes, conditional edges don't have separate input/output - they just read state and return routing decisions.
Options accepted by createGraphRunStream.
A channel that switches between two states
Stores the value received in the step immediately preceding, clears after.
Read-only execution info/metadata for the execution of current thread/run/node.
Operation to retrieve an item by namespace and ID.
The root graph paused. Static interrupts can have an empty payload list.
Type bag for GraphNode that accepts schema types. All fields are optional - unspecified fields use defaults.
This enables separate input/output schemas for nodes, which is useful when a node receives
A graph execution resumed from a checkpoint.
Human-in-the-loop interrupt: stable id plus opaque payload for resume UIs.
Represents a stored item with metadata.
Single lifecycle entry surfaced by the in-process
GraphRunStream.lifecycle projection. Combines the CDDL
LifecycleData payload with the namespace it applies to so
consumers can filter or correlate w
Projection returned from the lifecycle transformer's init().
The local StreamChannel is closed automatically when the transformer
finalizes or fails. _lifecycleLog is intentionally underscore-p
Configuration knobs for createLifecycleTransformer.
Operation to list and filter namespaces in the store.
A channel that waits until all named values are received before making the value available.
This ensures that if node N and node M both write to channel C, the value of C will not be updated until N
Marker interface for transformers provided by internal LangChain products (e.g. ReactAgent's ToolCallTransformer, DeepAgent's SubagentTransformer).
Native transformers differ from user-defined extens
An object representing a direct overwrite of a value for a channel. Used to signal that the channel value should be replaced with the given value, bypassing any reducer or binary operator logic.
Configuration options for executing a Pregel graph. These options control how the graph executes, what data is streamed, and how interrupts are handled.
Single envelope for a streaming protocol emission: sequence, channel
(method), and payload (params).
Operation to store, update, or delete an item.
Operation to search for items within a namespace prefix.
Metadata injected by LangGraph Server. Undefined when running open-source LangGraph without LangSmith deployments.
Narrow capability handle passed to StreamTransformer.onRegister. Exposes only the minimal mux surface required for synthetic event emission — intentionally does not expose close/fail/register/etc. to
Observes ProtocolEvents during a graph run and builds typed derived projections (secondary event logs, promises, etc.).
Data is surfaced to consumers through projections returned from
init().
Projection returned by createSubgraphDiscoveryTransformer.
Configuration for createSubgraphDiscoveryTransformer.
Options for the task function
Stable handle for one tool call: name, arguments, and async results.
Emitted when content-block-finish delivers a finalized tool_call block.
A configurable PubSub Topic.
Initialization options for UntrackedValue.
Represents a request for human action within the graph execution. Contains the action type and any associated arguments needed for the action.
Represents an interrupt triggered by the graph that requires human intervention.
This is passed to the interrupt function when execution is paused for human input.
Configuration interface that defines what actions are allowed for a human interrupt. This controls the available interaction options when the graph is paused for human input.
Interface for invoking a tool
Configuration options for executing a Pregel graph. These options control how the graph executes, what data is streamed, and how interrupts are handled.
Minimal protocol-event shape consumed by inferChannel and matchesSubscription.
Both the core ProtocolEvent and the wire-level Event from
@langchain/protocol structurally satisfy this contract, so
Single envelope for a streaming protocol emission: sequence, channel
(method), and payload (params).
Should not be instantiated directly. See Annotation.
Stores the last value received, assumes that if multiple values are received, they are all equal.
Note: Unlike 'LastValue' if multiple nodes write to this channel in a single step, the values will be
The Pregel class is the core runtime engine of LangGraph, implementing a message-passing graph computation model inspired by [Google's Pregel system](https://research.google/pubs/pregel-a-system-for-l
Type bag for ConditionalEdgeRouter that accepts schema types. Unlike GraphNodeTypes, conditional edges don't have separate input/output - they just read state and return routing decisions.
Options accepted by createGraphRunStream.
A channel that switches between two states
Stores the value received in the step immediately preceding, clears after.
Read-only execution info/metadata for the execution of current thread/run/node.
Operation to retrieve an item by namespace and ID.
The root graph paused. Static interrupts can have an empty payload list.
Type bag for GraphNode that accepts schema types. All fields are optional - unspecified fields use defaults.
This enables separate input/output schemas for nodes, which is useful when a node receives
A graph execution resumed from a checkpoint.
Human-in-the-loop interrupt: stable id plus opaque payload for resume UIs.
Represents a stored item with metadata.
Single lifecycle entry surfaced by the in-process
GraphRunStream.lifecycle projection. Combines the CDDL
LifecycleData payload with the namespace it applies to so
consumers can filter or correlate w
Projection returned from the lifecycle transformer's init().
The local StreamChannel is closed automatically when the transformer
finalizes or fails. _lifecycleLog is intentionally underscore-p
Configuration knobs for createLifecycleTransformer.
Operation to list and filter namespaces in the store.
A channel that waits until all named values are received before making the value available.
This ensures that if node N and node M both write to channel C, the value of C will not be updated until N
Marker interface for transformers provided by internal LangChain products (e.g. ReactAgent's ToolCallTransformer, DeepAgent's SubagentTransformer).
Native transformers differ from user-defined extens
An object representing a direct overwrite of a value for a channel. Used to signal that the channel value should be replaced with the given value, bypassing any reducer or binary operator logic.
Configuration options for executing a Pregel graph. These options control how the graph executes, what data is streamed, and how interrupts are handled.
Single envelope for a streaming protocol emission: sequence, channel
(method), and payload (params).
Operation to store, update, or delete an item.
Operation to search for items within a namespace prefix.
Metadata injected by LangGraph Server. Undefined when running open-source LangGraph without LangSmith deployments.
Narrow capability handle passed to StreamTransformer.onRegister. Exposes only the minimal mux surface required for synthetic event emission — intentionally does not expose close/fail/register/etc. to
Observes ProtocolEvents during a graph run and builds typed derived projections (secondary event logs, promises, etc.).
Data is surfaced to consumers through projections returned from
init().
Projection returned by createSubgraphDiscoveryTransformer.
Configuration for createSubgraphDiscoveryTransformer.
Options for the task function
Stable handle for one tool call: name, arguments, and async results.
Emitted when content-block-finish delivers a finalized tool_call block.
A configurable PubSub Topic.
Initialization options for UntrackedValue.
A batch reducer for use with DeltaChannel.
Receives the current accumulated value and a batch of writes in one call, returning the new accumulated value: `reducer(state, [write1, write2, ...]) -> new
Configuration for caching nodes.
Additional details about the checkpoint, including the source, step, writes, and parents.
Convenience type for referencing a compiled graph by named type slots.
Type for conditional edge routing functions.
Use this to type functions passed to addConditionalEdges for
full type safety on state, runtime context, and return values.
Supports two patterns:
A batch reducer for use with DeltaChannel.
Receives the current accumulated value and a batch of writes in one call, returning the new accumulated value: `reducer(state, [write1, write2, ...]) -> new
Initialization options for DeltaValue.
Two forms are supported:
snapshotFrequency /
jsonSchemaExtra) — the reducer's inputs are validated using the vaOptions for the entrypoint function
Extract the State type from any supported schema type.
Supports:
Extract the Update type from any supported schema type.
The Update type represents what a node can return to update the state. All fields are optional since nodes only need to return the fields they
Options for getting the state of the graph.
Loop status at a graph lifecycle transition.
Strongly-typed utility for authoring graph nodes outside of the StateGraph builder, supporting inference for both state (from Schema) and config context (from Context type).
This type enables you to
Return value type for GraphNode functions. Nodes can return an update object, a Command, or a Promise of either.
Infers the merged extensions type from a tuple of transformer factory functions.
Given [() => StreamTransformer<{ a: number }>, () => StreamTransformer<{ b: string }>],
produces `{ a: number } & {
Infer the Update type from a StateSchemaFields. This is the type for partial updates to state.
Infer the State type from a StateSchemaFields. This is the type of the full state object.
Type that represents an acceptable input for the messages state reducer.
BaseMessage or BaseMessageLike.BaseMessage or BaseMessageLike.Options for subscribing to multiple channels.
Hierarchical path identifying a position in the agent tree.
Each element is one segment; longer arrays mean deeper nesting (e.g. subgraph or multi-agent scopes).
Retry and cache policies configurable on graph nodes.
Use with StateGraph.addNode for per-node overrides, or with
StateGraph.setNodeDefaults for graph-wide defaults applied at
compile() time. Per-n
Initialization options for ReducedValue.
Two forms are supported:
jsonSchemaExtra)—in this case, the reducer's inputs are validated using the output valueKeyword options for Send.
Options for subscribing to a single channel.
Options for StateGraph.addNode() method.
Initialization options for StateGraph. Accepts any combination of schema types for state/input/output.
Supports both state and stateSchema as aliases for backward compatibility.
If only input i
Valid field types for StateSchema. Either a LangGraph state value type or a raw schema (e.g., Zod schema).
Init object for StateSchema constructor.
Uses any to allow variance in generic types (e.g., ReducedValue<string, string[]>).
Converts StateSchema fields into a strongly-typed State Definition object, where each field is mapped to its channel type.
This utility type is used internally to create the shape of the state channe
Maps a single StateSchema field definition to its corresponding Channel type.
This utility type inspects the type of the field and returns an appropriate
BaseChannel type, parameterized with the st
Selects the type of output you'll receive when streaming from the graph. See Streaming for more details.
Configuration for timing out node attempts.
A timeout applies to a single attempt of a node/task. When a node has a RetryPolicy, the timer resets for each retry attempt.
Timeouts are expressed in **
High-level outcome of a single tool call for UI or aggregators.
The response provided by a human to an interrupt, which is returned when graph execution resumes.
Channels that can appear on a protocol event. Beyond the raw
StreamMode channels emitted by the Pregel stream, the v2
protocol layer synthesizes additional channels (e.g. lifecycle,
input) via bu
Hierarchical path identifying a position in the agent tree.
Each element is one segment; longer arrays mean deeper nesting (e.g. subgraph or multi-agent scopes).
Configuration for caching nodes.
Additional details about the checkpoint, including the source, step, writes, and parents.
Convenience type for referencing a compiled graph by named type slots.
Type for conditional edge routing functions.
Use this to type functions passed to addConditionalEdges for
full type safety on state, runtime context, and return values.
Supports two patterns:
A batch reducer for use with DeltaChannel.
Receives the current accumulated value and a batch of writes in one call, returning the new accumulated value: `reducer(state, [write1, write2, ...]) -> new
Initialization options for DeltaValue.
Two forms are supported:
snapshotFrequency /
jsonSchemaExtra) — the reducer's inputs are validated using the vaOptions for the entrypoint function
Extract the State type from any supported schema type.
Supports:
Extract the Update type from any supported schema type.
The Update type represents what a node can return to update the state. All fields are optional since nodes only need to return the fields they
Options for getting the state of the graph.
Loop status at a graph lifecycle transition.
Strongly-typed utility for authoring graph nodes outside of the StateGraph builder, supporting inference for both state (from Schema) and config context (from Context type).
This type enables you to
Return value type for GraphNode functions. Nodes can return an update object, a Command, or a Promise of either.
Infers the merged extensions type from a tuple of transformer factory functions.
Given [() => StreamTransformer<{ a: number }>, () => StreamTransformer<{ b: string }>],
produces `{ a: number } & {
Infer the Update type from a StateSchemaFields. This is the type for partial updates to state.
Infer the State type from a StateSchemaFields. This is the type of the full state object.
Type that represents an acceptable input for the messages state reducer.
BaseMessage or BaseMessageLike.BaseMessage or BaseMessageLike.Options for subscribing to multiple channels.
Hierarchical path identifying a position in the agent tree.
Each element is one segment; longer arrays mean deeper nesting (e.g. subgraph or multi-agent scopes).
Retry and cache policies configurable on graph nodes.
Use with StateGraph.addNode for per-node overrides, or with
StateGraph.setNodeDefaults for graph-wide defaults applied at
compile() time. Per-n
Initialization options for ReducedValue.
Two forms are supported:
jsonSchemaExtra)—in this case, the reducer's inputs are validated using the output valueKeyword options for Send.
Options for subscribing to a single channel.
Options for StateGraph.addNode() method.
Initialization options for StateGraph. Accepts any combination of schema types for state/input/output.
Supports both state and stateSchema as aliases for backward compatibility.
If only input i
Valid field types for StateSchema. Either a LangGraph state value type or a raw schema (e.g., Zod schema).
Init object for StateSchema constructor.
Uses any to allow variance in generic types (e.g., ReducedValue<string, string[]>).
Converts StateSchema fields into a strongly-typed State Definition object, where each field is mapped to its channel type.
This utility type is used internally to create the shape of the state channe
Maps a single StateSchema field definition to its corresponding Channel type.
This utility type inspects the type of the field and returns an appropriate
BaseChannel type, parameterized with the st
Selects the type of output you'll receive when streaming from the graph. See Streaming for more details.
Configuration for timing out node attempts.
A timeout applies to a single attempt of a node/task. When a node has a RetryPolicy, the timer resets for each retry attempt.
Timeouts are expressed in **
High-level outcome of a single tool call for UI or aggregators.