0% completed
The Pattern Map
On This Page
How the Course Is Organized
How to Read a Lesson
What Framework-Free Means
How to Read the Numbers
The Running Agents
Every Pattern by Chapter
Chapter 1: What an Agent Is and When to Build One
Chapter 2: Workflow Patterns
Chapter 3: Tool Use Patterns
Chapter 4: Planning and Reasoning Patterns
Chapter 5: Context Engineering Patterns
Chapter 6: Human Oversight Patterns
Chapter 7: Reliability and Guardrail Patterns
Chapter 8: Security Patterns
Chapter 9: Evaluation and Observability Patterns
Chapter 10: Memory Patterns
Chapter 11: Multi Agent Patterns
Chapter 12: Cost, Latency, and Scale Patterns
Chapter 13: Interoperability and Change
Chapter 14: Full Designs and the Pattern Catalog
Appendix
This course makes three promises. It teaches every pattern in terms of a model, a loop, and code that you can write yourself. It gives each pattern's mechanism, a worked example, its costs, and when a simpler design is better. It also shows the arithmetic behind every derived number, so you can repeat it with your own inputs.
It does not teach any one framework or vendor's SDK (software development kit, the library that a vendor publishes for its API), and it contains no runnable labs. It does not teach how language models are trained. This page is the map that the rest of the course follows.
How the Course Is Organized
The course has four parts and an appendix, and each part assumes the one before it.
| Part | Chapters | What it adds |
|---|---|---|
| Part 1: One Agent That Works | 1 to 5 | The loop, fixed workflows, tools, planning, and what goes into each model call |
| Part 2: An Agent You Can Trust | 6 to 9 | Human oversight, reliability controls, security, and evaluation |
| Part 3: Agents at Scale | 10 to 13 | Memory, several agents, cost and latency, and interoperability |
| Part 4: Full Designs | 14 | Whole systems, a blank brief for you to solve, and the pattern catalog |
| Appendix | 15 | Vendor and protocol details that change quickly |
The arrows carry the questions in order: whether the agent works, whether you can trust it, and whether it still works at a larger size.
The design worksheet connects the chapters. Each case study fills in the rows its chapter has taught and leaves the others blank, and The Completed Worksheet shows all nine rows filled in before the full designs begin.
How to Read a Lesson
Most lessons have five sections:
- An opening that states the problem or the idea, and the question the lesson answers.
- A bold definition of the pattern, then the mechanism.
- One worked example, usually with a table of numbers.
- The costs, the limits, and when a simpler design is better.
- Key takeaways and four practice questions.
Reference pages such as this one omit the takeaways and the questions. Case studies and full designs apply patterns rather than introduce them.
What Framework-Free Means
Every pattern in this course is described using three things: a model that can request tool calls, a loop, and a harness. The harness is the code around the model, as defined in Anatomy of an Agent System. Anything else a pattern needs, the lesson builds from those three in pseudocode, so it still makes sense after a change of model or framework.
Frameworks and vendors appear where they are the source of a term or a reported number, and the lesson names them. What a Framework Gives You compares building with adopting.
How to Read the Numbers
Every number in the course is one of two kinds:
- Published numbers name their source in the same sentence. For example, Anthropic reports that agents typically use about 4 times the tokens of a chat interaction.
- Derived numbers start from inputs labeled "suppose", and the lesson shows the arithmetic.
If a sentence says "suppose", the result describes the stated inputs and does not predict how your system behaves. The same inputs recur so that the lessons agree, and the course quotes no model prices.
The Running Agents
Four agents recur through the course, and Desk is the main one.
| Agent | Product | Tools | Default autonomy |
|---|---|---|---|
| Desk | Customer support for an online store | 10: 6 read, 4 write | Confirm refund and close |
| Forge | Coding agent on a repository | 8: 5 read, 3 write | Act and report inside the sandbox |
| Mailbox | Email assistant with web access | 12: 8 read, 4 write | Suggest send; act on the rest |
| Scout | Research and report | 4: 3 read, 1 write | Act silently |
Forge's sandbox is an isolated environment where its commands cannot reach other systems.
Every Pattern by Chapter
To start from a symptom rather than a pattern name, use the lookup in The Pattern Catalog.
Chapter 1: What an Agent Is and When to Build One
This chapter teaches the foundations and has no patterns: the autonomy spectrum, the agent loop, the anatomy of an agent system, compounding error, workflows vs agents, and the design worksheet.
Chapter 2: Workflow Patterns
| Pattern | What it does |
|---|---|
| Prompt chaining | Runs fixed steps in sequence, with a code check between steps |
| Routing | Sorts the input and sends it to a specialist path |
| Parallelization | Runs independent parts at the same time, or runs one task several times and combines the votes |
| Evaluator optimizer | One call generates, another scores, and the loop repeats until the criteria pass or a limit stops it |
| Structured output | Passes data between steps as an object whose fields and types are fixed in advance |
| Composition | Combines the building blocks into one pipeline |
Chapter 3: Tool Use Patterns
| Pattern | What it does |
|---|---|
| Function calling | The model requests a call, your code runs it, and the result returns |
| Tool design | Treats a tool's description as an interface written for the model |
| Granularity and namespacing | Chooses how many tools to offer, and prefixes names when tools overlap |
| Progressive tool expansion and tool search | Starts with a small set, and adds tools only when the task needs them |
| Tool results and errors | Returns useful, short results, and errors that say what to try next |
| Code execution | Lets the model write and run code in a sandbox, in place of many narrow tools |
| Retrieval as a tool | Lets the agent decide when to search and refine its query across rounds |
| Read and write separation | Separates reads from writes, prefers reversible actions, and gates the rest |
The chapter ends with a case study: the tool set for Desk.
Chapter 4: Planning and Reasoning Patterns
| Pattern | What it does |
|---|---|
| Reasoning between actions | Adds a reasoning step between tool calls, either requested in text or built into the model |
| Task decomposition | Splits a goal into checkable subtasks, and keeps the list as state |
| Plan then execute | Makes the whole plan first, then runs it step by step |
| Replanning | Keeps one record of what the task needs and one of whether it is advancing, and replans when progress stops |
| Reflection | Has the agent review its own output against criteria before returning it |
| Exploration | Generates several possible paths, scores them, and continues the best |
The chapter ends with choosing a planning pattern.
Chapter 5: Context Engineering Patterns
| Pattern | What it does |
|---|---|
| The window as a budget | Treats the context window, the most text that one model call can contain, as a budget for everything the call sends |
| Calibrated instructions | Makes instructions specific enough to guide the model and general enough to leave room for judgment |
| Compaction | Summarizes history when the window fills, keeping the goal and safety rules outside the summary |
| Context resets and handoffs | Discards the window and rebuilds it from a handoff file |
| Instruction files | Loads project rules in every session, and scoped rules by location |
| Lifecycle hooks | Binds required steps to harness events, so the model need not remember them |
| Skills | Packages a procedure in a folder that loads in three tiers |
Chapter 6: Human Oversight Patterns
| Pattern | What it does |
|---|---|
| Autonomy levels per action | Assigns suggest, confirm, act and report, or act silently to each tool |
| Approval checkpoints | Passes low-risk actions and stops high-risk ones for a person |
| Approval fatigue controls | Uses batching, sampling, and thresholds so that reviewers keep reading |
| Escalation | Hands a case to a person, with enough detail that the person need not start over |
| Steering and pause resume | Lets a person redirect a running agent, or resume it hours later |
| Feedback capture | Records each human correction as a test task that must keep passing, or as a memory entry |
The chapter ends with a case study: checkpoints for Desk.
Chapter 7: Reliability and Guardrail Patterns
The chapter opens with a taxonomy of how agents fail.
| Pattern | What it does |
|---|---|
| Guardrail layering | Places checks on the input, on each tool call, and on the output |
| Outcome verification | Reads the environment rather than trusting the agent's claim |
| Grounding | Ties each claim to a retrieved source, and refuses when no source supports it |
| Least privilege | Makes tools read-only by default, and scopes credentials per tool |
| Identity and delegation | Acts with a user's scoped, expiring authority, and records the responsible person |
| Sandboxing | Limits what a wrong action can reach |
| Execution budgets | Sets a maximum on steps, time, tokens, and money |
| Circuit breakers and stop controls | Stops calling a tool after repeated failures, and lets a person stop the run |
| Durable state | Records each step, so a crashed run resumes from its last step, and keys each write so that a repeat can be detected |
| Exception handling and recovery | Uses retries, fallback tools, and reduced answers |
Chapter 8: Security Patterns
The chapter opens with prompt injection, in which an attacker's text reaches the agent and the model obeys it as an instruction, and its five surfaces, where that text enters.
| Pattern | What it does |
|---|---|
| Lethal trifecta and Rule of Two | Audits which dangerous properties one session holds together |
| Dual LLM | Uses two large language models (LLMs), and keeps untrusted text away from the one that chooses actions |
| Action selector | Lets the agent trigger tools but never act on their results |
| Plan then execute, for security | Fixes the plan before the first untrusted read |
| Context minimization | Removes the user's text from context after converting it to a query |
| Map reduce | Has isolated workers read untrusted content and return only simple values |
| Code then execute | Has a privileged model write a program, and checks a policy at every tool call |
| Probabilistic defenses | Adds an instruction hierarchy, spotlighting, and detectors as a second layer |
The chapter ends with the other agent risks and a case study: securing Mailbox.
Chapter 9: Evaluation and Observability Patterns
The chapter opens with its vocabulary.
| Pattern | What it does |
|---|---|
| The first eval set | Builds 20 to 50 tasks from real failures, as Anthropic suggests |
| Grader types | Scores with code, with a model, or with a person |
| Trajectory evaluation | Grades the path of tool calls as well as the outcome |
| Capability and regression evals | Separates what the agent can do from what must not break |
| Tracing | Records each step, tool call, and token, and samples production runs |
| Debugging from a trace | Follows a bad score to the step in the trace that caused it, and adds a test task that must keep passing |
| Eval driven development | Changes one thing, runs the suites, reads the transcripts, and compares |
The chapter ends with a case study: the eval set for Desk.
Chapter 10: Memory Patterns
The chapter opens with the kinds of memory.
| Pattern | What it does |
|---|---|
| Tiered memory | Keeps a short index in the window, and loads details when needed |
| Structured note taking | Writes notes outside the window, and reads them back later |
| Retrieval backed memory | Searches stored memory, through plain files or a store that finds entries by similarity of meaning (an embedding store) |
| Consolidation and staleness | Removes duplicates, and marks a claim stale when its evidence changes |
The chapter ends with two case studies: Forge across many sessions and Mailbox over months.
Chapter 11: Multi Agent Patterns
The chapter opens with when one agent is not enough.
| Pattern | What it does |
|---|---|
| Orchestrator workers | A lead plans, briefs workers, and combines their results |
| Context isolated sub agents | Gives each sub agent an empty window, and takes back a short result |
| Fork join | Divides a task across parallel workspaces, and merges the results |
| Sequential pipelines | Passes the work through fixed stages |
| Handoffs | Lets the current agent choose the next agent |
| Group chat and debate | Has agents share one thread, with a manager choosing who speaks |
| Maker checker | Separates the checker's context, tools, or model from the maker's |
| Communication contracts | Decides what agents pass to each other and what they share in a store |
| Failure containment | Stops one bad worker from failing the whole task |
The chapter ends with a case study: Scout as orchestrator workers.
Chapter 12: Cost, Latency, and Scale Patterns
The chapter opens with the token economics of an agent loop.
| Pattern | What it does |
|---|---|
| Prompt caching | Reuses the provider's work on opening text that is identical, byte for byte, across calls, and keeps the loop's early text unchanged |
| Model routing and tiering | Uses small models for easy steps and large models for hard ones |
| Tool result caching | Reuses repeated reads within a run, and removes identical calls |
| Latency patterns | Uses streaming, parallel tool calls, and speculative work |
| Serving infrastructure | Uses queues, rate limits, and rainbow deployments |
| Background agents | Starts from an event, works in isolation, and reports back for review |
The chapter ends with a case study: Desk's cost reduced.
Chapter 13: Interoperability and Change
| Pattern | What it does |
|---|---|
| Model Context Protocol | Standardizes how tools, resources, and prompts are offered to an agent |
| Agent to agent protocols | Standardizes how one agent advertises to another and accepts its tasks |
| Build or adopt | Weighs what a framework provides against what it costs |
| Portability | Keeps tool schemas, state, and evals independent of the vendor |
| Retiring harness parts | Tests each part's assumption on an upgrade, and removes the parts that are no longer needed |
Chapter 14: Full Designs and the Pattern Catalog
This chapter adds no patterns and applies the earlier ones to whole systems. After the completed worksheet, it designs a customer support agent, a coding agent, a data analysis agent, a browser automation agent, and an incident response agent. It ends with a blank brief for you to solve and the pattern catalog.
Appendix
Implementation Notes holds the dated vendor and protocol details that change quickly and that the lessons leave out.
The next lesson begins the patterns with the simplest one, prompt chaining, in which your code fixes every step and the model fills them in.
Reading Progress
0%
On This Page
How the Course Is Organized
How to Read a Lesson
What Framework-Free Means
How to Read the Numbers
The Running Agents
Every Pattern by Chapter
Chapter 1: What an Agent Is and When to Build One
Chapter 2: Workflow Patterns
Chapter 3: Tool Use Patterns
Chapter 4: Planning and Reasoning Patterns
Chapter 5: Context Engineering Patterns
Chapter 6: Human Oversight Patterns
Chapter 7: Reliability and Guardrail Patterns
Chapter 8: Security Patterns
Chapter 9: Evaluation and Observability Patterns
Chapter 10: Memory Patterns
Chapter 11: Multi Agent Patterns
Chapter 12: Cost, Latency, and Scale Patterns
Chapter 13: Interoperability and Change
Chapter 14: Full Designs and the Pattern Catalog
Appendix