Part of the LangChain ecosystem

Build resilient
language agents
as graphs.

LangGraph extends the LangChain ecosystem to let you build stateful, multi-actor applications with LLMs. Model complex, cyclic workflows with precision and control.

agent.py
from langgraph.graph import StateGraph, END

graph = StateGraph(AgentState)
graph.add_node("reason", reason)
graph.add_node("act", act)
graph.add_edge("act", "reason")
graph.add_conditional_edges(
  "reason", should_continue,
  { "continue": "act", "end": END }
)
app = graph.compile()

01 — What is LangGraph

Beyond chains: agentic runtimes as graphs.

LangChain pipelines are directed acyclic graphs (DAGs) — data flows one way and stops. Real agents need to iterate: call a tool, inspect the result, reconsider, retry. LangGraph adds cycles and state, the two ingredients DAGs cannot express.

LangChain

Directed Acyclic Graph
n1n2n3n4

Each node runs once. Cannot revisit a previous step.

LangGraph

Stateful Cyclic Graph
inreasonactout

Nodes loop until a condition resolves. State persists across iterations.

StateGraph

StateGraph(AgentState)

A typed, shared state object that flows through every node. Reducers control how updates merge across steps.

Nodes

graph.add_node('act', fn)

Pure functions or LangChain runnables. Each node receives the current state and returns a partial update.

Edges

add_conditional_edges(...)

Static or conditional transitions decide where the agent goes next — enabling loops, branches, and parallel runs.

03 — Ecosystem

Part of a powerful ecosystem.

LangGraph isn't a fork — it's the orchestration layer of LangChain. Reuse every model, tool, and retriever you already have, and trace each run end-to-end in LangSmith.

LangChain

Building blocks for LLM apps — models, prompts, retrievers, tools.

LangGraph

Stateful orchestration runtime. Compose runnables into cyclic agents.

LangSmith

Tracing, debugging, and evaluation for every node and edge execution.

LangChainLangGraphLangSmith