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().
Stores the result of applying a binary operator to the current value and each new value.
A Zod v4-compatible meta registry that extends the base registry.
A registry for storing and managing metadata associated with schemas.
Abstract base class for persistent key-value stores.
Abstract base class for persistent key-value stores.
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.
Final result from building and compiling a StateGraph.
A projection channel for StreamTransformers.
Primary run stream for a LangGraph execution.
In-memory key-value store with optional vector search.
Raised by a node to interrupt execution.
Bypass a reducer and write the wrapped value directly to a
Represents a state field whose value is computed and updated using a reducer function.
Exception raised when an error occurs in the remote graph.
A message or packet to send to a specific node in the graph.
A graph whose nodes communicate by reading and writing to a shared state.
Error thrown when invalid input is provided to a StateGraph.
StateSchema provides a unified API for defining LangGraph state schemas.
A run stream for a child subgraph within a parent graph execution.
Represents a state field whose value is transient and never checkpointed.
The Pregel class is the core runtime engine of LangGraph, implementing a message-passing graph computation model
A projection channel for StreamTransformers.
A node that runs the tools requested in the last AIMessage. It can be used
Utility class for working with channels in the Pregel system.
The Pregel class is the core runtime engine of LangGraph, implementing a message-passing graph computation model
The RemoteGraph class is a client implementation for calling remote
Abstract base class for persistent key-value stores.
Abstract base class for persistent key-value stores.
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.
One or more commands to update the graph's state and send messages to nodes.
Final result from building and compiling a StateGraph.
A projection channel for StreamTransformers.
Primary run stream for a LangGraph execution.
In-memory key-value store with optional vector search.
Raised by a node to interrupt execution.
Bypass a reducer and write the wrapped value directly to a
The Pregel class is the core runtime engine of LangGraph, implementing a message-passing graph computation model
Represents a state field whose value is computed and updated using a reducer function.
Exception raised when an error occurs in the remote graph.
A message or packet to send to a specific node in the graph.
A graph whose nodes communicate by reading and writing to a shared state.
Error thrown when invalid input is provided to a StateGraph.
StateSchema provides a unified API for defining LangGraph state schemas.
A projection channel for StreamTransformers.
A run stream for a child subgraph within a parent graph execution.
Represents a state field whose value is transient and never checkpointed.
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
Create the built-in lifecycle transformer.
Creates a StreamTransformer that groups messages channel events into
Create the subgraph discovery transformer.
Creates a StreamTransformer that captures values channel events
Define a LangGraph workflow using the entrypoint function.
Filter a lifecycle StreamChannel to only the entries whose
Filter a SubgraphDiscovery channel to only the direct children
A helper utility function that returns the LangGraphRunnableConfig that was set when the graph was initialized.
A helper utility function that returns the input for the currently executing task
Get the JSON schema from a SerializableSchema.
A helper utility function for use with the functional API that returns the previous
Detect if a schema has a default value by validating undefined.
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.
True when payload is a lightweight checkpoint envelope (not a full-state
A type guard to check if the given value is a Command.
Checks if the given graph invoke / stream chunk contains interrupt.
Type guard that tests whether a transformer is a NativeStreamTransformer.
Type guard to check if a given value is a SerializableSchema, i.e.
Type guard to check if a given value is a Standard Schema V1 object.
Reducer function for combining two sets of messages in LangGraph's state system.
Manually push a message to a message stream.
Define a LangGraph task using the task function.
Reducer function for combining two sets of messages in LangGraph's state system.
A conditional edge function that determines whether to route to a tools node or end the graph.
Reducer function for combining two sets of messages in LangGraph's state system.
Creates a GraphRunStream with built-in transformers and kicks off the
Create the built-in lifecycle transformer.
Creates a StreamTransformer that groups messages channel events into
Create the subgraph discovery transformer.
Creates a StreamTransformer that captures values channel events
Define a LangGraph workflow using the entrypoint function.
Filter a lifecycle StreamChannel to only the entries whose
Filter a SubgraphDiscovery channel to only the direct children
A helper utility function that returns the LangGraphRunnableConfig that was set when the graph was initialized.
A helper utility function that returns the input for the currently executing task
Get the JSON schema from a SerializableSchema.
A helper utility function for use with the functional API that returns the previous
Detect if a schema has a default value by validating undefined.
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.
True when payload is a lightweight checkpoint envelope (not a full-state
A type guard to check if the given value is a Command.
Checks if the given graph invoke / stream chunk contains interrupt.
Type guard that tests whether a transformer is a NativeStreamTransformer.
Type guard to check if a given value is a SerializableSchema, i.e.
Type guard to check if a given value is a Standard Schema V1 object.
Reducer function for combining two sets of messages in LangGraph's state system.
Manually push a message to a message stream.
Define a LangGraph task using the task function.
Attach formatted agent names to the messages passed to and from a language model.