What is LangGraph?

LangGraph is a low-level orchestration framework and runtime for building long-running, stateful workflows and agents from deterministic code, model calls, tools, and human input.

Quick Facts

Full NameLangGraph Agent Orchestration Runtime
CreatedLaunched by the LangChain team to solve the pain point of traditional Chains lacking loop capabilities
SpecificationOfficial Specification

How It Works

LangGraph provides execution primitives rather than a fixed Agent architecture. Its Graph API models work with State, Nodes, and Edges: Nodes receive a state snapshot and return partial updates, Edges select subsequent work, and a Reducer on each State Channel determines whether concurrent or sequential updates overwrite or combine. Cycles and conditional routing are supported, but a graph does not have to contain an LLM or multiple Agents.

The Functional API exposes the same runtime through entrypoints and tasks, so persistence and Interrupts do not require converting every application into an explicit graph. Compilation validates graph structure and binds runtime components; it does not by itself make execution durable. A Checkpointer stores thread-scoped state snapshots, while a Store holds application data across threads. Durable execution additionally requires a stable thread ID, a persistent Checkpointer, deterministic replay, and idempotent Side Effects. In-memory persistence is for development and disappears on process restart.

When a run resumes after failure or an Interrupt, LangGraph restarts from the relevant Node or Entrypoint rather than the exact source-code line; code before an Interrupt can execute again. External writes therefore need stable operation IDs, idempotency keys, result reconciliation, and independent authorization. Time Travel replays or forks from a Checkpoint; it does not undo emails, payments, database writes, or other real-world effects, and downstream model or Tool calls may produce different results.

Input, Output, and Private State schemas control interfaces but are not secrecy boundaries because some Streaming modes can expose internal channels. LangGraph can run without LangChain, while LangChain provides higher-level Agent abstractions and LangSmith provides separate tracing, evaluation, and deployment services. In LangGraph v1, the core Graph API is stable and the older LangGraph prebuilt create_react_agent path is deprecated in favor of LangChain create_agent.

Production evaluation should cover route and terminal-state correctness, State and Reducer invariants, retries, duplicate Side Effects, Interrupt authorization, Checkpoint recovery, latency, cost, and full trajectory evidence.

Key Characteristics

  • Provides a low-level orchestration Runtime rather than prescribing one Agent, Prompt, Tool, or Multi-Agent architecture
  • Supports both a declarative Graph API and a Functional API on the same persistence, streaming, and Interrupt runtime
  • Applies Node-returned partial updates through per-channel Reducers instead of allowing an undefined globally mutable State
  • Separates thread-scoped Checkpoints from cross-thread Store data and requires a persistent backend for restart recovery
  • Resumes through deterministic replay, so non-deterministic work and external Side Effects require Tasks, idempotency, and reconciliation
  • Combines deterministic and model-driven steps but leaves authorization, tenant isolation, evaluation, and deployment controls to the application stack

Common Use Cases

  1. Building long-running workflows with conditional branches, cycles, retries, and explicit terminal states
  2. Pausing a run for externally authorized review and resuming it with a validated Interrupt payload
  3. Persisting thread state for failure recovery while storing user or application memory across threads separately
  4. Composing subgraphs or specialist Agents behind typed input, output, State, and permission boundaries
  5. Replaying or forking recorded trajectories for debugging and evaluation without treating replay as real-world rollback

Example

loading...
Loading code...

Frequently Asked Questions

What is the difference between LangGraph and LangChain?

LangGraph is the low-level orchestration runtime for custom stateful workflows, persistence, streaming, and human Interrupts. LangChain provides higher-level model and Tool integrations plus prebuilt Agent loops, and its create_agent abstraction runs on LangGraph. You can use LangGraph without LangChain when you need direct control, or start with LangChain when a standard Agent loop is sufficient.

Does LangGraph require an LLM or a Multi-Agent system?

No. A LangGraph Node can run deterministic code, call an API, invoke a model, execute a Tool, or compose another graph. A single workflow can mix these steps, and the Functional API can use ordinary Python control flow. Use multiple Agents only when specialization provides measured value; LangGraph itself does not make a system autonomous or reliable.

What is the difference between a LangGraph Checkpointer and Store?

A Checkpointer records State snapshots for one execution thread and enables conversation continuity, Interrupts, replay, and recovery. A Store holds application-defined data across threads, such as user preferences or shared knowledge. InMemorySaver is process-local and unsuitable for restart recovery; production systems also need retention, access control, encryption, and deletion policies.

Does LangGraph checkpointing prevent duplicate Side Effects?

No. Resume and Interrupt handling can restart a Node or Entrypoint, and a task that failed after an external write may run again. Put non-deterministic work and Side Effects in explicit Tasks or Nodes, use stable operation and idempotency keys, reconcile unknown outcomes, and authorize writes outside the model. A saved State snapshot is not an exactly-once transaction.

Does LangGraph Time Travel roll back a workflow?

Time Travel replays or forks execution from a prior Checkpoint; it does not reverse real-world effects already committed. Nodes after the selected Checkpoint execute again, so model responses, API results, and Tool effects may differ. Treat historical replay as a new branch with its own run identity, permissions, budgets, traces, and Side Effect policy.

Related Terms

Related Articles