Grokking Agentic Design Patterns
Vote

0% completed

​

The Pattern Map

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.

PartChaptersWhat it adds
Part 1: One Agent That Works1 to 5The loop, fixed workflows, tools, planning, and what goes into each model call
Part 2: An Agent You Can Trust6 to 9Human oversight, reliability controls, security, and evaluation
Part 3: Agents at Scale10 to 13Memory, several agents, cost and latency, and interoperability
Part 4: Full Designs14Whole systems, a blank brief for you to solve, and the pattern catalog
Appendix15Vendor and protocol details that change quickly
The 14 chapters and the appendix, grouped into four parts, with each part leading to the next.
The 14 chapters and the appendix, grouped into four parts, with each part leading to the next.

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:

  1. An opening that states the problem or the idea, and the question the lesson answers.
  2. A bold definition of the pattern, then the mechanism.
  3. One worked example, usually with a table of numbers.
  4. The costs, the limits, and when a simpler design is better.
  5. 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.

AgentProductToolsDefault autonomy
DeskCustomer support for an online store10: 6 read, 4 writeConfirm refund and close
ForgeCoding agent on a repository8: 5 read, 3 writeAct and report inside the sandbox
MailboxEmail assistant with web access12: 8 read, 4 writeSuggest send; act on the rest
ScoutResearch and report4: 3 read, 1 writeAct 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

PatternWhat it does
Prompt chainingRuns fixed steps in sequence, with a code check between steps
RoutingSorts the input and sends it to a specialist path
ParallelizationRuns independent parts at the same time, or runs one task several times and combines the votes
Evaluator optimizerOne call generates, another scores, and the loop repeats until the criteria pass or a limit stops it
Structured outputPasses data between steps as an object whose fields and types are fixed in advance
CompositionCombines the building blocks into one pipeline

Chapter 3: Tool Use Patterns

PatternWhat it does
Function callingThe model requests a call, your code runs it, and the result returns
Tool designTreats a tool's description as an interface written for the model
Granularity and namespacingChooses how many tools to offer, and prefixes names when tools overlap
Progressive tool expansion and tool searchStarts with a small set, and adds tools only when the task needs them
Tool results and errorsReturns useful, short results, and errors that say what to try next
Code executionLets the model write and run code in a sandbox, in place of many narrow tools
Retrieval as a toolLets the agent decide when to search and refine its query across rounds
Read and write separationSeparates 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

PatternWhat it does
Reasoning between actionsAdds a reasoning step between tool calls, either requested in text or built into the model
Task decompositionSplits a goal into checkable subtasks, and keeps the list as state
Plan then executeMakes the whole plan first, then runs it step by step
ReplanningKeeps one record of what the task needs and one of whether it is advancing, and replans when progress stops
ReflectionHas the agent review its own output against criteria before returning it
ExplorationGenerates several possible paths, scores them, and continues the best

The chapter ends with choosing a planning pattern.

Chapter 5: Context Engineering Patterns

PatternWhat it does
The window as a budgetTreats the context window, the most text that one model call can contain, as a budget for everything the call sends
Calibrated instructionsMakes instructions specific enough to guide the model and general enough to leave room for judgment
CompactionSummarizes history when the window fills, keeping the goal and safety rules outside the summary
Context resets and handoffsDiscards the window and rebuilds it from a handoff file
Instruction filesLoads project rules in every session, and scoped rules by location
Lifecycle hooksBinds required steps to harness events, so the model need not remember them
SkillsPackages a procedure in a folder that loads in three tiers

Chapter 6: Human Oversight Patterns

PatternWhat it does
Autonomy levels per actionAssigns suggest, confirm, act and report, or act silently to each tool
Approval checkpointsPasses low-risk actions and stops high-risk ones for a person
Approval fatigue controlsUses batching, sampling, and thresholds so that reviewers keep reading
EscalationHands a case to a person, with enough detail that the person need not start over
Steering and pause resumeLets a person redirect a running agent, or resume it hours later
Feedback captureRecords 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.

PatternWhat it does
Guardrail layeringPlaces checks on the input, on each tool call, and on the output
Outcome verificationReads the environment rather than trusting the agent's claim
GroundingTies each claim to a retrieved source, and refuses when no source supports it
Least privilegeMakes tools read-only by default, and scopes credentials per tool
Identity and delegationActs with a user's scoped, expiring authority, and records the responsible person
SandboxingLimits what a wrong action can reach
Execution budgetsSets a maximum on steps, time, tokens, and money
Circuit breakers and stop controlsStops calling a tool after repeated failures, and lets a person stop the run
Durable stateRecords 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 recoveryUses 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.

PatternWhat it does
Lethal trifecta and Rule of TwoAudits which dangerous properties one session holds together
Dual LLMUses two large language models (LLMs), and keeps untrusted text away from the one that chooses actions
Action selectorLets the agent trigger tools but never act on their results
Plan then execute, for securityFixes the plan before the first untrusted read
Context minimizationRemoves the user's text from context after converting it to a query
Map reduceHas isolated workers read untrusted content and return only simple values
Code then executeHas a privileged model write a program, and checks a policy at every tool call
Probabilistic defensesAdds 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.

PatternWhat it does
The first eval setBuilds 20 to 50 tasks from real failures, as Anthropic suggests
Grader typesScores with code, with a model, or with a person
Trajectory evaluationGrades the path of tool calls as well as the outcome
Capability and regression evalsSeparates what the agent can do from what must not break
TracingRecords each step, tool call, and token, and samples production runs
Debugging from a traceFollows a bad score to the step in the trace that caused it, and adds a test task that must keep passing
Eval driven developmentChanges 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.

PatternWhat it does
Tiered memoryKeeps a short index in the window, and loads details when needed
Structured note takingWrites notes outside the window, and reads them back later
Retrieval backed memorySearches stored memory, through plain files or a store that finds entries by similarity of meaning (an embedding store)
Consolidation and stalenessRemoves 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.

PatternWhat it does
Orchestrator workersA lead plans, briefs workers, and combines their results
Context isolated sub agentsGives each sub agent an empty window, and takes back a short result
Fork joinDivides a task across parallel workspaces, and merges the results
Sequential pipelinesPasses the work through fixed stages
HandoffsLets the current agent choose the next agent
Group chat and debateHas agents share one thread, with a manager choosing who speaks
Maker checkerSeparates the checker's context, tools, or model from the maker's
Communication contractsDecides what agents pass to each other and what they share in a store
Failure containmentStops 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.

PatternWhat it does
Prompt cachingReuses 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 tieringUses small models for easy steps and large models for hard ones
Tool result cachingReuses repeated reads within a run, and removes identical calls
Latency patternsUses streaming, parallel tool calls, and speculative work
Serving infrastructureUses queues, rate limits, and rainbow deployments
Background agentsStarts 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

PatternWhat it does
Model Context ProtocolStandardizes how tools, resources, and prompts are offered to an agent
Agent to agent protocolsStandardizes how one agent advertises to another and accepts its tasks
Build or adoptWeighs what a framework provides against what it costs
PortabilityKeeps tool schemas, state, and evals independent of the vendor
Retiring harness partsTests 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%


Vote for new content

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