Agentic Design Patterns
- Name and describe Andrew Ng's four agentic design patterns
- Explain the orchestrator-workers pattern and when to use it
- Identify which pattern is appropriate for a given agent task
Patterns Are Shortcuts to Reliability
Building an agent from scratch for every problem is slow and error-prone. Design patterns capture what works — proven architectural solutions that can be applied to a new problem without reinventing the approach.
Andrew Ng's 2024 framework named four foundational patterns. Anthropic's agent workflow patterns extended these for production. Together, they cover most of what you'll build.
Pattern 1: Reflection
An agent generates output, then evaluates that output against criteria, and revises if needed. The cycle repeats until the output meets the standard or a maximum iteration count is reached.
Variants include self-reflection (the same model critiques its own work) and critic-agent reflection (a separate model or agent provides the critique). Using a different model for the critic tends to catch different classes of errors — the generator and critic have different biases.
When to use: quality-critical outputs — code review, document drafting, structured data extraction where accuracy matters
Watch out for: token cost compounds with iteration; cap the number of reflection cycles
Pattern 2: Tool Use
The agent has access to a set of tools and decides which to call, in what order, based on its reasoning. This is the most widely deployed pattern in production — it's the basis for every coding assistant, research agent, and automation tool.
When to use: any task requiring real-world data or actions — search, computation, writing to systems
Watch out for: tool permission creep; agents with broad tool access can take actions the developer didn't intend; always define the minimum set of tools needed
Pattern 3: Planning
The agent produces an explicit plan before executing it. This separates the high-level strategic reasoning from the low-level execution, which makes both steps easier to evaluate and debug. Plan-and-execute architectures are common in research agents and project management applications.
When to use: complex multi-step tasks where the sequence matters; tasks where a human might want to approve the plan before execution begins
Watch out for: plans become stale when the environment changes mid-execution; agents need a re-planning trigger
Pattern 4: Multi-Agent Collaboration
A task is divided among specialized agents, each with its own role, tools, and context. A coordinator agent manages the workflow and synthesizes results. This is covered in depth in the next lesson; the key design principle here is that specialization reduces context pollution — each agent only carries what it needs.
Anthropic's Orchestrator-Workers Pattern
Anthropic's workflow documentation describes an orchestrator-workers pattern that extends multi-agent collaboration for production use: a central LLM breaks down an open-ended task into subtasks, delegates them to worker agents with specific tools, and synthesizes their results. Unlike parallelization (where subtasks are predefined by the developer), the orchestrator determines the breakdown dynamically.
This pattern is well-suited to research and analysis tasks: an orchestrator agent might decide to send one worker to gather data, another to run calculations, and a third to draft the narrative — all in parallel, then merge the results.
Combining Patterns
Real agents typically combine multiple patterns. A research agent might use planning (to structure the investigation), tool use (to gather data), reflection (to evaluate source quality), and multi-agent collaboration (specialist agents for different domains). The patterns are not exclusive — they're building blocks.
- The four foundational agentic patterns are: Reflection, Tool Use, Planning, and Multi-Agent Collaboration
- Reflection is effective for quality but expensive — using a separate critic model catches different errors than self-reflection
- Tool use is the most widely deployed pattern; tool permission creep is its main production risk
- The orchestrator-workers pattern dynamically decomposes open-ended tasks — different from parallelization, where the developer defines the split
Progress is saved in this browser only — clear your cache or switch device and it's gone. Create a free account and it follows you everywhere.