Skip to content
The agent engineering curriculum

Learn what every
framework hides.

One mechanism per lesson, from the loop and its tools to durable runs and evaluation. Every lesson carries runnable code, a stepped diagram, and a quick check before and after.

136 concepts19 topics34 open to everyone
Explore the curriculum

Work through a track in order, or search for the one mechanism you need today.

136 concepts · 19 topics
Topic 01 / 9 concepts

Model API Foundations

Read a model response properly, build a message list that never breaks, and handle streaming, retries, deadlines and provider differences before the loop depends on them.
  1. 01

    What a Model Call Returns to the Harness

    Every model call returns four things the harness must read before it acts: the content (text, tool calls or both), the stop reason (finished, hit the token limit, wants tools, was filtered), the usage (input and output tokens, which is the bill and the context size for the next turn) and, with some providers, a refusal or filter signal. Providers name these differently, so the harness normalises them into one shape at the boundary. The commonest bugs in first harnesses come from reading only the text: treating a truncated reply as finished, treating an empty content field as an empty answer when the model asked for a tool, and never recording usage so nobody can budget.
    Free
  2. 02

    The Message List the Harness Builds

    Every model call sends a list of messages with roles: system or developer instructions, user turns, assistant turns (which may carry tool calls) and tool results tied to the call they answer. The provider renders that list into one token sequence with a chat template, so what the model actually reads is a string with role markers, not a list. The list has rules the harness must keep: every tool result pairs with a call id in the previous assistant turn, nothing is dropped from inside a call-and-result pair, and the order of roles follows the template. A harness that trims history by slicing messages breaks these rules and gets a rejected request or a model that reads an orphaned result as noise.
    Free
  3. 03

    Determinism Is a Setting, Not a Guarantee

    Sampling settings decide how a model turns its per-token probabilities into one token. Low temperature and a seed make tool calls and structured output repeatable enough to test; higher temperature belongs only where you want several different candidates. But temperature 0 is not bit-for-bit deterministic on real serving stacks: batching with other requests and cache reuse change the arithmetic, and when two tokens are nearly tied the choice flips and the rest of the output with it. For an agent that compounds across many steps, this means a single passing run proves little. Tests use a scripted model; evals use repeated runs and report a rate with a denominator.
    Free
  4. 04

    Streaming Inside the Loop

    A streamed model response arrives as server-sent events carrying deltas: fragments of text, and fragments of tool-call arguments that the harness must reassemble by index before it can dispatch anything. Streaming cuts time to first token for prose turns and changes nothing for tool turns, where the harness has to wait for the complete call anyway. What an agent's client actually needs is a stream of loop events (step started, tool requested, result arrived, final answer, stopped with reason), produced by the loop and consumed by any UI, and a cancellation path that stops the producer rather than just closing the tab. Parsers must handle split UTF-8 bytes, events split across chunks and the final usage event that arrives after the last token.
  5. 05

    One Loop, Many Providers: The Adapter Layer

    Providers agree on the mechanism of tool calling and disagree on the wire: where the system prompt goes, whether tool calls are fields or content blocks, where tool results are placed and how they are matched to calls, how stop reasons are spelled, whether parallel calls are allowed and how strict schema enforcement is requested. A harness that lets those differences into the loop has provider-shaped bugs everywhere. The alternative is one neutral set of types (message, tool call, tool result, completion) that the loop, the tracer, the budgets and the tests use, and an adapter per provider that converts at the boundary. The adapter is small, it is where every provider-specific trap lives, and it is tested with recorded fixtures and a round-trip property rather than with live calls.
    Premium
  6. 06

    Rate Limits, Retries and Backoff Inside a Loop

    Model calls fail in three families: rate limits and overloads (retry after waiting), transient network or server errors (retry with backoff and jitter) and client errors (do not retry; fix the request). A model call is safe to retry because it has no side effect, which is what makes it different from a tool call. The retry budget belongs to the run, not the call, because an agent that retries each of forty steps three times has multiplied a hiccup into a two-minute stall. Honour Retry-After, use full jitter so a fleet does not retry in step, keep a token bucket in front of the provider so you stop hitting the limit, open a circuit when a dependency is down, and when retries are exhausted end the step with a reason the harness records rather than a stack trace the model reads.
    Premium
  7. 07

    Timeouts, max_tokens and Deadlines per Step

    The latency of one model call is roughly a fixed overhead, plus the input tokens divided by the prefill speed, plus the output tokens divided by the decode speed. Inside a loop that arithmetic repeats per step, so a run has a deadline, each step gets a share of it, and max_tokens for a step follows from the time left rather than from a default. A reserve is held back for a final wrap-up call with no tools, so a run that is out of time still returns a grounded partial answer instead of nothing. Timeouts are classified as transient and retried within the run budget, a stop reason of length triggers a continuation or a retry with more room, and a reply cut off mid-JSON is detected by the stop reason and never repaired into a wrong object.
    Premium
  8. 08

    Choosing a Model for Agent Work

    Choosing a model for an agent is a two-stage decision. First a screen on hard requirements: native tool calling with parallel calls, structured output, a context window large enough for the run, a latency floor that fits the deadline, data residency, price per step and a credible fallback. Then a score on probes shaped like agent work rather than chat: picking among similar tools, filling arguments from messy input, declining to call a tool when none fits, recovering from an error observation, holding a constraint across a long context, and following the output format every time. Probes with a ceiling effect separate nobody; the weights are a written decision; the chosen model id is pinned; a provider's deprecation is treated as a release that reruns the whole comparison.
    Premium
  9. 09

    Why Capable Models Still Fail Inside a Loop

    A frontier model inside a loop fails in ways that a stronger prompt does not fix, because they follow from how language models work. It agrees with a user who pushes back and changes a correct tool choice. It uses a constraint stated early less reliably once the context is long. It trusts its training-time memory over a fresh tool result, or trusts a tool result that is wrong. It writes an observation it never received, or declares a task complete that is not. And every one of these compounds across steps: a 2% per-step rate is a 45% failure rate over thirty steps. The engineering response is the same for each: a probe that triggers the failure with an automatic check, run on every candidate and every release, and a harness control that does not depend on the model behaving.
    Premium
Topic 02 / 6 concepts

Agent Loops

Build the loop by hand once and every framework becomes readable: a model call, a dispatcher, a growing transcript and a rule for stopping.
  1. 01

    The Agent Loop

    An agent is a loop: the harness sends the model the conversation and the tool definitions, the model answers or asks for tool calls, the harness runs those calls and appends their results, and the loop repeats until something stops it. The model proposes every step; the harness executes every step and owns every exit.
    Free
  2. 02

    Workflows and Agents

    In a workflow, code decides the sequence of steps and the model performs some of them. In an agent, the model decides the next step at run time. Agency buys adaptability and costs tokens, latency, variance and test surface, so the strongest designs keep a deterministic spine and give the model only the decisions that depend on what it discovers.
    Free
  3. 03

    Stop Conditions and Budgets

    A run should end for a reason the harness can name: a verified answer, a spent budget, a refused action, an unrecoverable failure or a human taking over. Budgets for steps, tokens, wall-clock time, money and per-tool calls are counted and enforced by the harness, set from the distribution of successful runs, and keep a reserve so a stopped run can still hand back a useful partial result.
    Free
  4. 04

    The Harness and the Authority Line

    The harness is everything wrapped around the model: context assembly, the tool registry, argument validation, authorization, execution, error translation, retries, budgets, state, tracing, human handoff and the stop decision. The authority line separates what the model may propose from what the harness will execute. Model output is untrusted input; identity, permissions and limits come from the harness, never from the model's arguments.
  5. 05

    Reading a Trace

    Debugging an agent means reading its trace: the ordered record of every model call and tool call with their inputs, outputs, timings and usage. Find the first step that went wrong, reconstruct exactly what the model saw at that step, classify where the failure entered (tool contract, context, plan, runtime or input), fix it at that location, and turn the run into a regression case. A trace is only useful if it records enough to replay a step.
    Premium
  6. 06

    Stuck-Loop Detectors: Repeats, Cycles and No Progress

    A step limit catches a stuck agent at the step limit, after the budget is mostly spent. A stuck-loop detector catches it within a few calls, by watching the sequence of tool calls for a repeating pattern. Three details make it useful rather than noisy. Calls are normalised before comparison, so a changed request id or a reworded argument still counts as the same call. The detector looks for a period, not only an exact repeat, so an agent alternating between two calls is caught as well as one repeating a single call. And a repeating pattern counts as stuck only when the results repeat too: an agent polling a job whose state changes is working, not stuck. The detector's output is an action, not a flag. The first detection sends the model a short note with the evidence, because models often recover when told what they are doing; the second ends the run with a named exit the caller can count.
    Premium
Topic 03 / 9 concepts

Tool Design

