Best Practices for Building AI Agents

Chapter 1 · Practice 1 of 4

Start with the simplest design and add autonomy only when it pays off

From Choosing between a workflow and an agent

Why it matters

Anthropic's article on building effective agents draws a clear line:

DesignHow it worksBest for
WorkflowModel calls and tools orchestrated through predefined code pathsWell-defined tasks with known steps
AgentThe model directs its own process and tool useOpen-ended problems where steps cannot be predicted

The article's advice is to start with the simplest solution and add complexity only when needed. Agents often trade latency and cost for better task performance, and a single model call with retrieval and good examples is often enough.

Before you build an agent, write down:

  1. the steps a person would take to do the task;
  2. which of those steps are always the same;
  3. which steps genuinely need a decision that depends on earlier results.

If the answer to the third question is "none", build a workflow.

Avoid

  • Building an autonomous agent for a task that always follows the same steps