Skip to content

Glossary & resources

源码版本1.2.9

Core terminology

TermEnglishNotes
State graphStateGraphUser-facing construction entry point. add_node / add_edge / add_conditional_edges / compile. libs/langgraph/langgraph/graph/state.py
Compiled graphCompiledGraph / PregelThe product of StateGraph.compile(). Implements PregelProtocol and carries the stream / invoke / astream entry points. libs/langgraph/langgraph/pregel/main.py
Pregel executablePregelThe compiled executable graph. Inherits PregelProtocol and holds nodes / channels / checkpointer. libs/langgraph/langgraph/pregel/main.py
SuperstepsuperstepThe unit of execution in the Pregel model. Within one superstep, all triggered nodes run concurrently; channel updates are synchronized at the step boundary. Borrowed from the BSP model in Google's Pregel paper.
ChannelchannelThe state-update primitive. Each channel has a version number, and a reducer decides how writes are merged. libs/langgraph/langgraph/channels/
Channel baseBaseChannelAbstract base class for all channels. Defines update / get / checkpoint and related interfaces. libs/langgraph/langgraph/channels/base.py
LastValue channelLastValueA channel that keeps only the latest value, commonly used for state fields. LastValueAfterFinish defers the update until the step finishes. libs/langgraph/langgraph/channels/last_value.py
ReducerreducerA function that merges writes into a channel — e.g. operator.add for list append. Declared in the state schema via Annotated[T, reducer].
Nodenode / PregelNodeThe execution unit of a graph. Holds bound / triggers / writers / subgraphs. libs/langgraph/langgraph/pregel/_read.py
add_nodeadd_nodeStateGraph.add_node(name, action) registers a node function or Runnable, internally going through coerce_to_runnable. libs/langgraph/langgraph/graph/state.py
Conditional edgeadd_conditional_edgesRoutes to the next node based on the return value of a condition function. Returning a list of Send implements fan-out. libs/langgraph/langgraph/graph/state.py
CheckpointcheckpointA thread-level persistence snapshot that records channel versions, pending writes, and metadata, enabling resume from a breakpoint. libs/langgraph/langgraph/pregel/_checkpoint.py
Checkpoint saverBaseCheckpointSaverThe checkpoint persistence interface: put / get_tuple / list. libs/checkpoint/langgraph/checkpoint/base/__init__.py
In-memory saverInMemorySaver / MemorySaverThe in-memory implementation of BaseCheckpointSaver, intended for debugging only. MemorySaver is a legacy alias for InMemorySaver. libs/checkpoint/langgraph/checkpoint/memory/__init__.py
State snapshotStateSnapshotThe state view at the start of a step. Includes values / next / tasks / interrupts. libs/langgraph/langgraph/types.py
Interruptinterrupt / InterruptCalling interrupt(value) inside a node raises GraphInterrupt and pauses graph execution. The client resumes it with Command(resume=...). libs/langgraph/langgraph/types.py
CommandCommandA three-in-one primitive for resume / goto / update. Can be used either as a node return value or as input to invoke. libs/langgraph/langgraph/types.py
SendSendThe PUSH task primitive: delivers a task with a specific arg to a target node, enabling map-reduce fan-out. libs/langgraph/langgraph/types.py
Functional API@entrypoint / @taskThe functional API. @entrypoint wraps a function into a Pregel, and @task wraps a function into a schedulable subtask. libs/langgraph/langgraph/func/__init__.py
Stream modestream_modeOutput projection option for Pregel.stream / astream: values / updates / messages / custom / checkpoints / tasks / debug. libs/langgraph/langgraph/pregel/main.py

Directory conventions

  • The main source lives in libs/langgraph/langgraph/, split by responsibility:
    • pregel/ — execution engine core. main.py is the Pregel class entry point; __init__.py exports the public interface; _loop.py is the PregelLoop state machine; _runner.py is the PregelRunner concurrent executor; _algo.py holds apply_writes / prepare_next_tasks / should_interrupt and other algorithm functions; _io.py is map_command / map_input / map_output_*; _call.py is SyncAsyncFuture and the Runnable wrapper for tasks; _read.py is PregelNode; _executor.py is BackgroundExecutor / AsyncBackgroundExecutor; remote.py is RemoteGraph.
    • graph/StateGraph / CompiledStateGraph user interface. state.py is the core; _node.py / _branch.py are helpers.
    • channels/ — channel implementations: BaseChannel / LastValue / Topic / Binop and others.
    • func/ — the @entrypoint / @task functional API (all of it actually lives in a single file, func/__init__.py).
    • types.py — public data types: Command / Send / Interrupt / StateSnapshot / PregelExecutableTask and others.
    • stream/ — streaming mux implementation: GraphRunStream / StreamMux and friends.
    • managed/ — runtime-injected values such as IsLastStep.
  • Checkpoint implementations are split into standalone packages: libs/checkpoint/ (base + memory), libs/checkpoint-sqlite/, libs/checkpoint-postgres/.
  • The Pregel engine entry point is libs/langgraph/langgraph/pregel/__init__.py; the main Pregel class lives in pregel/main.py.

Official resources

Source version

The source on this site is pinned to 1.2.9; line numbers refer to that tag. All <SrcLink> URLs point to github.com/langchain-ai/langgraph/blob/1.2.9/<path>#Lxx-Lyy. To bump the version, update LANGGRAPH_TAG in docs/.vitepress/site.ts and run npm run check:refs.