Write tools the way a model reads them: one job each, arguments it cannot misread, results it can act on, and side effects that are safe to repeat.
  1. 01

    Tool Contracts

    A tool contract is everything the model sees about a tool (name, description, parameter schema) plus what it gets back (the result and the errors). The model rereads it every turn and chooses among tools by it, so it is written for a model: one decision per tool, few required arguments with enums and formats, no identity parameters, compact results with ids and pagination, and side effects stated plainly.
    Free
  2. 02

    Tool Errors as Observations

    When a tool fails, the harness classifies the failure. Transient failures (timeouts, rate limits, 5xx on idempotent reads) are retried inside the dispatcher with backoff and a budget, so the model never sees them. Failures the model can act on (a bad argument, an unknown id, a business rule) go back as structured observations that say what was wrong and what to do. Failures nobody in the run can fix end the run or escalate. Swallowing errors, returning raw stack traces and retrying everything are the three common ways to get it wrong.
    Free
  3. 03

    Structured Outputs and Constrained Decoding

    Structured outputs constrain a model's generation so its output matches a schema, typically by masking tokens that would break the grammar at each step. That guarantees syntax and, for supported schema features, types and enums. It does not guarantee semantics: a valid refund call can name the wrong order or an amount larger than the charge. A harness checks three layers (parse, schema, meaning), repairs with a bounded, specific error, and handles truncation at the token limit.
  4. 04

    Parallel Tool Calls

    Models can return several tool calls in one turn. A dispatcher that runs them all concurrently is fast and wrong. Classify each tool as read or write and name the resource it touches; run independent reads in parallel; run writes in order; refuse conflicting writes to the same resource in one turn; give each call its own timeout and failure; and return results paired with their call ids in the order the model issued them.
    Premium
  5. 05

    Idempotent Side Effects

    An agent can attempt the same write more than once through four paths: a transport retry after a timeout, the model re-issuing a call whose result it never saw, a crashed run replaying a step, and two branches acting concurrently. An idempotency key derived from the business intent (the order and the action), stored by the receiving service with the first response, makes repeats return the original result. When a downstream system has no idempotency support, the harness records the intent first, checks before acting, and reconciles anything uncertain.
    Premium
  6. 06

    Large Tool Surfaces

    Selection accuracy falls and per-turn cost rises as an agent's tool list grows, especially when tools overlap. The fixes, in order: consolidate endpoint-shaped tools into decision-shaped ones and namespace the rest; project the tool list per task so a run only sees what its task needs; load definitions on demand through a tool search step; or route requests to specialist agents with small tool sets. Each fix is judged on a labelled tool-selection set, and dynamic tool lists are placed so they do not break the prompt cache.
    Premium
  7. 07

    Malformed Tool Calls: What the Harness Repairs, Rejects and Rescues

    A malformed tool call is a request the dispatcher cannot run as written. They come in a short catalogue: JSON wrapped in a code fence or followed by commentary, a value of the wrong type that parses exactly, a missing or extra argument, an unknown tool name, and a call written in the text instead of the tool-call field. The harness handles each in one of three ways. It repairs only what cannot change the model's intent (strip a fence, convert "8611" to 8611 when the schema says integer). It rejects everything else with an error that names the field, the rule and the exact value to send instead, capped at one or two attempts. And it rescues a call the model wrote as text by returning an observation that tells it to use the tool-call field, never by parsing the prose into a call. The split is measured: how often each case occurs per model, and how often the model recovers on the next turn.
    Premium
  8. 08

    Tool Results That Fit the Context

    A tool result enters the context once and is reread on every later turn of the run, so its size is paid many times over, and its shape decides whether the model can act on it. The same backend answer can be returned in several shapes: raw records, projected fields, a page with a cursor and a total, a summary computed for the question, or a reference the model can fetch again. Choosing among them is a design decision measured on two axes, tokens per run and answer accuracy on a labelled task set, and the measurement usually shows that the answer-shaped result wins on both. Rules follow: project to the fields the next step uses, precompute what the model would otherwise infer, page large results and say the total, never let a partial list look complete, and keep bulk out of the history by returning a reference the model can expand on demand.
    Premium
  9. 09

    Testing Tools Without a Model

    Most tool bugs have nothing to do with the model, and testing them through the model is slow, costly and noisy. Four kinds of test need no model at all: example tests on the function, contract checks that the name, description, schema and result shape give a model what it needs, seeded fuzzing over generated inputs so bad arguments produce typed refusals and never crashes, and a fake backend that behaves like the real service including its timeouts, errors and partial failures. The model enters only for selection: a small labelled set of requests, run several times, checking which tool it chose and what arguments it filled. Splitting the tests this way makes the first four fast and deterministic in CI and keeps the one that needs a model small enough to run on every change.
    Premium
Topic 04 / 6 concepts

Context Engineering

Spend the window on purpose: what the model sees at each step, what you clear, what you summarise, and what stays byte-identical so the cache holds.
  1. 01

    The Context Window as a Budget

    An agent's context window holds a stable prefix (system prompt, tool definitions) and parts that grow every turn (conversation, tool results, notes). Treating it as a budget means accounting for each part's tokens on every turn, capping what grows, reserving room for the model's output, and clearing or compacting at deliberate thresholds well before the limit, because quality falls long before the window is full and every token is reread on every later turn.
    Free
  2. 02

    Context Rot

    Context rot is the drop in a model's accuracy as its input grows longer and noisier, even when the fact it needs is present. Three effects drive it: attention spread over more tokens, distractors that resemble the right answer, and position (facts in the middle of a long input are used less reliably). Agents are especially exposed because their context grows every turn with stale and repetitive tool output. The fix is to keep the context small and high-signal, not to buy a bigger window, and to measure the effect on your own task.
    Free
  3. 03

    Clearing, Compaction and Notes

    Long-running agents need context reduction, and the tools differ in how much they lose. Tool-result clearing replaces results already used with placeholders while keeping the record of each call. Notes move durable facts and progress out of the transcript into a small structured store the agent rereads. Compaction rewrites the conversation into a summary and is the lossiest, so it runs rarely, at deliberate boundaries, under a contract that names what must survive, and with a test that checks it did.
  4. 04

    Prompt Caching for Agents

    Prompt caching reuses the provider's computation for a prefix identical to one it processed recently, which makes repeated input cheaper and faster. Agents benefit more than chat because each turn resends everything before it. The benefit depends on a byte-stable prefix: stable content first (system prompt, tools, fixed documents), history append-only, anything per-request or per-turn at the end. Timestamps, reordered tools, non-deterministic serialization and edits to earlier messages each turn a hit into a miss.
    Premium
  5. 05

    Just-in-Time Retrieval

    Instead of loading everything an agent might need into every request, just-in-time retrieval gives it lightweight handles (file paths, record ids, document titles with sizes and dates) and tools to open exactly the slice it needs when it needs it. The trade is a few extra turns of latency against a much smaller, cleaner context. Good designs keep a small always-present core, give the agent a map of what exists, return slices rather than whole documents, and treat everything fetched as untrusted input.
    Premium
  6. 06

    Four Ways Long Context Fails: Poisoning, Distraction, Confusion and Clash

    Long agent contexts fail in four recognisable ways, named by Drew Breunig in 2025. Poisoning: a wrong statement enters the context and is referred back to until it shapes every later step. Distraction: the accumulated history grows until the model leans on repeating past actions instead of the task. Confusion: irrelevant documents or too many tools influence the response. Clash: information added at different times contradicts itself. Each has a trace signature and a harness fix: validated memory and quarantine, compaction and notes, selection and tool projection, and explicit supersession of stale facts.
    Premium
Topic 05 / 6 concepts

Agent Memory

Decide what an agent should remember, who may read it back, and how a wrong memory gets corrected before it does damage.
  1. 01

    Memory, Context and Retrieval

    Agent memory is often confused with two neighbouring ideas. Context is what the model reads on this turn and nothing more; it disappears when the request ends. Retrieval reads from a corpus that someone else curates (documents, tickets, code), shared across users. Memory is what the agent system itself writes, about a user, a task or how to do something, and reads back later. Each has a different writer, lifetime, audience and way of going wrong, and a design has to say which one each fact belongs in.
    Free
  2. 02

    Memory Write and Read Policies

    A memory system is defined less by its storage than by two policies. The write policy says what earns a place (stated preferences, confirmed outcomes, lessons that held up), what never does (secrets, guesses about sensitive traits, transient details), and that scope and source come from the harness, not the model. The read policy filters by scope before relevance, caps how much is injected, renders each memory with its source and age, and lets the agent search memory as a tool when automatic injection would add noise.
  3. 03

    Provenance, Expiry and Correction

    Memories go wrong in three ways: they were never true, they stopped being true, or they were true for someone else. Each record therefore needs provenance (who or what wrote it, from which run and on what basis), a lifetime suited to its kind, and a correction path in which new facts supersede old ones rather than overwriting them silently. Deletion must reach every copy, including summaries and search indexes, and the system must be able to answer 'why does the agent believe this?' from the record alone.
    Premium
  4. 04

    Episodic, Semantic and Procedural Memory

    Borrowed from cognitive science and applied to language agents in work such as CoALA (Sumers et al., 2023), the split is practical. Episodic memory records what happened in past runs and is read as examples of similar situations. Semantic memory holds facts about users, projects and the world, read by key or relevance. Procedural memory holds how to do things, as instructions, scripts or skill files, and changes the agent's behaviour on every run that loads it. Consolidation turns episodes into facts and procedures, and because procedures act on every later run, promoting one needs evidence across runs and a review.
    Premium
  5. 05

    Memory Poisoning and Tenant Isolation

    Persistent memory adds two engineering risks to an agent. Poisoning: content the agent read (a web page, an email, a ticket) ends up written as memory and steers later runs long after the original content is gone. Leakage: a record written in one tenant's or user's scope is read in another's because isolation depended on a query filter. The defences are structural: memories carry taint from untrusted sources and cannot become stated facts, writes from runs that read untrusted content are held for review, memory never authorises an action by itself, and storage, indexes and caches are partitioned by scope with tests that try to cross it.
    Premium
  6. 06

    Memory Architectures Compared: Vector Stores, Graphs, Profiles and Notes

    Agent memory systems are combinations of four storage shapes. Vector stores retrieve snippets by semantic similarity and suit fuzzy recall over many past interactions, but return near-misses and handle updates poorly. Knowledge graphs store entities and relations and answer multi-hop and time-bounded questions, at the cost of extraction quality. Structured profiles hold known fields with clear update rules. Notes files are plain text the agent edits, simple and inspectable but unindexed. Choosing is about the questions the agent must answer and how facts change, then write and read policies on top.
    Premium
