Part 2: Patterns

Chapter 8: Single-Agent Patterns

These patterns describe how an individual agent approaches tasks.

Pattern 1: ReAct (Reason + Act)

The foundational pattern for agentic behaviour. The agent explicitly reasons about what to do before taking action, then observes the result and reasons again.

  1. THINK → What do I need to do? What's my plan?
  2. ACT → Execute one step (call a tool, generate output)
  3. OBSERVE → What happened? Did it work?
  4. REPEAT → Continue until done or stuck

When to use: Most agentic tasks. This is your default pattern.

Pattern 2: Tool Use

The agent has access to external tools and decides when and how to use them. Tools extend the agent beyond text generation into real-world actions.

Key design considerations:

When to use: Whenever the agent needs to retrieve information, take actions, or interact with external systems.

Pattern 3: Reflection

The agent reviews its own output before finalising, asking "Is this right? Is this complete? Could this be better?"

  1. GENERATE → Produce initial output
  2. CRITIQUE → Evaluate the output against criteria
  3. REFINE → Improve based on the critique
  4. REPEAT → Until quality threshold met

When to use: High-stakes outputs where quality matters more than speed.

Pattern 4: Planning

Before acting, the agent creates an explicit plan — breaking a complex goal into steps, identifying dependencies, and sequencing the work.

When to use: Complex, multi-step tasks where upfront planning reduces wasted effort.

Pattern 5: Fallback & Escalation

The agent recognises when it's stuck, uncertain, or out of scope — and responds appropriately rather than guessing or failing silently.

Fallback strategies:

Essential Pattern

When to use: Always. Every agent needs graceful failure handling.

☰ Contents