Homework — Reflection on the Agent Loop
Lesson 01 · Homework · ~30 min · no code, pen and paper or a text file
L01 is theory-only — there is no Python homework yet. The three tasks below are reflection prompts. The point is to surface your intuitions about agents before L02 forces them into code. Write your answers in your own words first, then open the solutions page for the reference answers and the why-this-not-that commentary.
How to do this homework
Each task takes roughly 10 minutes. There is no auto-grader and no "correct" answer for Task 3 — what matters is having explicit, defensible numbers and explicit escape hatches. Don't peek at the solutions until you've written something down for all three tasks. The solutions are commentary, not an answer key.
Task 1 — Classify three real systems
Task 1: agent / pipeline / chatbot?
For each of the three short scenarios below, do all three of the following:
- Classify it as an agent, a pipeline, or a chatbot. Use the working definitions from L01 theory section 1.
- Name which stop conditions matter for it (natural exit, turn cap, cost cap, user interrupt). Some scenarios won't need all four; some won't need any.
- List the tools the agent (if any) would need to do its job.
Be concrete — tool names like
search,fetch_url, etc.
The three scenarios:
- (a) GitHub Copilot's chat panel. You ask it a question in the side panel; it answers in one shot. No tool calls, no looping, no follow-up. Just one model call, one response, and the conversation moves on.
- (b) A research assistant that takes a prompt like "summarise the state of post-quantum cryptography", searches the web, opens the most relevant PDFs, reads them, decides on each step what to do next based on what it just read, and finally writes a summary. It can take 10–50 steps and may spend a few cents per run.
- (c) A document summarisation Lambda deployed to AWS that takes a PDF upload, runs OCR on it, sends the text to an LLM with a fixed prompt, gets back a summary, writes it to S3, and exits. The control flow is hard-coded in Python; the LLM never decides what to do next.
✓ Self-check: you've written down three classifications, three stop-condition lists, and three tool lists (one per scenario). One of the three has no tools because it isn't an agent.
Task 2 — Pick the planning style
Task 2: ReAct, Plan-and-Execute, or ReWOO?
L01 theory section 5 named three planning styles. For each of the three scenarios below, decide which style is the best fit and write one sentence explaining why. There is exactly one obvious answer per scenario.
- (a) A travel planner that asks the user 3–4 clarifying questions (when, where, budget, dietary restrictions), then books flights, a hotel, and dinner reservations. Once the questions are answered, all three bookings can be carried out without further user input.
- (b) A debugging assistant that you point at a stack trace. It looks at the top frame, decides what variable to inspect, inspects it, looks at the result, decides what to inspect next, and so on, until it identifies the bug. Every step depends on what the previous step revealed.
- (c) A code-modernisation bot that scans a 200-file repo, identifies the 12 files that use a deprecated API, and runs the same refactor recipe on each. The 12 refactors are independent of each other.
✓ Self-check: you've written three (style, justification) pairs. The justifications should reference whether the work can be planned upfront, whether steps are independent, and whether each step needs the previous step's observation.
Task 3 — Design a stop-condition budget
Task 3: budget a triage agent
You're the engineer responsible for shipping a customer-support triage agent to production. Its job is to read an incoming ticket, classify it (billing / technical / account / sales), pull up the customer's recent history with three tool calls (account lookup, recent tickets, recent orders), and either resolve the ticket or hand it off to a human with a one-paragraph summary. It runs once per incoming ticket.
Write down, with brief justification (one sentence each):
- (a) A reasonable turn cap. How many LLM iterations is the agent allowed before the runtime kills it? Be specific (a number) and justify it.
- (b) A reasonable cost cap, in US dollars per ticket. Above this spend, the runtime kills the agent. Pick a number you'd actually defend to a CFO.
- (c) Three escape hatches the agent must surface when it can't make progress — i.e. three specific messages the agent should be able to emit that tell the runtime "I'm stuck, hand off to a human."
There is no single correct answer to this task — reasonable engineers will pick different numbers. The discipline being tested is having explicit numbers and having explicit escape hatches, not picking the same ones the solutions page picked.
✓ Self-check: you've written down a turn-cap number, a dollar amount, and three concrete escape-hatch messages. None of your three escape hatches are "the agent crashes" or "the runtime times out" — those are failure modes, not escape hatches.
What you should leave with
Three pages of notes (or three paragraphs in a text file). For Tasks 1 and 2 your answers should converge with the solutions page; for Task 3 they will differ — that's expected. When you open the solutions, focus less on whether your numbers match and more on whether your reasoning matches the structure of the reference reasoning.
Once you've written your own answers, head to the solutions page and compare.