Topic 06 / 8 concepts

Planning & Control

Choose how much the model plans and how much the code controls, and know what each choice costs when the plan meets a changed world.
  1. 01

    ReAct

    ReAct (Yao et al., 2022) interleaves a short piece of reasoning with each action and lets the next piece of reasoning read the observation that came back. It is the default shape of most tool-using agents today, usually expressed through native tool calls rather than the paper's text format. It adapts well when the path is unknown and the horizon is short, and it struggles when a task needs a global plan, when a step's result is misleading, or when the run is long enough that rereading every step becomes the main cost.
    Free
  2. 02

    Plan-and-Execute and Replanning

    Plan-and-execute separates deciding from doing: a planner produces an ordered list of steps (or a dependency graph), code validates it, an executor runs the steps, often with a cheaper model or no model, and a monitor decides when to replan. It cuts cost and latency compared with reasoning before every action and makes runs easier to review and approve. Its characteristic failure is executing a plan whose assumptions are no longer true, so good plans state their assumptions and preconditions, and the executor checks them before each step.
    Free
  3. 03

    Explicit State Graphs

    An explicit state graph makes an agent's process a data structure: nodes do work (code, a model call, a small ReAct loop, a human), edges say what may follow what, and guards decide transitions that must follow rules. The model may choose among the edges a node allows, never invent new ones. Graphs give checkpoints at every node, natural places for human approval, and a process that can be tested transition by transition and audited afterwards. They cost flexibility, so the craft is deciding which parts are fixed and which are left to the model.
  4. 04

    Reflection with an External Signal

    Reflection asks the model to critique and revise its own output. With an external signal (failing tests, a schema validator, a compiler, a tool error, a reference check) it is one of the most reliable improvements available, as in Reflexion (Shinn et al., 2023). Without one, it is the model grading itself: studies such as Huang et al. (2023) found intrinsic self-correction often fails to improve reasoning and can turn correct answers into wrong ones. Good designs trigger reflection only when a check fails, pass the specific failure back, bound the retries, and measure how often reflection fixes and how often it breaks.
    Premium
  5. 05

    Search over Trajectories

    Search runs several candidate trajectories (samples, beams or a tree of partial plans) and selects among them with a verifier or value estimate. Best-of-N sampling, beam search, Tree of Thoughts (Yao et al., 2023) and Monte Carlo tree search over agent actions such as LATS (Zhou et al., 2023) are points on one spectrum. Gains depend on two numbers, how often at least one candidate is right and how reliably the judge finds it, and the cost grows with every branch. In agents, search is limited to steps without side effects, or to simulations and sandboxes, and latency budgets push it towards parallel, shallow search.
    Premium
  6. 06

    Task Decomposition Trees: AND, OR and Local Fallbacks

    A task decomposition tree breaks a goal into subgoals and those into smaller subgoals until each leaf is a single tool call. Two kinds of inner node carry the structure: AND nodes succeed only if every child succeeds, in an order that respects their dependencies; OR nodes succeed if any one child succeeds, tried in order of preference. The model proposes the split one node at a time; code validates it, bounds the depth and the branching, and runs the leaves. The design pays off at failure time: an OR node absorbs a failed child by trying the next alternative locally, so a single dead tool does not force a replan of the whole task, and an AND node that cannot complete reports exactly which requirement failed. Compared with a flat plan, the tree costs more model calls for the splits and buys locality of failure, a readable record of what was tried, and a natural place for budgets per subtree.
    Premium
  7. 07

    Choosing Among Samples: Votes, Verifiers and the Judge Ceiling

    Four ways exist to choose one answer from N samples: take the first, take the most common (self-consistency), take the one an exact verifier accepts, or take the one a model judge scores highest. They behave very differently as N grows. With an exact verifier, success approaches the chance that at least one sample is right. A majority vote helps when errors are scattered and hurts when the model has a systematic wrong answer that it produces more often than the right one, because more samples make that answer win more reliably. A judge sits between the two: its gain is capped by its own false-accept and false-reject rates, and a judge that passes padded or confident wrong answers can select worse than the first sample. The lesson is a measurement procedure: simulate or measure the four strategies on your task, read the curve against N, and spend samples only where a verifier or a calibrated judge exists to pick among them.
    Premium
  8. 08

    Reasoning Effort as a Harness Setting: Ladders, Floors and Caps per Step

    Providers expose how much a model thinks before answering as a per-call setting: an effort level or a thinking-token budget, billed as output tokens and paid in latency. Because it is per call, the harness chooses it per step, and the right choice differs by step type. Steps whose mistakes a cheap check catches start low and escalate on failure. Steps whose mistakes are costly and found late, a plan or a diagnosis, are fixed high, because escalating after the damage costs more than thinking first. The lesson gives the policy as floors and caps per step type and measures it on a labelled set that charges the cost of a wrong step.
    Premium
Topic 07 / 11 concepts

Agent Evals

Measure a system that answers differently every time: grade end states, check trajectories, count reliability across runs and read the trace before trusting the score.
  1. 01

    pass@k and pass^k

    Agents give different results on the same task from run to run, so a single success rate hides what matters. pass@k, from code-generation benchmarks (Chen et al., 2021), is the probability that at least one of k attempts succeeds, which is the right number when a verifier can pick the good attempt. pass^k, used in agent benchmarks such as τ-bench (Yao et al., 2024), is the probability that all k attempts succeed, which is the right number when every run reaches a user. They move in opposite directions as k grows, and both have unbiased estimators from n runs per task.
    Free
  2. 02

    Outcome and Trajectory Grading

    Outcome grading checks the world after the run (database rows, files, test results, the message sent) and is robust to the many valid paths an agent can take. Trajectory grading checks the path itself: forbidden actions, required confirmations, order constraints, cost and step counts. Matching a run step by step against a reference trajectory is brittle and penalises valid alternatives, so trajectory checks should be stated as invariants. Code graders handle most of both; model-based graders cover qualities code cannot check, such as whether a reply was clear, and need calibration.
    Free
  3. 03

    Calibrating an LLM Judge

    Model-based graders scale evaluation to qualities code cannot check, but they have known biases: preferring longer answers, the first option in a pair, and outputs from their own model family (Zheng et al., 2023). Calibrating a judge means building a human-labelled set, measuring the judge's agreement with people beyond chance (for example with Cohen's kappa), looking at which errors it makes (false passes are usually the costly ones), tightening the rubric into specific, checkable criteria, and re-running the calibration when the judge model, rubric or task distribution changes.
  4. 04

    Tracing Agents

    A trace records an agent run as a tree of spans: the run, each turn, each model call and each tool call, with timings, token counts, cache reads, costs, model and prompt versions, and which part of the system made each decision. Good tracing answers operational questions (where did the latency go, what does a task cost) and debugging questions (why did it do that), and it feeds evaluation: failed production traces become regression cases. Standard conventions such as OpenTelemetry's generative-AI attributes (still evolving in 2026) let traces flow into existing tools, and redaction and sampling keep them safe and affordable.
    Premium
  5. 05

    Regressions in a Non-Deterministic System

    Agent evals are noisy: sampling, tool timing and model serving all vary, and even temperature zero does not guarantee identical outputs. Detecting a regression means separating the change from the noise: record tool responses so the environment is fixed, run each task several times, compare old and new versions on the same tasks as pairs, put an interval on the difference, and size the eval for the smallest drop worth catching. Gates should look at slices and guard metrics, not only the overall rate, and a confirmed regression is triaged by bisecting what changed.
    Premium
  6. 06

    OpenTelemetry for Agents

    OpenTelemetry's GenAI semantic conventions, now maintained in their own repository and still in Development status, define how to trace agents: create_agent and invoke_agent spans (named for the operation and the agent), model-call and tool-execution spans beneath them, and attributes such as gen_ai.operation.name, gen_ai.provider.name, gen_ai.agent.name, gen_ai.request.model, gen_ai.conversation.id and token usage. Message content, system instructions and tool definitions are opt-in because they may hold sensitive data. Because names can still change, teams map their own stable trace schema onto the conventions at export.
    Premium
  7. 07

    Reading Agent Benchmarks

    Agent benchmarks measure different things: SWE-bench Verified (500 human-validated GitHub issues, 2024) tests repository bug fixing; OSWorld (369 tasks across real desktop and web applications, with a 2.0 released in 2026) tests computer use; tau-bench (2024) tests tool use with a simulated user and grades the database end state, and introduced pass^k; METR's time horizon expresses capability as the length of task, in expert human time, an agent completes at a given reliability. Scores depend on the harness, the budget and the trials, carry sampling noise, and saturate. A decision about your agent needs a paired comparison on your own tasks.
    Free
  8. 08

    Evaluating Agents in Production: Signals, Sampled Grading and Drift

    Production evaluation layers signals by cost and delay: deterministic checks on every run (exit reasons, invariants, errors, cost), implicit user signals (retries, escalations, undo), sparse explicit feedback, sampled grading by a calibrated judge and by people, and lagging business outcomes. Sample by stratum so rare, risky and new traffic is graded. Tag every run with its agent and model versions, watch the input mix and exit reasons against a baseline, and turn graded failures into offline eval cases.
    Premium
  9. 09

    Golden Tasks and Dataset Lint

    Before an eval can say anything about an agent, its tasks have to be right, and nothing checks that by default. A golden task carries an input, a checker, a reference answer the checker must accept, and known-bad answers the checker must reject; running the checker against its own references is the cheapest test an eval set has and the one most teams skip. Dataset lint extends that: duplicate and near-duplicate tasks across dev and test sets (which measure memory, not skill), tasks whose checker can never fail, tasks whose reference contradicts their input, tag coverage so every slice the release gate reads has enough items, and provenance so each task says where it came from. Production failures feed the set through the same lint, so a task added in a hurry cannot poison the gate without being noticed. The procedure runs in CI on every change to the dataset, in seconds, with no model.
    Premium
  10. 10

    Tool-Call Accuracy, Decomposed

    A single tool-call accuracy number is almost useless for deciding what to fix, because four different failures feed it. Selection errors (the wrong tool, or a tool when none fits) come from overlapping names and descriptions and are fixed in the contract. Schema failures (missing or extra fields, wrong types) come from the schema's shape and the model's reliability at structured output. Value errors (the right field, the wrong content) come from messy inputs and missing normalisation. Each is measured on its own, from a labelled set that includes requests whose correct answer is no tool call at all, with values compared after normalisation so a case or whitespace difference is not a miss. The decomposed scores point at the owner of the fix, and the same set run several times per request turns a flaky failure into a rate.
    Premium
  11. 11

    Replay Cassettes: Recorded Model Calls for Deterministic Agent Tests

    A scripted fake model returns replies you invented. A replay cassette returns replies a real model actually gave, recorded once and keyed by a fingerprint of the request: the model, the rendered messages, the tools and the sampling settings, with volatile fields removed. In replay mode a test runs the whole agent loop against the recording, deterministic, offline and in milliseconds, and exercises the harness on the real shapes a provider produces, including the odd ones nobody would think to script. The fingerprint is what makes the technique honest: any change to a prompt, a tool description or a setting changes the key, and in strict mode a miss fails the test instead of calling the provider with no alert. That is the right default, because a silent re-record hides exactly the change the test should make you look at. Cassettes test harness behaviour against real replies; they cannot detect that the model itself has changed, which remains the job of probes and evals run live on a schedule.
    Premium
