Agent Builder Quest: 10 missions to master AI agent design
Ten gamified missions, one agent design pattern each: from a single tool-calling agent to an evaluated, observable production agent. Earn XP, climb the ranks.
by Patrick Kamtchueng Kom · Published
Every good agent is a pattern you picked on purpose. This quest gives you ten of them, one small real project each, from a single tool call to a fully observable production agent.
Missions unlock in order. Tick one off, earn XP, climb a rank; your progress stays in this browser.
🏆 Agent Builder Quest
Prompt Apprentice
0 / 1650 XP
Mission 1 · Pattern: Single tool-calling agent · +50 XP
🕒 Meeting-time finder
A chat agent that finds a meeting slot for people in different cities using three tiny tools. You learn the core loop: the model picks a tool, your code runs it, the result goes back until the model answers.
Tool schemasThe agent loopStop conditions
What you build
- Write three pure functions: city_to_timezone(city), convert_time(time, from_tz, to_tz), working_hours_overlap(zones).
- Describe each one as a tool with a clear name, description and typed parameters.
- Run the loop: send messages plus tools, execute any tool call, append the result, repeat.
- Stop on a final text answer or after a max of 6 steps, whichever comes first.
- Print every tool call and result so you can read the trajectory.
👾 Boss level: Return tool errors as readable messages (unknown city, ambiguous name) and check that the model recovers by asking the user instead of guessing.
Starter prompt
Build a command-line meeting-time finder agent in [LANGUAGE] using [LLM PROVIDER WITH TOOL CALLING]. Tools: city_to_timezone(city), convert_time(time, from_tz, to_tz), working_hours_overlap(zones, start_hour, end_hour). Implement the agent loop by hand: call the model with the tools, run requested tools, append results, repeat until a final answer or [MAX STEPS] steps. Log each step. Tool errors must be returned to the model as clear messages, never thrown.
Mission 2 · Pattern: Router / classifier dispatch · +75 XP
🔀 Dev helper switchboard
One front door, four specialists: a regex helper, a cron expression builder, a SQL explainer and a git command helper. A cheap classifier routes each request to the right specialist prompt. You learn that routing beats one giant prompt.
ClassificationStructured outputFallback routes
What you build
- Write a small router prompt that returns JSON: route, confidence, short reason.
- Write four focused specialist prompts, each with its own examples and output format.
- Dispatch to the chosen specialist; if confidence is low, ask one clarifying question.
- Add an 'unsupported' route that politely declines anything off-topic.
- Build a test file of 30 labeled requests and measure routing accuracy.
👾 Boss level: Use a smaller, cheaper model for the router and a stronger one for specialists, then compare cost and accuracy against a single big-model prompt.
Starter prompt
Build a dev helper switchboard in [LANGUAGE] using [LLM PROVIDER]. A router call classifies each user request into one of: regex, cron, sql_explain, git, unsupported, returning JSON {route, confidence, reason}. Each route has its own specialist prompt with [N] examples. If confidence is below [THRESHOLD], ask one clarifying question. Include a labeled test set of [N] requests and a script that prints routing accuracy and a confusion table.Mission 3 · Pattern: Planner-executor · +100 XP
🧹 CSV cleanup crew
Give it a messy CSV and a goal like 'one row per customer, ISO dates'. A planner writes a step list; an executor runs each step with a small set of safe operations. You learn to separate thinking from doing, and when to re-plan.
Plan as dataConstrained operationsRe-planning
What you build
- Define a whitelist of operations: rename_column, drop_column, parse_dates, trim, dedupe, split_column.
- Have the planner output a JSON plan: ordered steps, each with an operation and arguments.
- Validate the plan against the whitelist before running anything.
- Execute step by step on a copy of the data, recording a before/after row count for each.
- If a step fails, send the error and current schema back to the planner for a revised plan (max 2 re-plans).
👾 Boss level: Show the plan to the user as a readable checklist and let them remove or reorder steps before execution.
Starter prompt
Build a planner-executor CSV cleanup tool in [LANGUAGE] using [LLM PROVIDER]. Input: a CSV file and a goal in plain language. The planner sees the column names and [N] sample rows and returns a JSON plan using only these operations: [OPERATION LIST]. Validate the plan, then execute it on a copy of the data, logging row counts per step. On failure, re-plan with the error message, at most [N] times. Write the cleaned file and a markdown report of what changed.
Mission 4 · Pattern: Reflection / self-critique loop · +125 XP
🪞 README critic
A writer drafts a README for a small project folder, a critic scores it against a rubric, and the writer revises until the score passes or rounds run out. You learn how to make a model check its own work without looping forever.
RubricsCritique promptsLoop budgets
What you build
- Write a 5-point rubric: install steps, usage example, config, limits, accuracy versus the code.
- Writer call: read the file tree and key files, draft the README.
- Critic call: score each rubric item 0–2 with a one-line justification, as JSON.
- Loop: revise using only the failing items, stop at a passing score or 3 rounds.
- Save every draft and score so you can see if revisions actually improved things.
👾 Boss level: Add a deterministic check (do the commands in the README exist in the project scripts?) and feed its result to the critic.
Starter prompt
Build a README writer with a reflection loop in [LANGUAGE] using [LLM PROVIDER]. Input: a project folder path. Step 1: a writer drafts README.md from the file tree and [KEY FILES]. Step 2: a critic scores the draft against this rubric [RUBRIC ITEMS], returning JSON with a score and reason per item. Step 3: the writer revises using only failing items. Stop when the total is at least [PASS SCORE] or after [MAX ROUNDS] rounds. Save each draft and score to an output folder.
Mission 5 · Pattern: Retrieval-augmented agent with citations · +150 XP
📚 Decision record oracle
An agent that answers 'why did we build it this way?' from your team's architecture decision records, citing the exact paragraph. A second pass verifies each citation really supports the claim. You learn that retrieval is only half the job; grounding is the other half.
ChunkingSearch as a toolCitation checksSaying 'not found'
What you build
- Split each decision record into paragraphs with stable IDs (file + heading + index).
- Expose search(query, k) as a tool so the agent can search several times with different wording.
- Require answers where every sentence ends with a citation ID.
- Run a verifier pass: for each claim plus cited paragraph, answer supported / not supported.
- Drop or flag unsupported claims, and answer 'not in the records' when nothing relevant is found.
👾 Boss level: Detect conflicts: when two records disagree (an older decision was superseded), make the agent say so and prefer the newer one.
Starter prompt
Build a retrieval-augmented agent in [LANGUAGE] over a folder of architecture decision records in [FORMAT]. Chunk by paragraph with stable IDs. Give the agent a search(query, k) tool backed by [SEARCH METHOD]. Every sentence of the answer must cite a chunk ID. Add a verifier call that checks each claim against its cited chunk and removes unsupported claims. If nothing relevant is found, reply that the records do not cover it. Include [N] test questions, some with no answer in the records.
Mission 6 · Pattern: Memory across sessions · +175 XP
🧠 Spaced-practice coach
A tutor that quizzes you on a topic you choose and remembers, from one session to the next, which concepts you keep missing. You learn to decide what to store, how to retrieve it, and when to let memories fade.
Memory schemaWrite and read policiesDecay
What you build
- Define a memory record per concept: name, last seen, times right, times wrong, a short note.
- After each answer, let the agent call update_memory with a structured change, not free text.
- At session start, load only the weakest and most overdue concepts into context.
- Give weaker concepts shorter review intervals and let mastered ones fade out of the rotation.
- Add a 'show what you remember about me' command and a 'forget' command.
👾 Boss level: Separate two memory types: facts about the learner (preferences, goals) and per-concept performance, each with its own write rules.
Starter prompt
Build a spaced-practice tutor agent in [LANGUAGE] using [LLM PROVIDER] and [STORAGE] for memory. Topic: [TOPIC]. Memory record per concept: {concept, last_seen, correct, wrong, note}. The agent quizzes the user, grades answers, and calls update_memory(concept, change) after each one. At session start, load the [N] weakest or most overdue concepts only. Add commands to view and delete memories. Persist between runs.Mission 7 · Pattern: Human-in-the-loop approvals · +200 XP
🧾 Cloud cost janitor
Point it at a mock inventory of cloud resources and it proposes cleanup actions: stop idle machines, delete old snapshots, shrink oversized disks. Safe actions run, risky ones wait for your approval. You learn risk tiers, approval gates and audit trails.
Risk tiersApproval gatesDry runsAudit log
What you build
- Create a JSON inventory of fake resources with owner, last used date, size and tags.
- Classify each tool by risk: read (auto), reversible change (auto with log), destructive (needs approval).
- For destructive actions, pause and show a dry-run diff with the agent's reason; the human approves, edits or rejects.
- Feed rejections back to the agent so it adjusts the rest of the plan.
- Append every proposal, decision and outcome to an audit log file.
👾 Boss level: Enforce the gate in code, not in the prompt: the delete tool refuses to run without a valid approval token, and write a test that proves it.
Starter prompt
Build a human-in-the-loop cleanup agent in [LANGUAGE] using [LLM PROVIDER]. Input: [INVENTORY FILE] describing mock cloud resources. Tools: list_resources(), stop_instance(id), delete_snapshot(id), resize_disk(id, size). Tag tools by risk tier. Destructive tools must pause, print a dry-run diff plus the agent's reason, and wait for approve / edit / reject. The approval check lives in the tool code, not the prompt. Write every step to an append-only audit log.
Mission 8 · Pattern: Multi-agent handoff (orchestrator + specialists) · +225 XP
🚀 Release-day crew
Describe a shipped feature and an orchestrator hands the work to specialists: release notes writer, docs updater, announcement drafter, QA checklist maker. You learn handoff contracts, shared state and how to keep specialists from stepping on each other.
Handoff contractsOrchestrationShared stateMerge step
What you build
- Define a handoff contract: task, inputs, expected output format, and what the specialist must not change.
- Give each specialist its own short prompt and only the tools it needs.
- Let the orchestrator decide which specialists to call and in what order, running independent ones in parallel.
- Collect outputs in a shared state object, then run a consistency check across them (same version, same feature name).
- Log each handoff with its inputs and outputs so you can replay one specialist alone.
👾 Boss level: Let a specialist hand back to the orchestrator with a question when inputs are missing, instead of inventing details.
Starter prompt
Build a multi-agent release assistant in [LANGUAGE] using [LLM PROVIDER]. Input: a feature description and [DIFF OR CHANGELOG]. An orchestrator dispatches to specialists: release_notes, docs_update, announcement, qa_checklist. Each handoff uses this contract: {task, inputs, output_format, constraints}. Specialists can return a question instead of an answer. Store results in a shared state object, run a consistency check across all outputs, and print a trace of every handoff.Mission 9 · Pattern: Agent exposed as a tool / server · +250 XP
🔌 Migration reviewer service
Wrap a database migration reviewer agent behind a tool server so other agents (and your coding agent) can call review_migration and get a structured verdict. You learn to design an agent's public interface: inputs, outputs, limits and errors.
Interface designTool protocolsTimeoutsVersioning
What you build
- Build the inner agent: it reads a SQL migration and flags locking risks, missing rollbacks and data loss.
- Define one tool with a strict input schema and a JSON verdict: risk level, findings, suggested fix.
- Serve it over a standard tool protocol (MCP or your own HTTP endpoint) with a timeout and step limit.
- Return errors as structured results the calling agent can reason about.
- Connect it to another agent and watch it use your reviewer as just another tool.
👾 Boss level: Version the tool contract, add a second tool (explain_finding), and keep the old version working for existing callers.
Starter prompt
Build a SQL migration reviewer agent in [LANGUAGE] and expose it as a tool server using [TOOL PROTOCOL OR HTTP FRAMEWORK]. Tool: review_migration(sql, dialect) returning JSON {risk: low|medium|high, findings: [{line, issue, fix}]}. The inner agent has read-only tools for [SCHEMA SOURCE]. Enforce a [N]-second timeout and [N]-step limit, return structured errors, and include a small client agent that calls the tool on [N] sample migrations.Mission 10 · Pattern: Evaluated & observable production agent · +300 XP
🛩️ Agent flight recorder
Boss mission: take one agent you built in this quest and make it production-grade. Every run is traced, a trajectory eval suite runs before every change, and regressions block the merge. You learn to prove an agent works, not just hope.
TracingTrajectory evalsRegression gatesCost tracking
What you build
- Trace every run: each model call, tool call, arguments, result, latency and token count, tied by a run ID.
- Build a replay command that re-runs a stored trace step by step.
- Write 25 eval cases checking both the final answer and the path: right tools, no forbidden calls, under N steps.
- Run each case several times and report pass rates, not single results.
- Add a CI job that compares against the last baseline and fails on regression, plus a small dashboard of cost and latency per run.
👾 Boss level: Turn every bad production trace into a new eval case with one command, so the suite grows from real failures.
Starter prompt
Add production observability and evals to my agent in [LANGUAGE] at [AGENT PATH]. 1) Trace every model call and tool call (inputs, outputs, latency, tokens) under a run ID, stored in [TRACE STORE]. 2) Add a replay command for a stored run. 3) Create an eval suite of [N] cases checking final output and trajectory (expected tools, forbidden tools, max steps), running each case [N] times. 4) Add a CI step that compares pass rates to a saved baseline and fails on regression. 5) Print cost and latency per run.
Patterns are tools, not trophies. Flip each card to see when it earns its place.
🃏 Pattern cheat sheet
Tap a card to flip it
Now your turn to pick. Start simple: reach for more structure only when the scenario asks for it.
🎮 Which pattern fits?
1 / 8 · Score: 0
Classify each scenario by the simplest pattern that handles it well.
Last checkpoint before you start Mission 1.
🧠 Agent design check
Score: 0 / 4
1. Your reflection loop keeps rewriting the same draft without improving it. What is the most likely fix?
2. Where should the 'needs approval' rule for a delete action live?
3. When is a multi-agent setup worth its extra complexity?
4. Why check the trajectory and not only the final answer in agent evals?