Best Practices for Building AI Agents

Chapter 1 · Practice 2 of 4

Know the standard workflow patterns before reaching for full autonomy

From Choosing between a workflow and an agent

Why it matters

The same article names five workflow patterns that cover many problems without a free-running agent:

PatternWhat it does
Prompt chainingSequential calls, with code checks between steps
RoutingClassify the input and send it to a specialised prompt or a smaller model
ParallelizationRun subtasks at the same time, or the same task several times and vote
Orchestrator-workersA central model splits the task into subtasks it decides on the fly, then combines results
Evaluator-optimizerOne model drafts, another critiques against clear criteria, in a loop

Many production "agents" are really one of these with a tool or two. That is a good thing: each pattern is easier to test, cheaper to run and simpler to debug than an open loop.