Topic 08 / 9 concepts

Multi-Agent Systems

Split work across agents only when isolation or parallelism pays for it, and design the handoff contract so errors do not travel with the work.
  1. 01

    When a Second Agent Pays

    Multi-agent systems help in specific conditions: the work divides into parts that can proceed independently, each part needs a lot of reading that would swamp one context window, or parts need different tools and permissions. They cost several times the tokens of a single agent, add latency at every handoff, and lose information at every boundary. Published experience from 2025 points both ways: Anthropic reported large gains from parallel subagents on broad research, and Cognition argued against splitting work that requires shared, consistent decisions. The deciding question is whether the parts are independent.
    Free
  2. 02

    Orchestrator and Workers

    In an orchestrator-worker system a lead agent decomposes the task, writes a brief for each worker, runs workers (often in parallel) with their own contexts and tools, validates and merges their structured results, and decides whether more work is needed. Most failures trace to the boundaries: vague briefs that cause duplicated or off-target work, results without sources that cannot be checked, and no budget or stopping rule. The harness, not the lead's judgement alone, should enforce worker budgets, timeouts and the shape of what comes back.
  3. 03

    Handoffs and Agents as Tools

    A handoff transfers the conversation to another agent, which then talks to the user with its own instructions and tools; it suits routing to specialists who should own the rest of an interaction. An agent-as-tool is called like a function by an agent that keeps control and receives a result; it suits bounded subtasks whose output the caller will use. Both need a contract for what crosses the boundary: a structured case summary rather than the whole transcript, the receiving agent's own permissions, and a defined way back.
    Premium
  4. 04

    Shared State and Conflicts

    When several agents share state, two kinds of conflict appear. Write conflicts: two workers read the same record, change it and write it back, and one change is lost. Content conflicts: two workers report findings that contradict each other. Write conflicts are solved with ordinary concurrency control: a single writer that applies proposals, or versioned compare-and-set writes. Content conflicts need an explicit policy: keep findings append-only with source, date and author, detect contradictions by claim, and resolve them by source authority, recency or a targeted check, surfacing what remains unresolved.
    Premium
  5. 05

    Cascading Errors

    Multi-agent systems fail in ways single agents do not. One agent's error arrives at the next as an input it has no reason to doubt; summaries drop hedges, so a guess becomes a fact two hops later; and agents that agree may be echoing one source. Studies such as Cemri et al. (2025) grouped such failures into specification problems, misalignment between agents and missing verification. The defences carry provenance with every claim, verify the decisive claims against primary sources, and check independence before counting agreement.
    Premium
  6. 06

    Deep Research Agents

    Deep research agents answer open questions by planning sub-questions, running searches in parallel (often through subagents with their own context windows), reading and extracting evidence, and synthesising a cited report. Parallel workers buy breadth and speed at a large token cost. The failure modes are predictable: overlapping or missing sub-questions, workers that return prose instead of evidence, a writer that states things no source says, citations attached to the wrong claim, and stopping too early or never.
    Free
  7. 07

    Multi-Agent Topologies: Supervisor, Router, Map-Reduce and Swarm

    Multi-agent systems differ mainly in topology. A router classifies a request and hands it to one specialist. A supervisor (orchestrator) plans, delegates to workers and checks their results. Map-reduce splits independent work across parallel workers and merges results in code or with one reducer. Hierarchies stack supervisors. Swarms and group chats let agents address each other freely, which is flexible and hard to bound. Messages, context and cost grow with the number of agents that read each other's output, and errors propagate along the same paths.
    Premium
  8. 08

    Mailboxes and Actors: Message Passing Between Agents

    Agents that coordinate through a shared transcript or shared state inherit every concurrency problem of shared memory. The alternative is the actor model: each agent owns private state and a mailbox, handles one message at a time, and talks to other agents only by sending messages. That removes lost updates by construction and makes each agent testable alone. It also imports the problems of any message system, and a design has to answer each one: a request needs a correlation id so the reply can be matched; delivery is at least once, so handlers are idempotent; a mailbox can fill, so producers feel backpressure instead of growing the queue without limit; a message nobody can process goes to a dead-letter queue with its history instead of being retried forever. Compared with an orchestrator calling workers, mailboxes buy decoupling and independent failure, and cost visibility, which a trace that follows the correlation id across mailboxes restores.
    Premium
  9. 09

    How Swarms Fail: Six Patterns and the Cheap Guard for Each

    Multi-agent systems add failure modes that are properties of the group, not of any member. Six recur: delegation loops, where a task is handed from agent to agent without anyone owning it; duplicate work, where two agents take the same task; runaway spawning, where sub-agents create sub-agents until cost or limits blow up; error cascades, where one unsupported claim is built on by every later agent; false completion, where the group ends on an agent's say-so with acceptance criteria unmet; and deadlock, where agents each wait for output only another can produce. Each has a cheap, model-independent guard in the harness: a hop count and an owner on every task, a lease per task, a spawn budget per run with depth and fan-out caps, evidence attached to claims and checked at boundaries, completion as a harness check against criteria, and a timeout with a dependency graph that detects cycles. The guards are tested by injecting each failure in a scripted swarm and asserting that the run ends with the right reason.
    Premium
Topic 09 / 8 concepts

Durable Execution

Make a run survive the crash, the retry and the three-day wait for approval without doing any side effect twice.
  1. 01

    Durable Execution

    Durable execution makes a long-running process survive failures by recording an event history: each step that touches the outside world (a model call, a tool call, a timer) runs as an activity whose result is persisted, and a crashed run is rebuilt by replaying that history, returning recorded results instead of repeating work. For agents, model and tool calls are activities, the loop's control code must replay deterministically, and side effects still need idempotency because activities run at least once.
    Free
  2. 02

    Side Effects That Survive Retries

    Durable runs retry activities, and a retried side effect can happen twice. When the target system supports idempotency keys, use them. When it does not, the agent needs a protocol: write an intent record before acting, embed a unique reference in the request so the effect can be found later, treat a timeout as an unknown outcome to be resolved by lookup rather than by retrying, and reconcile periodically against the system of record. The outbox pattern keeps intent and action consistent, and anything the system cannot resolve goes to a person.
  3. 03

    Waiting for People

    Human-in-the-loop steps turn agent runs into processes that wait for hours or days. A durable design persists the run's state, releases workers and connections, and resumes on a signal (the decision) or a timer (a reminder, an escalation, an expiry). The approval must be bound to the exact action shown to the approver, so a run cannot ask about one thing and do another; it must come from someone entitled to give it; and before acting on it the run rechecks anything that may have changed while it waited.
    Premium
  4. 04

    Budgets, Loops and Termination

    Long-running agents need termination guarantees at three levels. Within a run, budgets for money, time, steps and per-tool use are recorded in durable state so a restart cannot reset them, and progress is measured by new information or completed work rather than by step count, which catches loops whose steps all look slightly different. Across runs, fleet-level limits and spend anomaly alerts stop a bug that is cheap per run but runs ten thousand times. And every limit ends the run cleanly, with a reason, a partial result and a record.
    Premium
  5. 05

    Long-Horizon Coherence

    As tasks stretch from minutes to hours, the limiting factor shifts from single-step skill to coherence across many steps and context windows. METR's 2025 measurements of AI task-completion horizons showed the length of tasks models can finish growing quickly, and with it the cost of drift. Coherence comes from structure outside the model: an immutable goal and constraints, a task list with status, a decision log with reasons, acceptance tests that define done, milestone checks against those anchors, and fresh-context restarts that rebuild from state rather than from a long transcript.
    Premium
  6. 06

    Event-Driven and Background Agents

    Background agents run without a person watching: a task is queued, a worker claims it, the agent works, and the result arrives later. Event-driven (ambient) agents react to events such as a new ticket, a failed build or a changed record. The engineering problems are distributed-systems problems: events arrive twice or out of order, so handling must be idempotent; claimed work needs a lease that expires; an agent whose actions emit the events it listens to can trigger itself forever; and people need an inbox showing what the agent did, what it is waiting for and what it wants approved.
    Premium
  7. 07

    Queues, Leases and Workers for Long Agent Jobs

    Agent runs that take minutes or hours run as jobs: a request enqueues a job and returns an id, a worker takes the job under a lease with an expiry, the worker heartbeats to extend the lease while the run progresses, and a worker that dies lets the lease expire so another worker can take over from the last checkpoint. Four mechanics make this safe. The lease is an atomic claim, so two workers never run one job. Each step the worker completes is recorded with an idempotency key, so a takeover does not repeat side effects. Retries are counted per job and a job that keeps failing goes to a dead-letter queue with its history instead of circulating. And the queue has a bounded depth with admission control, so a burst of requests produces honest waiting or refusal rather than an unbounded backlog. The same shape underlies hosted durable-execution engines; building it once makes those engines readable.
    Premium
  8. 08

    Versioning Prompts, Tools and Models as One Release

    A change to a system prompt, a tool description, a model id or a harness setting changes what an agent does, and any of them can be changed without a code deploy, which is how agents regress with nothing in version control to show for it. The fix is to treat the four as one release unit with one version id: content-addressed, built together, recorded on every trace span, and promoted through the same gate as code. Two consequences follow for long-running agents. A run that started on version 12 must finish on version 12 unless it is deliberately migrated, because a mid-run prompt or tool change can make the recorded history uninterpretable and the next step inconsistent with the last. And a release is checked by replaying recorded runs through the new version and diffing trajectories, which finds a changed tool call that an eval average would hide. Versioning is what turns 'the agent got worse on Tuesday' into a diff.
    Premium
