Chapters 1–4
Agent fundamentals
What is an AI agent? A guide to the loop, the harness, the engine underneath and when not to build one. Chapters 1 and 2 are free to read.
Home / Learn
Everything here is free and runs in your browser. The guides follow the book’s parts; the tools compute what the chapters teach; the explainers show it in three minutes. Teaching a course? See the teaching kit.
Chapters 1–4
What is an AI agent? A guide to the loop, the harness, the engine underneath and when not to build one. Chapters 1 and 2 are free to read.
Chapters 5–6
Tools for AI agents, explained: task-shaped tools, schemas, sandboxes, skills and protocols such as MCP. Start with Chapter 2, free to read.
Chapters 7–9
Context engineering for AI agents: the desk, the four operations, RAG vs long context vs fine-tuning, and memory. Start with the free chapter on the desk.
Chapters 10–14
AI agent design patterns that survive production: chains with gates, routing, evaluator loops, orchestrator–worker, approval gates. Start with the guide.
Chapters 15–16
How to evaluate AI agents: trace every run, grow an eval set from real failures, read pass@k and pass^k, calibrate the judge, gate releases. Start here.
Chapters 17–20
AI agent security risks, reliability and cost in one guide: prompt injection, the lethal trifecta, guardrails, retries, token bills, rollouts. Start here.
Chapters 21–27
AI agents in practice: why coding led, the spec-plan-execute workflow, the verification gap in research, trust, recipes and classifiers. Start the guide.
Chapter 19
Estimate what one agent run costs in tokens: the fixed prompt, the history it re-reads every step, retries and subagents. Free AI agent cost estimator.
Chapter 2
A free compounding error calculator for AI agents: whole-run success from per-step reliability, and the reliability a long task needs.
Chapter 12
Build a human in the loop approval policy for your AI agent: sort each action into four consequence tiers and get the gate each one needs. Try it free.
Chapter 7
A free context window budget planner: see how full your agent's window is, when it crosses the 40% rule of thumb, and which of four fixes to apply.
Chapter 16
A free eval sample size calculator for AI agents: confidence intervals for a pass rate and the number of tasks you need, computed in your browser.
Chapter 16
A free LLM judge agreement calculator: Cohen's kappa with an interval, precision and recall, the level check and bias tests. Paste your labels to start.
Chapter 17
A lethal trifecta checklist for AI agents: see which legs your design holds, whether a sharp tool adds risk, and the cheapest leg to cut. Print the audit.
Chapter 16
Compute pass@k and pass^k for an AI agent from its per-attempt success rate or your own runs, and see the reliability envelope. Free pass@k calculator.
Chapter 14
When to use AI agents, and when plain code, one model call or a workflow does the job better. Answer ten questions and see where your task sits on the ladder.
Chapter 5
A free tool schema linter for LLM agents: paste a tool definition and get findings on its name, description, schema, side effects and hidden injections.
4 min · Chapter 7
An animated explainer of context rot: why a fuller window makes an agent dumber, the five ways context fails, and the four operations that fix it.
3 min · Chapter 3
A three-minute animated explainer of the agent loop: the four beats of every pass, the history that is the agent's only memory, and three exits ranked by trust.
4 min · Chapter 17
A short animated explainer of the lethal trifecta: three agent capabilities that are fine alone, the theft when they meet, and the one leg to cut.
3 min · Chapter 1
A three-minute animated explainer: chatbot, workflow and agent differ in one thing, who decides the next step. Then the litmus test and the autonomy dial.
4 min · Chapter 19
A four-minute animated explainer: every agent step re-sends the whole transcript, so a ten-step run reads 77,000 tokens, not 32,000. See the staircase.
3 min · Chapter 2
A three-minute animated explainer: a hundred runs fall away down a chain of 95% steps, why pⁿ is the optimistic case, and the three levers that fight back.
14 min
Agents vs workflows comes down to one question: who decides the next step, your code or the model? Learn the rule, then read Chapter 1 free.
15 min
AI agent failure modes sorted for diagnosis: symptom, cause, trace signature and fix for each, cross-checked against MAST. Keep it open beside your traces.
13 min
An AI agents course syllabus for instructors: why the loop comes first, how to grade verification over demos, and how peer courses compare. Get the kit.
11 min
What is context rot? Why an AI agent degrades as its context window fills, the five failure modes behind it, and four fixes. Learn to diagnose a run.
15 min
How many eval examples do I need? Twenty to fifty at first, hundreds to compare versions. The arithmetic, paired tests, and a worked example to copy.
14 min
Idempotent tools for AI agents turn a retry or crash-resume into a no-op, not a second charge. Learn keys, receipts and retry rules with a worked example.