Workflows vs agents (the distinction that matters)
Anthropic's framing is the one to know: it's a spectrum built on the augmented LLM (a model with tools, retrieval, and memory).
- Workflows — LLM calls orchestrated through predefined code paths. You decide the steps; the model fills them in. Predictable, testable, cheaper.
- Agents — the LLM dynamically directs its own process, deciding which tools to use and when, in a loop, until it judges the task done. Flexible, but less predictable and more expensive.
The most important lesson: don't reach for an agent first
The strongest guidance in the field is "find the simplest solution possible, and only increase complexity when needed." Agents trade latency, cost, and reliability for autonomy — often a single well-designed LLM call, or a fixed workflow, outperforms an agent and is far easier to debug. Add agency only when the task genuinely requires open-ended decisions the you-can't-hardcode-the-path.
When an agent is the right tool
- The problem is open-ended — you can't predict the number or sequence of steps.
- It needs iteration — act, observe the result, adjust (multi-hop research, debugging, "keep trying tools until it works").
- The value of flexibility outweighs the cost/latency and the risk of the model going off the rails.
Otherwise: use a workflow. And whatever you build, keep it as simple as the task allows — measure whether the agent actually beats a simpler baseline before shipping it.
The building blocks
Every agent is: an LLM (the reasoner) + tools (how it acts on the world — Chapter 1 of Foundations) + a loop (act → observe → decide) + memory/state + stopping criteria. Master those and the frameworks are just glue.