Topic 10 / 5 concepts

Agent Runtime

Pick the isolation boundary from the threat, keep secrets outside the sandbox, and know where the time and money in a long loop actually go.
  1. 01

    Isolation Boundaries

    Code an agent writes is shaped by its inputs, which may be untrusted, so it must run as untrusted code. Containers share the host kernel and rely on namespaces, cgroups and syscall filters; gVisor interposes a user-space kernel; microVMs such as Firecracker give each workload its own kernel behind a hypervisor; WebAssembly exposes only granted capabilities. Choose by threat and workload, and add the same controls to every option: egress rules, a scoped filesystem, resource limits and no credentials inside.
    Free
  2. 02

    Credentials Outside the Sandbox

    Agent sandboxes often need to reach authenticated services (a Git host, a package registry, an internal API), but any credential placed inside can be read by the code running there and exfiltrated. The standard answer is a credential broker at the sandbox boundary: the sandbox sends unauthenticated requests through it, the broker checks each request against a narrow policy (which host, which methods, which paths or repositories), attaches a short-lived, least-privilege credential, and logs the call. Network egress is forced through the broker, so there is no other way out.
  3. 03

    Agent Economics: Prefill, Caching and Routing

    From the agent builder's side, a run's cost and latency come from four places: input processing (the whole context is read every turn, so it grows with the square of the turn count), output generation (slower per token but usually far fewer tokens), tool time and output generation (which together usually dominate wall-clock), and orchestration overhead. The levers follow: shrink what is resent (clearing, trimming tool results), cache stable prefixes, route routine steps to smaller or faster models, run independent tool calls in parallel, and cap turns. Measuring per step, from traces, shows which lever matters for a given agent.
    Premium
  4. 04

    Workspaces, Snapshots and Cold Starts

    Starting an agent session that runs code involves booting an isolated environment, fetching the workspace (a repository, data files), installing dependencies and warming caches, which together can take far longer than the first model call. The runtime hides this with layered images that bake in common toolchains, snapshots that restore a prepared environment instead of rebuilding it, warm pools sized from the arrival rate and preparation time, and persistent workspaces that carry files between sessions while secrets and credentials are excluded and re-issued each time.
    Premium
  5. 05

    Backpressure and Fleet Behaviour

    Agents fail as a fleet. When a downstream service struggles, every running agent retries, and agents add a second amplifier ordinary clients lack: the model reacts to errors by trying alternative calls, which multiplies load further. Fleet-level controls prevent this: retry budgets that cap retries as a fraction of normal traffic, exponential backoff with jitter, circuit breakers whose state is shared across workers, concurrency limits per dependency, admission control and queues with priorities, honouring rate-limit signals, and observations that tell the model a dependency is unavailable so it stops improvising.
    Premium
Topic 11 / 12 concepts

Agent Protocols

Read MCP, A2A, AG-UI and A2UI as engineering decisions: what each standardises, what it leaves open, and where authorization has to happen.
  1. 01

    The Model Context Protocol

    MCP defines host, client and server roles, tools, resources, prompts and versioned message contracts. The host still chooses the tool surface and the server enforces user permissions. Separate the legacy initialization exchange from current request metadata; verify the supported revision before integrating.
    Free
  2. 02

    Agent-to-Agent Delegation with A2A

    The Agent2Agent protocol (A2A), announced by Google in April 2025 and later moved to the Linux Foundation, lets independent agents, often built by different teams or vendors, delegate work to each other without sharing internals. A remote agent publishes an Agent Card describing its skills, endpoint and authentication; a client agent sends it a task; the task moves through states (working, input required, completed, failed and others); messages carry parts such as text, files and structured data; results arrive as artifacts, streamed or delivered by push notification. The caller holds a task id, not the other agent's tools or memory.
    Free
  3. 03

    Authorization at the Protocol Boundary

    When an agent calls a tool server or another agent for a user, authorization has to answer: on whose behalf, by which agent, to which service, for what. OAuth mechanisms answer most of it: audience-bound tokens (resource indicators) so a token works only at the intended server, token exchange so an agent obtains a narrower token for a downstream call instead of forwarding the user's, scopes requested incrementally as the task needs them, and no token passthrough. The server still makes the final decision per call, against the user's actual permissions on the specific resource, which is how confused-deputy failures are avoided.
  4. 04

    Long-Running Tool Calls

    Some tools take minutes or hours: a test suite, a data export, a background check. The asynchronous pattern starts the work and returns a handle; the caller tracks it by polling with backoff, a progress stream or a notification; the result is fetched when ready and kept for a stated time; cancellation and timeouts are explicit. MCP (experimental task handles since its 2025-11-25 revision) and A2A support this shape, but the rules are protocol-independent: idempotent start, a durable record of the handle, authorization bound to it, and no worker held while waiting.
    Premium
  5. 05

    Gateways and Registries

    Organisations that connect agents to dozens or hundreds of tool servers converge on two components. A registry records each server and tool: owner, purpose, data classification, approved version and a fingerprint of its descriptions and schemas, so changes are reviewed rather than silently picked up. A gateway sits between agents and servers: it authenticates callers, exchanges tokens per backend, exposes to each agent only the tools its role and task allow, enforces policy on calls and arguments, applies rate limits and records an audit trail. Together they turn a sprawl of integrations into a governed catalogue.
    Premium
  6. 06

    MCP Without Sessions: The 2026 Stateless Core

    MCP revision 2026-07-28 is the largest since launch and is breaking. The initialize handshake and session id are gone: each request carries its protocol version and client capabilities in _meta, and servers answer server/discover. Instead of calling back for sampling or user input, a server returns input_required with its questions and the client repeats the request with the answers. Tasks became an opt-in extension, list results carry cache lifetimes, and roots, sampling, logging and HTTP+SSE are deprecated with a year's notice. The protocol now load-balances like ordinary HTTP.
    Premium
  7. 07

    Streaming a Run to the User with AG-UI

    AG-UI, the Agent-User Interaction Protocol, was created by CopilotKit and is MIT licensed; 1.0 is a frozen specification backed by JSON Schema. A client sends one RunAgentInput (thread, run, messages, front-end tools, context, state) and receives an ordered stream of typed events: run lifecycle, text and tool-call chunks, state snapshots and JSON Patch deltas, reasoning, activity, subagents and custom events. Front-end tools are executed by the application, and a run can end in an interrupt that the next run resumes.
    Free
  8. 08

    Generative UI with A2UI and MCP Apps

    Generative UI lets an agent compose interface elements at run time without executing model output in your page. A2UI (Google, Apache-2.0, 1.0 in November 2026) is declarative data: the agent sends createSurface, updateComponents and updateDataModel messages, components form a flat list bound to a data model by JSON Pointer, and the client renders only components from a catalog it registered. MCP Apps, an official MCP extension, instead points a tool at a ui:// HTML template that the host renders in a sandboxed iframe and talks to over postMessage.
    Premium
  9. 09

    The Agent Protocol Map

    By late 2026 agent systems had a protocol for nearly every edge. MCP connects an agent to tools and data. A2A delegates tasks to independent agents. AG-UI streams a run to a user interface, and A2UI or MCP Apps describe the interface itself. AP2 carries signed proof of what a user authorised an agent to buy, inside commerce protocols such as UCP and ACP, while x402 lets an agent pay per HTTP request. Several now sit under the Linux Foundation's Agentic AI Foundation. Each standardises an envelope; authorization, trust and verification remain design work.
    Free
  10. 10

    The MCP Authorization Flow, Step by Step

    Remote MCP servers use OAuth. A request without a valid token gets 401 with a WWW-Authenticate header naming the server's protected resource metadata (RFC 9728), which lists its authorization servers. The client reads their metadata, registers (Client ID Metadata Documents preferred, Dynamic Client Registration deprecated in the 2026-07-28 revision), runs an authorization code flow with PKCE and the resource parameter (RFC 8707), checks the issuer (RFC 9207), and sends the token on every request. Servers check audience, never pass tokens through, and answer missing scope with 403 insufficient_scope.
    Premium
  11. 11

    MCP from the Wire Up: JSON-RPC, stdio and the Three Primitives

    Beneath every MCP SDK is a small protocol: JSON-RPC 2.0 messages (requests with ids, notifications without, results and errors) carried over a transport, which for local servers is a child process whose stdin and stdout carry one message per line. The server exposes three primitives that differ by who controls them: tools the model calls, resources the application attaches, prompts the user picks. A tool call has two kinds of failure that travel differently: a protocol error (the request could not be processed) is a JSON-RPC error, while a tool error (the tool ran and failed) is a normal result flagged isError that the model reads as an observation. Building a minimal server and client by hand makes the framing bugs (a stray print on stdout), the version negotiation (the 2026-07-28 revision replaced the initialize handshake with per-request metadata and server/discover) and the pagination of tool lists concrete, and makes every SDK readable afterwards.
    Premium
  12. 12

    Composing Many MCP Servers in One Host

    A host that connects to several MCP servers needs a layer between its agent loop and its clients, usually called a hub or aggregator. It owns one client per server and presents one tool list, and it solves four problems that appear only in composition. Name collisions: two servers each offer search, so the hub namespaces tools as server and tool and maps the model's choice back. Surface size: the union of every server's tools is more than the model can choose among well, so the hub shows a projection per task or a search step over the catalogue. Latency: calls to different servers in one turn run concurrently with a timeout per server, so one slow server cannot hold the turn. Failure isolation: a crashed or hanging server is contained to its own calls, restarted within a budget, and reported, while the other servers keep working. Each of these is host code, and each is measured: collisions caught at connect time, selection accuracy on a labelled set, turn latency against the slowest server, and the restart budget's exhaustion rate.
    Premium
