AI Engineering · interactive
Agent patterns: workflow or agent?
Most “agents” in production are workflows: model calls wired together by your code. A true agent chooses its own next step in a loop. Run six patterns from Anthropic's Building Effective Agents and compare the cost of each.
Input
product notes
LLM call 1
draft
Code check
< 120 words?
LLM call 2
translate → es
Prompt chaining: The task splits into fixed steps, and each step is easier than the whole.
Pattern
- model calls
- 2
- wall time
- ~4s
- predictable
- high
Task: Write a launch email, then translate it to Spanish.
Step 1 of 3 · read left to right
Compare all six
Start at the top. Move down only when the simpler pattern measurably fails.
| Pattern | Who decides the path | Calls | Wall time | Predictable |
|---|---|---|---|---|
| Your code | 2 | ~4s | high | |
| Your code | 2 | ~4s | high | |
| Your code | 3 | ~2s | high | |
| A model plans, code runs it | 5 | ~6s | medium | |
| Your code | 4 | ~8s | medium | |
| The model, every turn | 4 | ~8s | low |
In production
Tools and technologies
Agent frameworks are mostly ways to wire these patterns; the patterns work with a plain model API too.
Not tied to one language — use these names when you search docs or design a system.
- Building effective agentsStandard
Anthropic's write-up of these six patterns (Dec 2024).
Official site ↗ - LangGraphSoftware
Graphs of model calls with loops, branches and state.
GitHub ↗ - OpenAI Agents SDKSoftware
Agents, handoffs and guardrails.
GitHub ↗ - AutoGenSoftware
Multi-agent conversations and orchestration.
GitHub ↗ - TemporalSoftware
Durable execution for long-running agent workflows.
GitHub ↗