What Are AI Design Patterns for Agentic Systems and How They Map to Software Architecture

Updated

AI design patterns are reusable solutions for structuring how LLM calls and agent steps are organized — not prompt-writing tips, but decisions about sequencing, routing, parallelism, memory, and failure handling. The most widely referenced set is Antonio Gullí's 21 Agentic Design Patterns, and the useful thing about them is that nearly every one has a direct analog in software architecture you already know. That mapping is what makes them learnable: Prompt Chaining is Pipe & Filter, Routing is a Load Balancer, Parallelization is MapReduce. Below is the full pattern list with its architectural counterpart, plus how to pick between them.

The 21 agentic patterns and their architecture analogs

The curriculum at learnagenticpatterns.com presents each pattern as a named solution with pseudocode, software-engineering mappings, and production notes. The table below reflects the patterns and mappings shown on that site.

# Agentic pattern Software architecture analog What it does
01 Prompt Chaining Pipe & Filter Decomposes a complex task into a linear sequence of smaller LLM calls; each output becomes the next step's input
02 Routing Load Balancer / API Gateway Classifies the input's semantic intent and delegates to the specialized agent, model, or path best suited to it
03 Parallelization Scatter-Gather / MapReduce Runs independent tasks at once (voting, multiple drafts, fact-checking across sources) and aggregates the results
04 Reflection Unit Testing / TDD Loop Has the agent critique and revise its own output before it's accepted
05 Tool Use Adapter / Proxy Wraps external functions and APIs so the model can call them
06 Planning Workflow Orchestration / Saga Breaks a goal into ordered steps and manages execution across them
07 Multi-Agent Collaboration Microservices Architecture Splits work across specialized agents that coordinate
08 Memory Management Database / Caching / Session State Persists and retrieves context across interactions
09 Learning & Adaptation CI/CD / A-B Testing Improves behavior over time from feedback and outcomes
10 State Management (MCP) IDL / REST Standards / USB-C Standardizes how agent state and capabilities are exposed and connected
11 Goal Setting & Monitoring Health Checks / APM Defines success criteria and tracks whether the agent is meeting them
12 Exception Handling & Recovery Try-Catch / Circuit Breaker Detects failures and recovers or degrades gracefully
13 Human-in-the-Loop Manual Approval Gates Inserts a person at defined decision points
14 Knowledge Retrieval (RAG) Database Query / Search Index Fetches relevant external knowledge to ground responses
15 Inter-Agent Communication (A2A) Message passing between services Defines how agents exchange information

The site lists 21 developer patterns in total; the excerpt above shows the first 15 in order, with the remaining patterns continuing the same "pattern → architecture analog" format.

Why the architecture mapping matters

If you already design backend systems, you don't need a new mental model — you need to recognize which familiar structure each agentic pattern is. Three consequences follow:

  • You can reason about tradeoffs with existing vocabulary. Routing is a load balancer, so you already know its costs: a classifier adds latency and can misroute. Parallelization is MapReduce, so you know the aggregation step is where correctness is won or lost.
  • Reliability patterns transfer directly. Exception Handling & Recovery maps to Try-Catch and Circuit Breaker, which means the same questions apply — what's the fallback, when do you stop retrying, what state do you need to resume?
  • The patterns compose. A real agent is rarely one pattern. A typical build is Routing → Tool Use → Knowledge Retrieval (RAG) → Reflection, with Exception Handling wrapped around the whole thing.

How to choose a pattern

Selection depends on three properties of the task, not on which pattern sounds most advanced.

Task complexity — If the task decomposes cleanly into ordered steps, start with Prompt Chaining (01). If it branches by intent, add Routing (02). Only reach for Planning (06) or Multi-Agent Collaboration (07) when the step order genuinely can't be fixed in advance, since both add coordination overhead.

Latency budget — Parallelization (03) cuts wall-clock time when subtasks are independent, but costs more tokens and needs an aggregation step. Sequential chaining is simpler and cheaper per call but slower end to end.

Reliability requirement — Any pattern that calls tools or external systems needs Exception Handling & Recovery (12). Any pattern that makes consequential decisions needs Human-in-the-Loop (13). If output quality matters more than speed, Reflection (04) is the cheapest quality lever because it adds a critique pass rather than a second model.

A practical default for a first agent: Prompt Chaining + Tool Use + Knowledge Retrieval, with Exception Handling around each external call. Add Routing and Reflection once you can measure where it fails.

Where to practice these hands-on

The site frames its exercises as "like LeetCode, but for AI agents" — interactive games rather than reading. Two things are worth knowing before you start:

  • Two tracks, 36 lessons. One developer track covering the 21 patterns, one product-manager track with 15 modules.
  • Access is tiered. Seven patterns and the first PM module are open without an account; a free account unlocks the rest. Pattern 01 is the stated starting point and needs no account.

There's also a 3-minute "Will AI Replace Me?" assessment that returns a personalized action plan and requires no sign-up. If you want a single concrete entry point, start with pattern 01 (Prompt Chaining), since every other pattern assumes you can already decompose a task into discrete LLM calls.