Agent graph (state graph)
Modeling an agent as explicit nodes, edges and shared state, with checkpoints, so each step can be paused, resumed, inspected and tested.
An agent graph models an AI agent as explicit nodes, edges and shared state, with checkpoints. Each node is a step (classify, retrieve, draft, ask a human), edges say what may come next, and each step can be paused, resumed, inspected and tested.
Instead of one open loop where the model decides everything, the graph fixes the allowed paths and lets the model choose only among them. LangGraph popularized the style, and other agent frameworks offer similar graphs. The state is saved after each node, which gives durable execution, approval steps and replay of a failed run from the last good point. The price is design work: every path has to be drawn, and an unexpected case has nowhere to go until you add an edge for it.
It sits at the opposite end from a Ralph loop: more control and auditability, more design work up front. Most workflow patterns, such as prompt chaining or a supervisor with workers, can be drawn as graphs. That is why graphs suit processes where a regulator or customer asks who approved what.
Related terms
- Durable execution: Running a long process so its progress is saved after every step, letting it survive crashes and pause for hours or days, then resume.
- Agent framework (LangChain, LangGraph and others): A library for building AI agents and LLM workflows: model calls, tools, state, retries and tracing, so you do not write the loop yourself.
- Human in the loop: A person approves, edits or rejects the agent’s action before it takes effect.
- Ralph loop (Ralph Wiggum technique): Running the same prompt against a coding agent again and again, each time with a fresh context, while progress lives in files and tests decide when it is done.
- Agentic workflow (workflow vs agent): A process where your code fixes the steps and a model does some of them, as opposed to an agent that decides its own steps.
- Prompt chaining: A fixed sequence of model calls where each step works on the previous step’s output, with checks in code between the steps.
