Not a new model

The loop is the agent.

LangGraph is a runtime for work a chain can't do: retry, branch, wait for a human, fan out, remember.

STARTagenttoolsEND
START → agent ⇄ tools → END. The loop is the agent.

The problem

A chain is a list. Real work is not.

A list can only go forward. Support tickets retry. Research re-queries. Refunds wait for a human. Fan-out writes three jokes and joins them. The moment you need a cycle, a branch, or a pause, the list dies — and you start drawing a graph whether you meant to or not.

The model

Four beats, then you compile.

That is the whole API surface you actually have to hold in your head.

01

State

A shared snapshot. Nodes return partials. Per-key reducers merge them. Default is overwrite.

02

Nodes

Functions. They read state and write an update — or a Command. They do not call the next step.

03

Edges

Static, conditional, or dynamic (Send / Command). Edges decide next. Don’t mix mechanisms on one node.

04

Compile

Validates the graph and binds a checkpointer. You invoke the compiled graph, not the builder.

Two doors

Pick a track.