Topic 12 / 8 concepts

Coding & Computer Use

Give an agent the right slice of a large codebase or a live interface, apply changes that survive, and verify them with something other than the agent's word.
  1. 01

    Repository Context

    Coding agents work in repositories far larger than any context window, so the core problem is finding the few files that matter. Good agents combine a compact repository map of files and symbols, exact search for names and strings, structural navigation to definitions and references, the repository's instruction files, and the build and test layout, with semantic search as a complement for vague questions. They read slices, keep findings in notes, and stop exploring when they can name the files to change.
    Free
  2. 02

    Applying Edits

    Coding agents must turn an intended change into an exact file modification. Whole-file rewrites always apply but are costly and can disturb unrelated lines; unified diffs are compact but fragile on line numbers; search-and-replace blocks quote exact text and apply reliably when it is unique. Published comparisons (Aider, from 2023) show format choice changes success rates and varies by model. Strict application with precise errors, and small edits, matter as much as the format.
  3. 03

    Verification Loops

    A coding agent's main external signal is its tools: formatters, compilers and type checkers, linters, and tests. A good verification loop runs checks in order of cost and relevance (the changed files' type check and their tests before the whole suite), condenses raw output into the few lines that matter (file, line, error, expected versus actual), feeds that back as an observation, and has rules for when to stop: the same error after a fix attempt, failures unrelated to the change, or a budget reached. Flaky tests and slow builds are handled explicitly rather than retried blindly.
    Premium
  4. 04

    Reward Hacking in Coding Agents

    Reward hacking is an agent satisfying the measure instead of the goal. In coding it shows up as weakened or deleted assertions, skipped tests, special-cased inputs, swallowed exceptions, edited checkers and unverified claims of success, and evaluators reported it in frontier models in 2025. The defences are structural: read-only tests and checkers, diff analysis for tell-tale patterns, held-out and mutation tests the agent cannot see, and results recorded by the harness rather than claimed by the agent.
    Premium
  5. 05

    Grounding Computer-Use Agents

    Computer-use and browser agents act through clicks and keystrokes, so every action depends on grounding: mapping an intended target to one element on a changing screen. Screenshots show what a person sees but leave coordinates to estimation; accessibility trees and the DOM give roles, names and states but can be incomplete. Reliable agents combine them, target stable identifiers, re-resolve the target just before acting, verify the change afterwards and confirm irreversible actions.
    Premium
  6. 06

    Browser Agents: Sessions, Boundaries and Irreversible Clicks

    Browser agents act through a real browser using the page's structure, screenshots or both. The design decisions are mostly about the session: an isolated, fresh browser has no cookies and limits damage; the user's logged-in browser gives the agent the user's whole web authority, including email, banking and admin consoles. Around the session sit egress rules (which sites and which internal addresses are reachable), confirmation before irreversible actions bound to what the page shows, verification of the resulting page state after each step, and treating page content as untrusted input.
    Premium
  7. 07

    Terminal Agents: One Shell, Many Commands

    A terminal tool gives a coding agent a shell it can type into across many turns. Running each command in a fresh process loses state the agent relies on (the working directory, an activated environment, exported variables), so the useful design is one persistent shell process with a protocol for finding where each command's output ends: an end marker printed after every command carries the exit code. Around that sit the controls. Every command string is split into its component commands and each is checked against policy before any runs, because one line can hide several commands. The environment is non-interactive so that pagers, editors and prompts cannot block. Output is stripped of terminal control codes and capped with a note of what was cut. A command that exceeds its timeout kills the shell, and the restart tells the model which state (directory, variables, background jobs) was lost rather than silently starting fresh. The sandbox remains the boundary; the shell tool is a convenience inside it.
    Premium
  8. 08

    Building a Ranked Repository Map Under a Token Budget

    The repository-context lesson showed the idea of a map: files and their symbols, a few hundred tokens that tell an agent where things are. This lesson builds the version that works on a large repository. Definitions and references are parsed from source into a graph in which a file earns rank from the files that use what it defines. A personalised random walk, seeded by the files and symbols the task mentions, turns that graph into an ordering that is specific to the task rather than a fixed list of the most central files. The map is then filled to a token budget in rank order, whole entries at a time, with a cap on what any one file may contribute so that generated code and test files do not crowd out the rest. Parsing is cached per file by content hash so that one edit re-parses one file, and the map is kept byte-stable across the turns of a run so it remains part of the cached prefix rather than a fresh cost on every call.
    Premium
Topic 13 / 7 concepts

Guardrails & Policy

Draw the line between what the model may propose and what the system will execute, then enforce it in code the model cannot argue with.
  1. 01

    Guardrails in Layers

    Agent guardrails work in layers. Input handling labels untrusted content; tool exposure limits what a task can call; the tool boundary validates and authorizes each call in code; output and egress controls stop sensitive data leaving; approval covers consequential actions; monitoring catches what got through. Prompt instructions help the model behave but are not controls, because a model can be wrong or steered. Structural rules, such as never combining untrusted input, sensitive data and external action without a person, follow from this.
    Free
  2. 02

    Delegated Identity for Agents

    When an agent acts for a user, three sets of permissions meet: the user's, the agent's role, and the task's needs. The agent's effective rights should be their intersection, issued as short-lived delegated credentials that name both the user (subject) and the agent (actor). Using the user's full credentials gives the agent everything the user can do; using a broad service account gives it more. Delegation with attenuation keeps the agent's reach small, makes actions attributable, and lets delegation be revoked without touching the user's own access.
  3. 03

    Policy Decision Points

    As agents gain tools, rules about what they may do multiply: limits, ownership, time windows, approval thresholds. In prompts they are unenforceable; scattered through tool handlers they disagree. The standard architecture separates a policy decision point, an engine evaluating rules against the request and its context, from enforcement points that ask and obey. Rules are code, versioned and tested with case tables, rolled out in shadow mode, and every decision is logged with its inputs and deciding rule.
    Premium
  4. 04

    Approvals People Read

    Human approval is the last control before many consequential agent actions, and it decays into a rubber stamp when people are asked too often, about too little, with too little information. Good approval design routes only risky actions to people (by amount, irreversibility, novelty or policy), presents each as a concrete action with its impact, evidence and anomalies highlighted, binds the decision to that exact action, and requires more from approvers as risk rises. Its quality is measured directly, for example with seeded items that should be rejected, as well as by approval rates and time to decide.
    Premium
  5. 05

    Exfiltration Paths

    Data leaves an agent system through any channel that reaches outside, not only tools named 'send': URLs in output that a client fetches automatically, arguments to external tools such as search, files in shared places, memory read in another scope, logs and analytics, and sandbox networking. The builder's defence is an inventory of these paths with a control on each: rendering rules, egress allowlists, checks on outbound arguments, scoped storage and memory, redacted telemetry, and stricter rules after untrusted input.
    Premium
  6. 06

    Workload Identity, Token Exchange and Proof of Possession for Agents

    Agent identity rests on standards that predate agents. SPIFFE issues workloads short-lived verifiable identity documents, so a service knows which code is calling. OAuth 2.0 Token Exchange (RFC 8693) lets each hop swap the token it received for a narrower one with a new audience, and its act claim records the chain of actors. DPoP (RFC 9449) binds an access token to a key and proves possession per request, so a token copied from logs or a sandbox cannot be replayed. MCP's enterprise-managed authorization extension uses an identity assertion JWT grant so the enterprise identity provider governs which agents reach which servers.
    Premium
  7. 07

    Audit Logs for Agent Actions

    A trace and an audit log record overlapping events for different readers. The trace is for engineers: every span, full content where permitted, mutable storage, retention measured in weeks. The audit log is for investigators, auditors and regulators: one append-only record per security-relevant event (an action proposed, a policy decision, an approval, a side effect, a credential use), each carrying who acted, under whose delegated authority, which policy version decided, and a causal link to the event that led to it. Tamper evidence comes from a hash chain with each entry committing to the previous one, a keyed signature over each entry, and periodic anchoring of the chain head somewhere the operators cannot rewrite. Content is minimised: hashes and identifiers of arguments and results, never raw customer data or secrets, so the log can be retained for years and shown to a third party. The log is written by the harness at the policy and tool boundaries, never by the model.
    Premium
