From Chains to Graphs

Models, tools, and messages tell us what can run. A reliable agent also needs to decide what runs next.

The missing piece: control flow

The Paris agent must answer four questions:

Control question Paris example
In what order? Retrieve policy first, or search fares first?
Which steps repeat? Search again after a compliance failure—but how many times?
Where does it pause? Before book_flight spends ₹34,900.
Where does it resume? When approval arrives four hours later in another process.
flowchart LR L[LangChain components
models · tools · messages] --> G[LangGraph control flow
order · loops · branches · pauses] --> A[Reliable agent]

LangGraph is the control-flow layer. It makes the route visible as nodes and arrows instead of hiding the whole loop inside one agent call.

How chains grew into graphs

Time Change
October 2022 LangChain arrived before ChatGPT, focused on model I/O and chains such as retrieve-then-generate.
December 2022 A general-purpose agent added the ReAct pattern.
February 2024 LangGraph introduced explicit, inspectable, persistent control flow.
October 2025 LangChain 1.0 and LangGraph 1.0 shipped together; agents were consolidated onto LangGraph.
2026 LangGraph 1.1–1.2 added typed streaming, node timeouts, and error handlers; LangChain 1.4 built in MCP support.

These version details describe the deck's timeline. APIs continue to change, so production code should always check the installed version's official documentation.

Two levels of control

LangChain agents: high-level API

from langchain.agents import create_agent

agent = create_agent(
    model=model,
    tools=[search_flights, search_hotels],
    system_prompt="Plan a policy-compliant trip. Never book.",
)

LangGraph: low-level orchestration

flowchart TB LC[LangChain create_agent
high-level API] LG[LangGraph runtime
state · nodes · edges · checkpoints] LC --> LG

create_agent is not a competing runtime. Underneath, it is a LangGraph graph.

Which level should you choose?

Need Good starting point
A standard model-and-tools agent LangChain create_agent
Exact routes, pause points, or state rules LangGraph
Fast prototype with standard middleware LangChain agent
A custom multi-agent or recovery flow LangGraph

Start high-level when its defaults match the task. Move lower only when you need control that the simple API does not expose clearly.

What goes wrong

One-line summary

Chains move data forward; graphs make loops, branches, pauses, and resumable control flow explicit.

Key terms