Agent patterns

Most agents you'll build are variations on a handful of patterns. Knowing which one fits your task saves weeks of "why isn't this working?"

The five patterns

Quick decision matrix

If the task is… Use
Short, exploratory, needs adaptationReAct
Long, well-defined, many stepsPlan-execute
Has independent parallel subtasksMulti-agent
Any agent going to productionPlus evaluation
Stable system prompt, many callsPlus prompt caching