LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
LangGraph SDK
  • Client
  • Auth
  • React
  • Logging
  • React Ui
  • Server
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
  • Store
LangGraph Checkpoint Redis
  • Shallow
  • Store
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
  • Cli
LangGraph API
LangGraph CLI
LangGraph CUA
  • Utils
LangGraph Supervisor
LangGraph Swarm
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangGraph
WebChannelsPregelPrebuiltRemote
LangGraph SDK
ClientAuthReactLoggingReact UiServer
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
Store
LangGraph Checkpoint Redis
ShallowStore
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
Cli
LangGraph API
LangGraph CLI
LangGraph CUA
Utils
LangGraph Supervisor
LangGraph Swarm
Language
Theme
JavaScript@langchain/langgraphpregel
Moduleā—Since v0.3

pregel

Copy
import { ... } from "@langchain/langgraph/pregel";

Classes

class
Channel
class
Pregel

Interfaces

interface
PregelOptions

Type Aliases

View source on GitHub
typeAlias
PregelInputType: any
typeAlias
PregelOutputType: any

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 Pregel graph. They enable message passing and state updates between different parts of the graph.

The Pregel class is the core runtime engine of LangGraph, implementing a message-passing graph computation model inspired by Google's Pregel system. It provides the foundation for building reliable, controllable agent workflows that can evolve state over time.

Key features:

  • Message passing between nodes in discrete "supersteps"
  • Built-in persistence layer through checkpointers
  • First-class streaming support for values, updates, and events
  • Human-in-the-loop capabilities via interrupts
  • Support for parallel node execution within supersteps

The Pregel class is not intended to be instantiated directly by consumers. Instead, use the following higher-level APIs:

  • StateGraph: The main graph class for building agent workflows
    • Compiling a StateGraph will return a CompiledGraph instance, which extends Pregel
  • Functional API: A declarative approach using tasks and entrypoints
    • A Pregel instance is returned by the entrypoint function

Configuration options for executing a Pregel graph. These options control how the graph executes, what data is streamed, and how interrupts are handled.