Agent graph
A way of building an AI agent by drawing its work as a graph: boxes for steps and arrows for what happens next. Each step can ask the AI something or run normal software. Arrows can branch on a condition or loop back, and all steps share one running record of where things stand. LangGraph made the approach common.
In plain English
A flowchart the AI follows. “Read the email. Is it a complaint? Yes: draft an apology and route to a human. No: file it.” Each box is a step, each arrow is a decision, and the whole thing can circle back when a step needs another try.1 Not a graph with axes. The boxes-and-arrows kind.
In the real world
- The canvas in automation tools such as Zapier or Make, where you drag boxes and connect them.
- A developer’s diagram of how a support bot decides when to escalate.
- The reason an agent asks for approval at the same point every time: there’s a box there.
When to use it
- The task has decision points you want to control, not improvise.
- You need a human-approval step in a fixed place.
- You want to see why the agent took the path it took.
When not to use it
- One step with one tool. That’s a prompt, not a graph.
- The task is genuinely open-ended and the model should decide its own route. A graph constrains, which is the point and the cost.
Good, bad, ugly
- Good: predictable. The same input takes the same path.
- Bad: every branch is one you had to think of in advance.
- Ugly: a forty-box graph nobody can read, rebuilt from scratch when the process changes.
Key facts
- Three parts
- Shared notes everyone reads (the state), the steps (boxes), and the arrows between them
- Rule of thumb
- Nodes do the work. Edges decide what runs next.
- Why draw it
- You can see and control the flow instead of trusting the model to improvise it
Common questions
Isn't an agent just a loop?
The simplest agent is one loop: think, act, check, repeat. A graph lets you draw several paths, add approval steps, and send work down different branches, while still allowing loops.
Do I need to code to use this?
To build one, yes. To benefit, no. Many no-code automation tools are agent graphs with a drag-and-drop skin. If you have drawn a flowchart, you understand the idea.
What is LangGraph?
A popular open-source framework from LangChain for building agents this way. Its documentation describes agent workflows as a graph of state, nodes, and edges.
References
- Graph APILangChain, LangGraph documentationView source
- LangChainWikipediaView source