Topic 14 / 8 concepts

Agentic System Design

Put every earlier track to work in one design: autonomy, state, tools, budgets, failure, hostile input and measurement.
  1. 01

    The Agentic Design Method

    Agent system design interviews reward a method more than a favourite architecture. Start with the outcome and what a wrong action costs; decide step by step where a model adds value and where code or a person should decide; design tools around decisions and draw the authority line with identity, policy and approvals; plan context and memory; make long or risky work durable; define how quality is measured before launch and watched after; estimate volume, latency and cost; and plan a staged rollout. Each step yields an artefact, a table, a diagram or a number, that makes the design concrete.
    Free
  2. 02

    Autonomy Levels

    Agents can operate at several levels of autonomy: suggesting while a person acts, acting with approval for each action, acting alone within limits with people reviewing after, and acting fully alone. The right level differs by action within one agent, depending on the cost and reversibility of mistakes and on measured reliability for that action. Mature designs treat autonomy as configuration, promote an action to a higher level only when its measured error rate, with an interval, is below an agreed bar, and demote automatically when monitoring shows the rate rising or the context changing.
  3. 03

    Designing for Failure

    A production agent design is judged by what happens when parts fail. Build a failure-mode table per component (model, tools, context, state, people, cost) scored by severity, likelihood and detectability to rank where to invest. Then choose responses: fail safe for consequential actions, degrade gracefully for availability, contain spread with caps and isolation, recover with idempotency and compensation, and detect with alerts. Fault injection turns the table into tested behaviour.
    Premium
  4. 04

    The Agent Control Plane: Registry, Autonomy Tiers and a Real Kill Switch

    An agent control plane makes a fleet governable. A registry entry per agent version records owner, purpose, environment, model and harness version, tools and data it can reach, autonomy tier, evaluation evidence and on-call contact; agents not in the registry are found by inventorying credentials, schedules and traffic. Autonomy tiers tie what an agent may do alone to measured evidence. A kill switch that works operates outside the agent's own code: revoke or suspend its credentials, disable its tools at the gateway, pause its queues and schedules, and block its egress, each tested in drills, because an agent asked to stop itself may not.
    Premium
  5. 05

    Real-Time Voice Agents: Turn-Taking, Barge-In and the Latency Budget

    Voice agents are built either as a cascade (speech recognition, a text model, speech synthesis) or as one speech-to-speech model. The cascade gives text at every step to check and log; speech-to-speech is faster and keeps tone. Either way, turn detection decides when the caller has finished (silence-based or semantic), barge-in stops playback and cancels the response, and the history must be cut back to what the caller heard. Latency is budgeted per stage and hidden with streaming, fillers and prefetching.
    Premium
  6. 06

    Sizing an Agent System: Tokens, Concurrency and Cost on One Page

    An agent system can be sized from a few assumptions. Input tokens per task are the stable prefix times the steps plus a history term that grows with the square of the steps. Peak arrival rate times run duration gives concurrent runs (Little's law), which sizes workers, sandboxes and connections. Peak rate times tokens per task gives tokens per minute to compare with rate limits. Cost per successful task divides cost by the success rate. Long runs dominate, so size with the distribution of steps, not the average.
    Premium
  7. 07

    Incident Playbooks for Agents

    An agent incident is a service incident plus three things: the failing component is probabilistic, the system can take actions in the world, and cost accrues per step. Five incident shapes recur and each gets a playbook: a runaway loop or fleet (spend rising, no errors), a wrong side effect (an action that should not have happened), a provider outage or throttling, a quality regression with no deploy, and a steering incident where an input moved the agent. Every playbook has the same skeleton: a detection signal that fires before a person does, the first query to run against traces and the audit log, the stop that contains it (kill switch, pause, circuit breaker), the reconciliation of any side effects, the communication, and the follow-up that turns the incident into an eval task and a guard. The playbooks are rehearsed against injected failures, because the first time a team runs one should not be the real one.
    Premium
  8. 08

    Showing the Work: Step Views, Approvals and Undo

    The interface of an agent is where three controls meet the person: visibility, consent and reversal. Visibility means a step view built from the loop's own events (step started, tool requested with its arguments, result, approval needed, final, stopped with reason), rendered live and kept as a record, so the person can see what was done rather than a summary of it. Consent means approvals that show the action, its arguments and what decides it, scaled to risk so people are asked rarely and read what they are asked. Reversal means an undo path designed from the side effect: a compensating action for what can be reversed, a hold window before what cannot, and a plain statement when nothing can be undone. Trust comes from these three being accurate, not from reassurance: a step view that hides a failed call, an approval that omits the amount, or an undo that does not actually reverse the effect teaches the person to stop reading. Chat is one surface for all of this; background and voice agents need the same three controls on different surfaces.
    Premium
Topic 15 / 3 concepts

Build-an-Agent Rounds

Practise the live build: write the harness under time pressure and explain every line of what you or your AI tool produced.
  1. 01

    What the Live Build Round Tests

    Practical rounds for agent engineering roles typically ask for a small, complete piece in 45 to 60 minutes: a tool-calling loop with validation and a step budget, a dispatcher, retries, a loop detector, compaction or an idempotent wrapper. Interviewers look for a working skeleton early, controls before extras, deliberate failure paths, tests against a scripted fake model, clear structure and narrated trade-offs. Practising the skeleton until it is routine frees time for the part actually being tested.
    Free
  2. 02

    Testing Agents with a Scripted Model

    Most agent bugs live in the harness: dispatch, validation, budgets, retries, state, stop conditions. They can be tested deterministically by replacing the model with a scripted fake that returns a fixed sequence of replies, and replacing tools with fakes that can be made to fail. Tests then assert on behaviour (which tools ran with which arguments, what was refused, how the loop ended, what state persisted) rather than on model text. Scripted tests complement, not replace, evaluations with real models; they make the controls trustworthy so evaluations measure the model's judgement.
  3. 03

    AI-Assisted Build Rounds

    Some companies now run practical rounds where candidates may use AI coding assistants, because that reflects the job. The assessment shifts from typing speed to judgement: decomposing the task, writing precise instructions, reading generated code critically, testing it, catching wrong assumptions, and keeping the design coherent. Strong candidates use the assistant for well-specified pieces, review every diff before accepting it, run tests constantly, narrate what they check and why, and take over when the assistant drifts. Weak candidates accept large generated blocks they cannot explain.
    Premium
Topic 16 / 5 concepts

Agent Payments

Let an agent spend money only within what a person signed: mandates, checkout tokens, pay-per-request and receipts that settle a dispute.
  1. 01

    Why Agent Payments Need Their Own Protocols

    Payment systems infer consent from presence: a person typed the card, passed a one-time code, pressed pay. An agent acting alone breaks that inference. Agent payments therefore need authority (signed, limited proof of what the user approved), authenticity (a verifiable way to tell a legitimate agent from a bot) and accountability (a record that settles who is liable when something goes wrong). In 2026 these map onto AP2 mandates, agent identification such as Visa's Trusted Agent Protocol, checkout protocols such as UCP and ACP, and x402 for per-request payment.
    Free
  2. 02

    AP2 Mandates: Signed Proof of What the User Approved

    The Agent Payments Protocol (AP2) was announced by Google in September 2025; version 0.2 was released and the protocol donated to the FIDO Alliance in April 2026. It defines two mandates, Checkout and Payment, each in an open stage (constraints the user signs) and a closed stage (the exact transaction). Mandates are SD-JWTs. When the user is not present, the open mandate carries the agent's public key, and the agent signs the closed mandate with it. The merchant returns a signed checkout whose hash is bound into the payment mandate. Roles: shopping agent, credential provider, merchant, merchant payment processor and trusted surface.
  3. 03

    Agentic Checkout with UCP and ACP

    Two checkout protocols emerged for agents. The Agentic Commerce Protocol (ACP), developed by Stripe and OpenAI under Apache-2.0, defines checkout sessions an agent creates, updates, completes or cancels, and a delegated payment call that turns the user's card into a token with an allowance: maximum amount, currency, checkout session, merchant and expiry, for one use. The Universal Commerce Protocol (UCP), co-developed by Google with retailers and platforms, covers catalog, cart, checkout, identity linking and orders over REST or JSON-RPC, with AP2 support. The design idea in both: the agent never holds a reusable credential.
    Premium
  4. 04

    Paying per Request: x402 and the Machine Payments Protocol

    x402 and MPP make payment part of an HTTP exchange. In x402 (from Coinbase, now the x402 Foundation) a server replies 402 with a PAYMENT-REQUIRED header, the client retries with PAYMENT-SIGNATURE, and the server settles, often via a facilitator. MPP (Tempo and Stripe, March 2026) frames payment as an HTTP authentication scheme: a WWW-Authenticate Payment challenge, an Authorization credential, a Payment-Receipt, and charge, session and subscription intents across stablecoins and cards. Either way any server can ask the agent for money, so spending policy belongs in the client.
    Premium
  5. 05

    Proving a Request Comes from an Agent

    A merchant facing agent traffic must tell a legitimate agent acting for a real customer from a scraper or fraud bot. The emerging answer signs HTTP requests with RFC 9421 HTTP Message Signatures: the agent covers the method, authority, path and chosen headers plus created, expires, nonce and key id, and sends Signature-Input and Signature headers. The merchant verifies against the agent's published key and rejects stale or replayed requests. Visa's Trusted Agent Protocol builds on this RFC. Identification says which agent; a mandate says what the user approved.
    Premium
Topic 17 / 7 concepts

Agent Frameworks

Read any framework by the same six questions, then learn what ADK, LangGraph, Microsoft Agent Framework, CrewAI and the agent SDKs each decide for you.
  1. 01

    Reading Any Agent Framework

    Frameworks such as Google ADK, LangGraph, Microsoft Agent Framework, CrewAI and the OpenAI and Claude agent SDKs differ in vocabulary but wrap the same mechanism. Reading one well means asking six questions: who drives control flow (the model, a graph you declare, or both); where state lives and how it is persisted; how a run pauses for a person and resumes after a restart; how work moves between agents (handoff or agent as tool); how tools, MCP and A2A plug in; and what traces and evaluations it gives you. The answers predict where a framework will help and where it will surprise you in production.
    Free
  2. 02

    LangChain and LangGraph

    LangChain and LangGraph reached 1.0 in October 2025 (MIT). LangChain's create_agent builds a model-calling-tools loop with middleware: hooks before and after the agent and model, and wrappers around model and tool calls. LangGraph is the runtime for long-running, stateful agents: a StateGraph of nodes and edges over typed state with reducers, compiled with a checkpointer so each thread can resume. interrupt() pauses a node and Command(resume=...) continues it, re-running that node from its start. Deep Agents packages a harness on top.
    Free
  3. 03

    Google Agent Development Kit (ADK)

    Google's Agent Development Kit (Apache-2.0; 2.15.0 in November 2026) runs agents through a Runner that loads a Session from a session service. Session state is scoped by key prefix: none for the session, user: across a user's sessions, app: across the app, temp: for one invocation. Callbacks wrap agent, model and tool calls. ADK 2.0 adds graph workflows of agent and function nodes with routers and RequestInput for human input, and tools can require confirmation. It supports MCP and A2A.
  4. 04

    Microsoft Agent Framework, and What Became of Semantic Kernel and AutoGen

    Microsoft Agent Framework (MIT; 1.0 in April 2026) is the direct successor to Semantic Kernel and AutoGen, built by the same teams, with migration guides from both. Agents have sessions, context providers and middleware. Workflows connect executors with edges built by WorkflowBuilder; executors receive typed messages, send them on, yield outputs and can request information from a person. Builders cover sequential, concurrent and Magentic orchestration, and a workflow can be exposed as an agent. Python, .NET and a Go preview.
    Premium
  5. 05

    CrewAI: Crews and Flows

    CrewAI (crewai on PyPI, MIT; 1.15.44 in November 2026) models agents with a role, goal and backstory, and tasks with a description, expected output, assigned agent, context from earlier tasks, tools, guardrails and structured output. A Crew runs tasks with a sequential or hierarchical process, where a manager assigns work. Flows are event-driven workflows: methods decorated with start, listen and router, combined with or_ and and_, sharing unstructured or Pydantic-typed state. The persist decorator saves flow state (SQLite by default), a flow can resume by id or fork from a saved state, and tasks or flow steps can ask a person for feedback.
    Premium
  6. 06

    The OpenAI Agents SDK and the Claude Agent SDK

    The OpenAI Agents SDK (MIT) offers Agent, Runner, handoffs with input filters, agents as tools, guardrails that trip a run, sessions, tracing, and approvals: tools marked needs_approval interrupt the run, which is saved as RunState, approved or rejected, and resumed. The Claude Agent SDK (MIT, Python and TypeScript) runs the Claude Code harness as a library, with built-in file and shell tools, permission modes, a can_use_tool callback, hooks such as PreToolUse that allow, deny, ask or defer, subagents, skills, MCP and forkable sessions.
    Premium
  7. 07

    Choosing an Agent Framework, or None

    Agent frameworks converge on features (tools, MCP, multi-agent, human-in-the-loop, tracing) and differ in behaviour under failure: what is persisted and when, what re-runs on resume, what history crosses a handoff, how errors reach the model, and how quickly APIs change. A sound choice starts from the system's hard requirements, writes a small conformance suite of failure scenarios, runs it against a framework-free baseline and two or three candidates, and weighs the results against version churn and lock-in. A framework earns its place when it removes code you would otherwise maintain without hiding a behaviour you need to control.
    Premium
Topic 18 / 5 concepts

Agent Harnesses

Look inside the runtime that wraps the model: plugins, session logs, permissions and subagents, and how a harness gets better without touching the weights.
  1. 01

    Anatomy of an Agent Harness

    An agent harness is the complete runtime around a model: the loop that calls it, tools for files, shells and search, a permission layer that decides which calls run, an append-only session log from which every model request can be rebuilt, context management that clears and compacts history, subagents for isolated work, skills that package procedures, hooks at fixed events, and a sandbox. Coding agents made harnesses visible, and 2026 brought open harnesses such as DeepSeek Harness and research such as Google's Harness², which improves agents by editing the harness rather than the model.
    Free
  2. 02

    DeepSeek Harness and the Everything-Is-a-Plugin Design

    DeepSeek Harness, run as dsh, is an MIT-licensed developer preview built on the Cordis plugin framework. Its architecture has no privileged core: the model adapter, tool registry, session log and agent loop are all plugins, grouped into profiles such as web, headless, sdk and acp. A step is one model request plus the tools it calls; a turn is zero or more steps, announced by events from turn start to turn end. The session is an append-only event log, versioned on disk, and every model request must be reconstructable from it.
  3. 03

    Improving the Harness, Not the Model: Harness²

    Harness² (arXiv 2610.14224, October 2026; Google Cloud AI Research with Northwestern University; Apache-2.0 code, not an officially supported Google product) treats an agent's harness as eight editable components while the model stays frozen. For each task it runs the current harness, proposes a general and a domain-specific candidate, runs both, contrasts trajectories and outputs, and composes the supported edits. A library of harnesses and lessons carries improvements forward. With frozen executors it reported gains such as 64.2 to 75.7 on one benchmark, and it lists limits: run-to-run randomness, shared model biases and extra cost.
    Premium
  4. 04

    AGENTS.md and Agent Skills

    Two open formats shape what an agent knows before it acts. AGENTS.md, stewarded by the Agentic AI Foundation and read by many coding agents, is ordinary Markdown with build commands, conventions and boundaries; nested files apply to their subtree and the closest one wins. Agent Skills, developed by Anthropic and released as an open standard, are folders with a SKILL.md (required name and description, optional license, compatibility, metadata and allowed tools) plus scripts, references and assets. Progressive disclosure loads metadata first, the body on activation and files on demand. Both are context, not authority.
    Free
  5. 05

    How a Harness Decides What Runs: Permission Rules, Modes and Hooks

    A harness turns each proposed tool call into allow, ask or deny. Hooks can rule first; rules are then checked deny before ask before allow, so a broad deny beats a narrow allow; a compound shell command runs only if every part is allowed; the mode supplies the default when no rule matches; and with nobody to ask, ask becomes deny. Hooks also rewrite input, add context, check results and can refuse to let a turn end. Rules and hooks are policy and feedback, not a boundary: the same effect has many spellings.
    Premium
Topic 19 / 4 concepts

Agent Optimisation

Pull the cheap levers before the expensive ones: steps, context, tools, caching and routing, then prompt optimisation, then training on rewards you can verify.
  1. 01

    Optimise an Agent in the Right Order

    Agent optimisation has an order. The cheapest, most reliable wins come from the harness: removing unnecessary steps, shrinking context, improving tool descriptions and results, caching stable prefixes and routing easy steps to cheaper models. Prompt optimisation with a metric and a training set comes next. Fine-tuning and reinforcement learning on verifiable rewards change the model itself and pay off only when the task is stable, the evaluation is trustworthy and the cheaper levers are exhausted.
    Free
  2. 02

    Prompt Optimisation with a Metric: DSPy, GEPA and MIPROv2

    Prompt optimisation treats instructions and few-shot examples as parameters to search against a metric. In DSPy you give a program, a scoring function and training examples. MIPROv2 bootstraps candidate demonstrations, proposes instructions with a model and searches combinations with Bayesian optimisation. GEPA (2025, an ICLR 2026 oral) reflects on execution traces and textual feedback from the metric to evolve prompts, keeping a Pareto set of candidates that do best on different validation examples.
  3. 03

    Reinforcement Learning with Verifiable Rewards for Agents

    RLVR, named in the Tulu 3 work (2024), replaces a learned reward model with a program that checks the outcome: unit tests, an exact answer, an end-state comparison. GRPO, introduced in DeepSeekMath (2024) as a variant of PPO, samples several attempts per task, scores them, and uses each attempt's reward relative to its group as the advantage, without a separate value model. For agents the trajectory spans many tool calls, so the reward is usually the final verified outcome.
    Premium
  4. 04

    Distilling Routers and Small Models from Agent Traces

    Agent traces from a capable model are a by-product worth keeping. They can train a router that sends each step to a small or large model, or fine-tune a small model to imitate the large one on a narrow step such as classification, extraction or tool selection. The router's threshold is chosen on held-out data to meet a quality target, not to maximise savings; uncertain cases escalate to the large model.
    Premium