Workbook
What Is an AI Agent? Anatomy, Types & When to Build One: exercises
Applied exercises from this chapter. Write your own answer first, then open “Expert thinking” under each exercise to compare your reasoning.
Advanced Applied Exercises
Exercise 1: When an Agent's Ceiling Looks Like a Capability Problem
Scenario: You're the ML lead at a legal-tech startup. Six months ago you deployed an AI agent for contract review. The agent reads contracts (PDFs), flags risk clauses, suggests edits, and rates overall risk. It handles standard NDAs with 92% accuracy. Custom indemnification clauses and cross-border jurisdiction provisions are harder: 64% accuracy, 18% hallucination rate on specific clause references.
Your head of legal wants to extend the agent to M&A due diligence. "It's the same kind of document. We just need it to handle more clause types." Your CTO agrees and is pushing to expand scope. The agent's performance on M&A documents in a 50-document internal test: 58% accuracy.
You have two months before the next board meeting where the head of legal plans to demo the M&A capability to an acquirer's legal team.
What do you recommend, and how do you defend it?
Expert thinkingShowHide
The 58% accuracy on M&A documents and the 18% hallucination rate on custom clause references are disqualifying for this expansion, regardless of timeline pressure.
The right recommendation: Do not expand to M&A due diligence at the current quality level. Here's the defense:
Why the accuracy gap matters more than it looks: In contract review, a missed risk clause or a hallucinated clause reference isn't a recoverable error in the normal sense. An M&A deal where your agent falsely certifies a provision as standard (when it isn't) is a legal liability event, not a user experience problem. Blast radius is extremely high.
What the 58% accuracy means: If the head of legal's team reviews 50 M&A documents using this agent and trusts its outputs, roughly 21 will have meaningfully wrong assessments. In an M&A context, each of those is a potential issue that surfaces at closing.
The right path: Two options that aren't "expand the scope":
- Treat the M&A pilot as a research phase, not a capability expansion. The agent runs in parallel with human review; it surfaces candidates for human attention, not final assessments. Measure agreement rate with human reviewers on 200 documents before any demo.
- Scope the M&A demo to the specific clause types where the agent's accuracy is above 85% (likely standard boilerplate). Demonstrate quality on what it does well, explicitly exclude what it doesn't.
The board demo with 58% accuracy on M&A documents is a reputational risk to the company, not a showcase. The correct recommendation is to present option 2 to the head of legal: "Here's what the agent can reliably do in M&A today, and here's what we need to reach the accuracy threshold for full due diligence."
Self-assessment checklist:
- Did you identify blast radius as the disqualifying factor, not just the accuracy number in isolation?
- Did you propose a concrete alternative path rather than just "no"?
- Did you recognize the evaluation oracle problem (58% on a 50-document test is statistically weak)?
- Did you resist the timeline pressure with a principled argument, not just caution?
Exercise 2: Designing HITL Gates for Write Tools
Scenario: You're architecting a customer outreach agent for a B2B SaaS company. The agent has three tools:
query_crm(filters)→ returns matching customer recordssend_email(to, subject, body)→ sends email from the sales rep's addressupdate_crm_field(customer_id, field, value)→ updates a field in the CRM
The sales team's ask: the agent should identify at-risk customers (based on usage drops), draft personalized outreach emails, and mark the CRM record as "at-risk: outreach sent" after sending.
A senior sales rep objects: "If this thing fires off emails at the wrong people, I'm done. It needs to show me before it sends anything."
Your CTO wants maximum automation: "If we stop every email for approval, we get no efficiency gain."
Design the HITL architecture. What gets gated, how, and under what conditions?
Expert thinkingShowHide
Both the sales rep and the CTO are right about their respective concerns, and the correct design satisfies both.
Step 1: Classify the tools by blast radius:
query_crm→ Read. No blast radius. Never gate.send_email→ Write. High blast radius. An email sent to 500 customers with an incorrect personalization, or to the wrong segment, is a reputational and relationship risk. Gate.update_crm_field→ Write. Low-to-medium blast radius. CRM fields can be corrected. The "at-risk: outreach sent" flag is informational, not customer-facing. Gate with lower friction.
Step 2: Design the gates:
For send_email: Use a batch review queue, not per-email approval. The agent runs its full identification and drafting process, then surfaces a queue of N emails with preview. The rep reviews the queue (with one-click approve/edit/reject per row) and clicks "Send approved." This preserves quality control without creating per-email friction. The CTO gets efficiency because reviews happen in batches; the rep gets control because nothing sends without review.
For update_crm_field: Use post-action notification with undo window. The agent updates the field immediately (to avoid blocking the workflow) but sends a digest to the rep: "Marked 12 customers as at-risk today. [View and undo within 24 hours]." Most updates will be correct; the 24-hour undo window handles the rare errors.
Step 3: Define the conditions for non-gated send: Over time, after the rep has reviewed 500+ emails and the override rate falls below 3%, the gate can shift to an anomaly-only model; the agent sends autonomously but flags anything outside learned patterns for review. This is earned autonomy.
The principle: Match gate friction to blast radius and reversibility. Not every write tool gets the same gate. High blast radius + irreversible = hard gate. Low blast radius + reversible = soft gate with undo.
Self-assessment checklist:
- Did you distinguish between gate types (batch review vs. per-action vs. post-action undo)?
- Did you propose a path to earned autonomy rather than permanent gating?
- Did you satisfy both the rep's control requirement and the CTO's efficiency requirement?
- Did you avoid gating the read tool (
query_crm)?
Exercise 3: Single Agent vs. Multi-Agent Under Team Constraints
Scenario: You're the sole ML engineer at a 10-person startup. You're building an AI system to automate competitive intelligence briefings: the system should search the web for news about 5 named competitors, analyze their recent product changes and pricing moves, identify potential threats to your product, and generate a weekly briefing document.
You have two architectural options:
Option A (Single ReAct agent): One agent with 4 tools (web_search, read_url, analyze_text, generate_report). The agent plans and executes the entire workflow autonomously across all competitors.
Option B (Multi-agent pipeline): An orchestrator agent that delegates to 5 parallel specialist agents (one per competitor). Each specialist searches, reads, and analyzes its assigned competitor. The orchestrator aggregates and generates the final report.
You're a team of one. You have 3 weeks to ship v1.
Which architecture do you choose? What would make you switch to the other option?
Expert thinkingShowHide
Choose Option A for v1, with a clear trigger to switch to Option B.
Here's why:
Option A is the right starting point because:
- Single agent = single system to debug. When something goes wrong (wrong URL scraped, missed a product announcement, hallucinated a pricing change), you have one trajectory to inspect.
- A multi-agent pipeline introduces inter-agent communication overhead, state synchronization complexity, and failure modes that are much harder to diagnose solo. If Specialist Agent 3 returns a malformed result, how does the orchestrator handle it? What's the retry logic? Who owns the shared state?
- 3 weeks is not enough time to build, test, and debug a multi-agent system to production quality as a solo engineer. Option B would likely ship with known bugs that you don't have bandwidth to fix.
What Option B offers that Option A doesn't: Parallelism (5 competitors simultaneously instead of sequentially), which cuts wall-clock time from ~25 minutes to ~5 minutes for a full briefing run. This is a latency argument, not a quality argument.
When to switch: If and only if (a) you've shipped Option A and it works reliably for 4 weeks, AND (b) the 25-minute runtime is actually a problem for your users (it probably isn't for a weekly briefing). Use the qualification scorecard; if Option A's sequential performance is insufficient after evaluation, move to Option B. Not before.
The meta-lesson: "Start simple" isn't just about architecture tier. It applies to complexity within tier too. A simple single agent is simpler than a complex multi-agent system, even when both are "agents."
Self-assessment checklist:
- Did you factor in team size as a first-class constraint?
- Did you identify a concrete trigger condition for switching to Option B?
- Did you recognize that Option B's benefit (parallelism) is a latency gain, not a quality gain?
- Did you resist the impulse to choose the more sophisticated-sounding architecture?
Exercise 4: Diagnosing an Agent that Works in Staging but Fails in Production
Scenario: You deployed a document summarization agent 2 weeks ago. In staging (500 documents), it worked well: 91% accuracy, clean trajectories, <30 seconds per document. In production, you're seeing:
- 72% accuracy on week 1 (dropped from 91%)
- Average trajectory length: 8.4 steps (staging: 3.2 steps)
- 14% of runs exceed the 20-step max-turns limit and exit with no output
- Token costs: 4.2× higher than staging budget
The documents in production are real customer uploads. Staging used a curated test set.
What's your diagnosis? What are the top three hypotheses, and how do you test each?
Expert thinkingShowHide
Hypothesis 1: Distribution shift between staging and production inputs.
The most common cause of this pattern. The curated staging set probably over-represented well-formatted, clean documents. Production uploads include scanned PDFs, poorly OCR'd documents, documents in unexpected formats, or documents with layouts the agent's PDF parser doesn't handle well.
How to test: Sample 50 failing production documents. Compare their raw parsed text to 50 passing staging documents. Look for: unusual characters, encoding issues, empty sections, multi-column layouts that parsed incorrectly, or document types the agent wasn't designed for.
Hypothesis 2: The agent is looping on unclear or corrupted inputs.
The 8.4-step average (vs. 3.2 in staging) and 14% max-turns exits strongly suggest the agent is retrying steps on inputs where it can't make progress. Common pattern: the agent reads a page, the content is garbled, it "tries again" with a slightly different tool call, fails again, loops.
How to test: Pull the full trajectories from the 14% of runs that hit max-turns. Look for repeated identical or near-identical tool calls. If you see read_page(7) called 4 times in a row, that's a loop; the agent doesn't know when to give up on a page.
How to fix: Add explicit loop detection in the harness. If the same tool is called with the same arguments twice consecutively, inject an observation: "This step has already been attempted. Try a different approach or acknowledge that the input section is unreadable."
Hypothesis 3: The staging accuracy metric was too easy.
91% in staging may have been inflated if the evaluation oracle was too forgiving, e.g., BLEU score against a reference summary, or a simple length check. In production, if you're measuring user-rated quality or task-relevant accuracy, the 72% might be the honest number, and the 91% was an artifact of a weak eval.
How to test: Re-run 50 staging documents through the production evaluation oracle. If their score also drops to ~72%, the staging eval was wrong.
Self-assessment checklist:
- Did you identify distribution shift as the primary hypothesis?
- Did you connect the trajectory length increase to looping behavior specifically?
- Did you propose a concrete test for each hypothesis (not just "investigate further")?
- Did you include the possibility that staging accuracy was measuring the wrong thing?
Real-World Implementations
Teardown 1: Read/Write Agent Separation at High Query Volume (Illustrative Design)
Editorial note: this teardown is an illustrative design for a platform at the scale of a sports-betting company such as DraftKings. The figures and the "lessons learned" below are not taken from a published DraftKings source.
Imagine a sports-betting platform that processes tens of thousands of queries per second during peak events. Its agentic infrastructure routes pricing queries, risk management decisions, and promotional eligibility checks across a multi-agent system that must respond in under 200 ms.
The architecture decision that matters: The design uses a strict read/write agent separation at the infrastructure level, not just as a design principle, but as a hard architectural boundary. Read agents (pricing, odds, eligibility lookups) run in one fleet with no write permissions to production state. Write agents (bet placement, account updates, promotional disbursement) run in a completely separate fleet with strict rate limits and audit logging.
Why this decision is right: At this volume, a bug in the write agent fleet could disburse incorrect promotions to millions of users in minutes before a human can intervene. The read/write separation means that even if the write agent has a bug, it's physically isolated from the read-heavy pricing path. The blast radius of a write agent failure is bounded by the write fleet's rate limits.
Expert commentary: This is the Principle of Least Privilege applied at the infrastructure level, not just the code level. The interesting insight is that the separation was not primarily a security decision; it was a reliability decision. By isolating write operations, the design reduces the probability that a read-path spike (peak game traffic) would cause resource contention with write operations, and vice versa. The security benefit was secondary.
A common pitfall: Early versions of designs like this often have too many agents trying to share state via a central Redis cluster. The coordination overhead under peak load created latency spikes. The fix: move toward agents with minimal shared state, using event-driven patterns (Kafka) for communication rather than shared mutable state. This is the consistency model lesson: agents that communicate by events rather than shared locks scale better under bursty traffic.
Teardown 2: GitHub Copilot, Tool Design for a Code Completion Agent
GitHub Copilot serves tens of millions of developers and spans both ends of the spectrum, which makes it a useful illustration of tool design. (The tool-taxonomy details below are the chapter's characterization of the pattern, not quotations from GitHub documentation.)
The architecture decision that matters: Copilot distinguishes between inline completion (single-step, no tool use: an Augmented LLM pattern) and Copilot Chat's agent mode and the Copilot coding agent (multi-step, tool-using agents; Copilot Workspace, an earlier technical preview of the same idea, was retired in May 2025). The team explicitly built and deployed the simpler tier first, proven it at scale, and layered agent capabilities on top.
A useful way to read these agents is as a split between context readers (codebase search, file read, test output read) and code writers (file edit, file create). The agents have broad read access, but writes are surfaced for human review: as diffs the developer can keep or undo in the editor, or, for the coding agent, as a pull request that a human must review before anything is merged.
Why this decision was right: Code is a write operation with high blast radius. A wrong edit to a production codebase can break builds, introduce security vulnerabilities, or corrupt data. By making the developer the approval gate on writes, through a diff or pull request that makes the change explicit before it lands, Copilot achieves high utility without merging unreviewed changes.
Expert commentary: The diff or pull request review is not just a UI decision. It's an evaluation oracle. Every time a developer rejects or modifies a suggested change, that's a labeled example of "agent output that wasn't good enough." The acceptance rate on suggested changes is a real-time quality metric. When acceptance rate drops for a specific code type or language, that's a signal that the model's performance on that input distribution has degraded.
The lesson for practitioners: design your human-in-the-loop (HITL) gate so it generates training data. The human's correction is a signal, not just a safety check.
Production Challenges
Challenge 1: The 3am Alert, An Agent Looping in Production
Context: It's 3am. You're on-call. You get paged: the customer onboarding agent is showing anomalous token spend: 40× the normal hourly rate. The agent's job is to process new customer sign-up forms, verify identity documents, and provision accounts. SLA is 5 minutes per customer; you're seeing customers stuck for 45 minutes.
What you see in the logs:
[Session abc-447] Step 1: read_document(customer_id=9921, doc_type="passport") → SUCCESS (extracted fields: name, DOB, country)
[Session abc-447] Step 2: verify_identity(name="Mehmet Öz", DOB="1988-04-15", country="TR") → ERROR: "Name encoding error: special character in name field"
[Session abc-447] Step 3: REASONING: "The identity verification failed. I should retry with a corrected name format."
[Session abc-447] Step 4: verify_identity(name="Mehmet Oz", DOB="1988-04-15", country="TR") → ERROR: "Name mismatch with document"
[Session abc-447] Step 5: REASONING: "The name mismatch suggests I extracted the name incorrectly. I should re-read the document."
[Session abc-447] Step 6: read_document(customer_id=9921, doc_type="passport") → SUCCESS (extracted fields: name, DOB, country)
[Session abc-447] Step 7: verify_identity(name="Mehmet Öz", ...) → ERROR: "Name encoding error"
[... pattern repeats for 31 more steps until max-turns reached]
Diagnose the failure. What's the root cause, what's the immediate fix, and what's the permanent architectural change?
Expert analysisShowHide
Root cause: The agent is stuck in a read → error → re-read → same error → re-read loop because:
- The
verify_identitytool returns different error messages depending on whether the name has special characters or whether it matches the document, and these two errors require different fixes. - The agent interprets "name mismatch with document" as "I read the document wrong" and re-reads it, which produces the correct special character name, which then hits the encoding error again.
- There is no harness-level loop detection. The agent can call
read_documentas many times as it wants with no consequence.
Immediate fix (now, while paged):
- Terminate all sessions stuck in this loop manually via the admin console.
- Route affected customers (anyone with a non-ASCII name field) to manual review queue as a temporary bypass.
- Deploy a hotfix: add a harness-level check that terminates the session with
NEEDS_HUMAN_REVIEWstatus if the same tool is called with identical arguments twice in the same session.
Permanent architectural change:
- Harness-level loop detection should have been in v1. Any tool called with identical arguments twice in a session should trigger an explicit harness intervention: "This step has already been attempted with this input. The agent cannot resolve this automatically. Routing to human review."
- Tool error taxonomy. The
verify_identitytool should return structured errors, not free-text strings.{"error_code": "ENCODING_ERROR", "field": "name"}vs.{"error_code": "NAME_MISMATCH", "field": "name"}are meaningfully different errors that require different agent responses. The agent is doing string matching on error messages, which is fragile. - Human-review fallback as first-class exit. Any agent session that cannot complete due to a tool error should have a clean fallback path to human review, not just a max-turns exit with no output.
Self-assessment checklist:
- Did you identify the re-read loop as the root cause (not just "the tool is broken")?
- Did you propose both an immediate hotfix and a permanent architectural change?
- Did you identify the lack of loop detection in the harness as the structural failure?
- Did you recommend structured error codes instead of free-text error messages?
Challenge 2: Token Costs 4× Over Budget After a Prompt Update
Context: Two weeks ago, a team member updated the system prompt for the research summarization agent to "improve output quality." Before the update: average 3,100 tokens per run, $0.028 per run, 4,200 runs/day → $117/day. After the update: average 12,400 tokens per run, $0.112 per run, same volume → $470/day. The team member's change: added "Think carefully about each source before summarizing" and expanded the output format instructions.
The quality improvement is real (QA team rated output quality up 12%). But the budget is $150/day.
You need to get under the $150/day budget (a cut of at least 68% from $470) while retaining most of the quality gain. What's your approach?
Expert analysisShowHide
The 4× token increase from "Think carefully" is almost certainly because the instruction triggered verbose chain-of-thought reasoning traces in the output; the model is now explaining its reasoning before each summary section, where before it was summarizing directly.
Diagnosis first: Pull 10 sessions from before and after. Compare token usage by section: system prompt, user messages, model output. If the output tokens increased 4× but input tokens didn't change, the model is generating much longer reasoning traces.
Option 1: Bound the reasoning, don't just hide it (highest impact)
Moving reasoning into a hidden scratch pad does not make it free. Reasoning tokens, including a model's extended thinking where available, are billed as output tokens. The savings come from making the reasoning shorter: ask for a brief justification per source (for example, at most two sentences), or set an explicit thinking-token budget, and strip the reasoning from the final output. A two-step pipeline (step 1: reason briefly, step 2: summarize based on that reasoning) also works. Measure how much of the 12,400 tokens is reasoning to estimate the saving.
Option 2: Cascade to smaller model for reasoning, larger model for synthesis
If the 12% quality gain is real, it likely comes from better reasoning, not better summarization. Use a small, cheap model (for example Claude Haiku) for the reasoning step, then pass the reasoning output as context to a more capable model (for example Claude Sonnet) for the final synthesis. Compare cost and quality against the single-model baseline before adopting it.
Option 3: Constrain output format more tightly
Expanded output format instructions may be generating more tokens in the output. Tighten the output schema, if the output is a JSON object with defined fields and field-level length limits ("summary": string max 200 words), the model cannot exceed those bounds regardless of how much it "thinks carefully."
Recommended approach: Do Option 3 first (low risk, low effort). Then instrument with Option 1's scratch pad pattern. Measure quality and cost after each change. Don't revert the prompt; iterate toward the budget target while preserving quality.
Self-assessment checklist:
- Did you diagnose the source of the token increase (output reasoning traces, not just "the prompt is longer")?
- Did you propose a path that preserves most quality gains rather than reverting the change?
- Did you suggest cascading (smaller model for cheap tasks, larger for quality tasks)?
- Did you propose an output format constraint as the lowest-effort first step?
Interview-Style Reasoning Questions
Question 1: Explaining the Agent vs. Workflow Decision to a Skeptical Executive
Setup: You're presenting a proposal to build an AI agent for contract review. The VP of Engineering interrupts: "We already use LLMs for this; we have a pipeline that extracts key clauses and flags risks. Why do we need an 'agent'? What's actually different, and is it worth the added complexity?"
Respond to the VP in under 3 minutes. Make the distinction concrete, and acknowledge the legitimate concern about complexity.
Expert thinkingShowHide
Strong answer structure:
"The distinction is about who controls what happens next. In our current pipeline, code controls every step: extract clause, classify risk, flag it. That's a workflow. It works well for contracts where the relevant clauses are well-defined and the classification is consistent.
An agent is different in one specific way: the model decides what to look at next, based on what it found. For standard NDAs, we don't need that. For M&A due diligence, we do, because a discovery in section 8 about change-of-control provisions might mean the agent needs to re-examine section 3 for related indemnification language. Our current pipeline can't do that; it reads top to bottom and exits.
You're right that agents are more complex. The reasons are real: nondeterminism, harder to debug, more expensive to run, more failure modes. So here's my answer to whether it's worth it: we should only build an agent if we can prove the current workflow fails on our target cases. What I'm proposing is a 2-week evaluation: run 100 real M&A documents through the current pipeline, measure where it fails, and only proceed with the agent architecture if the failure rate is above 20%. If the current pipeline handles 90% of M&A documents well, we shouldn't build an agent."
What makes this a strong answer:
- Defines the distinction concretely without jargon
- Acknowledges the legitimate concern (complexity is real)
- Doesn't advocate for agents unconditionally, proposes an evaluation gate
- Gives the VP a specific decision checkpoint, not a vague promise
Question 2: Designing an Autonomy Budget for a New Deployment
Setup: You're designing a customer refund processing agent for an e-commerce company. The agent will handle 5,000 refund requests per day. Average refund: $47. Some are $0.99. Some are $4,200.
Design an autonomy budget: under what conditions does the agent act autonomously vs. escalate to human review? How do you set the thresholds?
Expert thinkingShowHide
Strong answer structure:
Start by identifying the blast radius tiers, not a single threshold:
Tier 1: Fully autonomous (no human approval needed):
- Refund ≤ $X (your base threshold: start at $50, calibrate based on error rate data)
- Customer history: 0 prior disputed refunds
- Reason: standard (order not received, item damaged, wrong item sent; all validatable from order data)
- Product: in-stock, not final sale
These cases represent probably 60–70% of volume. The blast radius of a wrong auto-approval at $50 is meaningful but recoverable.
Tier 2: Auto-approve with notification and undo window:
- Refund $50–$200
- Standard reason, but customer has 1 prior disputed refund
- The agent approves, sends a notification to the ops team, and logs the action with a 4-hour undo window.
Tier 3 (Human review queue):
- Refund > $200 (or any amount where total refunds to this customer in 30 days > $500)
- Flagged reason: fraud indicator, chargeback history, "received damaged" on perishable goods
- Multiple items in same order
Tier 4 (Immediate human escalation):
- Any refund involving a regulatory complaint, social media mention, or legal threat in the conversation
- Account suspected of abuse patterns
How to set the initial dollar threshold: Start conservative ($25–$50). After 2 weeks of data, analyze the cases that fell in Tier 1. What's the false positive rate (auto-approvals a human reviewer would have denied)? If it's below 2%, raise the threshold. Never raise the threshold without empirical evidence.
Self-assessment checklist:
- Did you design multiple autonomy tiers, not a single binary gate?
- Did you specify an undo window for medium-risk actions?
- Did you propose a process for calibrating the threshold based on data?
- Did you include customer behavior signals (not just dollar amount) as a factor?
Question 3: Building an Evaluation Oracle from First Principles
Setup: You're about to build a research summarization agent. Your manager asks: "How will we know if it's working?" You need to define an evaluation oracle (a function that scores the agent's output) before you write a single line of agent code.
Design the evaluation oracle. What does it measure, how is it measured, and what's the minimum acceptable score?
Expert thinkingShowHide
The question most teams answer badly: "We'll use BLEU score / semantic similarity / LLM-as-judge." These are implementation choices. The harder question is what you're actually trying to measure.
Step 1: Define the task success criteria in plain English
For a research summarization agent, success is: "The summary accurately represents the sources, covers the key claims relevant to the research question, does not introduce claims not supported by the sources, and is usable by a domain expert to make a decision without re-reading the originals."
This gives you four measurable dimensions:
- Factual accuracy: claims in the summary that can be verified against the source documents
- Coverage: key claims in the source documents that should be in the summary but aren't
- Faithfulness: claims in the summary that contradict or are absent from the sources (hallucinations)
- Usability: domain expert rating: "Would you make a decision based on this summary alone?"
Step 2: Choose how to measure each dimension
- Factual accuracy: LLM-as-judge (Claude evaluates each claim in the summary against the source) + random human spot-check (20% of cases). Target: ≥ 90% of claims verifiable.
- Coverage: Build a reference summary for each test document, marking 5–10 "must-have" key claims. Measure what percentage of those appear in the agent's summary. Target: ≥ 80% coverage.
- Faithfulness: Dedicated hallucination detector: for each claim in the summary, retrieve the most relevant source passage and evaluate whether the claim is supported. Target: hallucination rate < 5%.
- Usability: Domain expert survey on a weekly sample (10 summaries/week). 5-point scale. Target: ≥ 4.0/5.0 average.
Step 3: Define the minimum acceptable score before shipping
Primary gate: faithfulness < 5% (non-negotiable: hallucinations undermine the entire value proposition). Secondary gate: coverage ≥ 80% (otherwise the summary is systematically incomplete). If either gate fails, do not ship.
Self-assessment checklist:
- Did you define success in plain English before defining measurement?
- Did you include a hallucination-specific metric (not just "accuracy")?
- Did you include at least one human evaluation component?
- Did you define a minimum acceptable score as a shipping gate, not just "as high as possible"?
Question 4: Handling a Stakeholder Who Wants to Skip the Maturity Ladder
Setup: You present a phased deployment plan: ship an Augmented LLM first, run evaluation, then upgrade to a workflow, then potentially an agent. The head of product says: "We've been looking at competitor demos. They're already running full agents. If we start with RAG, we'll be behind in 6 months. Can't we just start with an agent?"
How do you respond?
Expert thinkingShowHide
The competitive framing is a trap. Competitors' demos do not tell you what's in their production systems, what their failure rates are, or how much engineering debt they've taken on. The graveyard of "full agent" launches that quietly regressed to simpler architectures 6 months later is large.
Strong response structure:
"I take the competitive concern seriously; we can't be 6 months behind on capabilities. Here's why I don't think starting with an agent solves it, and what I'd propose instead.
Starting with an agent that isn't ready costs us more time, not less. If we build a full agent now, ship it with 65% task success rate, and watch quality complaints accumulate for 3 months, we lose 3 months fixing what we should have proven first. That's the Klarna scenario.
The Augmented LLM phase isn't a delay; it's a qualification gate. We'll know in 3–4 weeks whether the simpler system is sufficient or whether we genuinely need agent-level capability. If we need the agent, we start the build with real evaluation data that tells us exactly what the agent needs to handle. That's faster than building blind.
What I can commit to: we'll have an evaluation result in 3 weeks that tells us definitively whether we're building a workflow, an agent, or expanding the current RAG system. The competitor who ships an agent without that evidence is the competitor we'll beat in 6 months when they're firefighting quality issues."
What makes this strong:
- Doesn't dismiss the competitive concern
- Reframes "starting simple" as speed, not caution
- Names the specific risk of skipping the ladder (Klarna pattern)
- Commits to a concrete timeline for the evaluation gate
Question 5: The "We'll Know It When We See It" Problem
Setup: You're inheriting a production agent from another team. The documentation says the agent "summarizes customer feedback and identifies action items." When you ask the previous engineer how they evaluated it, they say: "We reviewed the outputs manually each week. It was doing well." There is no automated evaluation. No test set. No metric.
The agent costs $2,400/month. You need to decide whether to keep it, replace it, or improve it. How do you build the evaluation oracle from scratch, in two weeks, with no ground truth data?
Expert thinkingShowHide
"We'll know it when we see it" means the system cannot be improved, because improvement requires measurement. The first task is establishing measurement, not deciding what to do with the agent.
Week 1: Build the evaluation dataset
Step 1: Pull the last 90 days of agent inputs and outputs. You have raw data.
Step 2: Sample 100 input-output pairs stratified by document type (if there is variation) and date (to check for drift).
Step 3: Have two domain experts rate each output on three dimensions (1–5 scale):
- Completeness: Does the summary cover the important feedback themes?
- Accuracy: Does anything in the summary misrepresent the source feedback?
- Action item quality: Are the action items specific, actionable, and tied to real feedback?
Step 4: Compute inter-rater agreement (Cohen's kappa). If agreement is below 0.6, the rating criteria are ambiguous; refine the rubric before proceeding.
Week 2: Build the automated oracle
Use the human-rated 100 examples as a calibration set. Build an LLM-as-judge that scores new summaries on the same three dimensions. Validate: does the LLM-as-judge agree with your human raters at kappa ≥ 0.7? If yes, you have a scalable oracle.
The decision:
Run the automated oracle over the last 30 days of production output. If average scores are ≥ 3.5/5.0 on all three dimensions with hallucination rate < 5%, keep the agent. If scores are below that threshold on any dimension, you need to fix it or replace it. The $2,400/month is only worth it if the agent produces reliable output.
Self-assessment checklist:
- Did you propose building evaluation data from existing production logs (not starting from zero)?
- Did you include human raters as a calibration step before automating?
- Did you check inter-rater agreement (a signal that your criteria are well-defined)?
- Did you connect the oracle score back to the keep/fix/replace decision?