Agent Patterns

The techniques behind the jobs. Every page here answers the same three questions: how it works, when it is worth the cost, and how it fails.

23 patterns

These are the techniques the job pages keep reaching for. Each one has a demo, the cases where it pays, the cases where it is a waste, and what it costs in tokens, latency, and complexity.

Reflection

The agent criticises its own output before anyone sees it, against fixed criteria.

Sampling and voting

Run the same step several times and take the majority, for the steps that matter.

Verification

Check the answer against the tool results before it reaches anyone.

Supervisor and workers

One agent owns the goal and hands narrow tasks to specialists.

Debate and judging

Two agents argue opposite sides, a third decides.

Shared state

Agents read and write one shared workspace instead of messaging each other.

Human in the loop

Design the approval step so a person can actually judge it in seconds.

Budgets and limits

Steps, time, tool calls, and money: every agent needs all four capped.

Retries and idempotency

Retry the read, never the write, unless the write is idempotent.

Caching

The same question twice should not cost twice, and often should not be asked twice.

Cost control

Where agent money actually goes, and the four levers that move it.

Tracing and logging

If you cannot replay a run, you cannot fix it.

Evaluation harness

A frozen set of tasks with expected outcomes, run on every change.

Structured output

Ask for JSON with a schema, validate it, and repair once.

Retrieval for agents

Retrieval as a tool the agent chooses, not a step that always runs.

Choosing a model

Pick per step, not per system, and let the cheap steps be cheap.

Prompts for agents

An agent's system prompt is an operating manual, not a personality.

Long-running agents

Work that takes hours needs checkpoints, resumption, and a way to be cancelled.

Computer-use agents

Agents that click and type in a real interface, for systems with no API.

Voice agents

Speech adds latency, ambiguity, and no undo. Design for interruption.

Tool protocols

How agents connect to tools they did not ship with, safely.

Failure modes

The eleven ways agents fail, and which check catches each one.

Rolling out an agent

Shadow, assist, approve, auto: the four stages and what to measure at each.

Free from AI School - no signup, everything runs in your browser.