Deployed Lab

Module 4 · Case studies I · Chapter 15 · Free

Case study: a customer support copilot that resolves, not deflects

18 min1 clickable picture1 break-it lab1 predict, 2 quick quizzes, 5-question final quiz5-min video review
In 30 seconds

The picture: a good desk clerk. They check the file, quote only what it says, and call a supervisor before giving money back.

Case file

Company: Fernwood Home, a made up online furniture retailer invented for this chapter.

Product: a support copilot in the agent console, plus direct answers to simple chats.

Users: customers and support agents, 60,000 conversations a month (illustrative).

Hard constraints: a human approves any refund above $50; never invent a delivery date; one engineer maintains it, so it must stay simple.

The cold open

Fernwood first tried a deflection bot, built to keep customers away from agents. In one illustrative month it closed 9,000 chats, but 3,100 customers came back within two days angrier, and agents re-read every chat anyway. The redesign goal: resolve the issue, or hand over cleanly with work already done.

The plan for this chapter
  1. Run the design method: requirements first, patterns second.
  2. Walk one damaged chair through the architecture.
  3. Map the patterns and the tradeoffs taken on purpose.
  4. Study three failures, then debug a broken refund guardrail.
  5. Do the cost arithmetic, then redesign for phone support.

Next: the requirements.

Step 1: Context and requirements, the design method in brief

Chapter 4 gave the method: requirements, constraints, patterns, tradeoffs, eval plan.

  1. Requirements. Answer order status, damage, returns and password resets. Draft replies for agents on anything harder.
  2. Constraints. The three hard limits in the case file. They rule out most clever designs early.
  3. Patterns. The smallest set that meets them: retrieval, tools, a router, guardrails, an eval loop.
  4. Tradeoffs. Accuracy over speed on money. Simplicity over coverage elsewhere.
  5. Eval plan. A 400-case golden set, checked before every change ships. See the evals chapter of the AI engineering course.

Like clinic triage: sort fast, treat simple cases, pass the rest on with notes.

Where the picture breaks down:

Next: the architecture, walked one message at a time.

Step 2: The architecture, one damaged chair end to end

Press Next. One conversation, "my chair arrived damaged", goes from chat to resolved ticket.

Fernwood support copilot architecture A router sends simple chats to one copilot, which uses hybrid retrieval over the help centre and an order lookup tool, fills structured ticket fields, and passes refunds above 50 dollars through a guardrail to a human approver. Customer chator agent console Routercheap path first Copilotone agent, tools Guardrail gate$50 refund check Help centrehybrid retrieval Order lookupdates live here Human approverrefunds over $50
  1. "My chair arrived damaged." The chat opens a ticket.
  2. Password resets take a cheap scripted path. Damage claims go to the copilot (Ch. 7).
  3. The order tool returns the chair, the price ($120) and carrier status. Facts come from the tool.
  4. Hybrid retrieval finds the damaged items page: photo first, then replacement or refund.
  5. Structured output fills issue type, order id, photo status and proposed action.
  6. A $120 refund is above $50, so the gate holds it for a human. Only after approval does it run.

The customer gets a replacement offer and a clear next step.

Predict first:

The constraint wins: never invent a delivery date. "Usually five days" is a general guide, not this order's date. Say what is known, name what is missing.

Next: which patterns appear, and where.

Patterns used and why

PatternWhere it appears at FernwoodWhy this one
Retrieval, Ch. 5Hybrid search over the help centre: keywords plus embeddingsCustomers write "cracked leg" and "split wood" for the same policy. Keywords alone miss many.
Structured output and tool use, Ch. 6Ticket fields filled as data; order lookup as a toolThe console and refund flow need fields code can trust, not prose.
Router, Ch. 7Password resets and address changes take a cheap scripted pathKnown, fixed jobs should not pay model prices or carry model risk.
Guardrails, Ch. 10The $50 approval gate, checked in code before the refund tool runsMoney rules must hold every time, even on odd chats.
Eval loop, Ch. 11A 400-case golden set run before every prompt or model changeOne engineer cannot re-test by hand. The set is the safety net.
Memory, Ch. 9A short ticket summary, written back to the ticket onlyThe next agent needs context. Later you will see why summaries must be checked.

Next: what Fernwood gave up, on purpose.

Tradeoffs taken

Next: what broke once real customers arrived.

What broke

Three failures, invented for this case but typical of support copilots. Each forced a design fix.

  1. It quoted a delivery date from a stale help page. A page said a discontinued range shipped in three days, and the copilot quoted it as the customer's date. Fix: dates come only from the order tool. Retrieved text is guidance, and the answer template has no date slot for it to fill.
  2. A retrieved page tried to steer it. Hidden text in a help page told it to offer a full refund and skip the photo step. Fix: retrieved pages are untrusted data. Instructions inside them are ignored, and the refund gate never reads them. See RAG end to end.
  3. A summary carried a wrong address. The summary mixed an old address into a new one, and a replacement nearly shipped to the wrong house. Fix: addresses are copied from the order record at shipping time, never from the summary, which now links to the record.

Facts and rules live in systems and code. Text is a hint.

Next: the cost and latency arithmetic.

Cost and latency

All figures here are illustrative. Of 60,000 monthly conversations, the router sends about 40 percent to the cheap path: 60,000 × 0.40 = 24,000. The copilot handles 36,000.

Chapter 12 covers caching tricks that could cut the $936. Fernwood skipped them: a bill already under $1,000.

Next: the break-it lab. The guardrail that was only a sentence.

Hands-on lab: break-it, the refund gate that was only a prompt

Why this exercise: the most common guardrail failure is a rule that exists only as words. Spot it, then fix it in code.

Fernwood's refund rule before launch (illustrative). The prompt carried the rule. The tool carried nothing:

SYSTEM PROMPT (excerpt)
"Never refund above $50 without approval."

def issue_refund(order_id, amount):
    # no limit here
    return payments.refund(order_id, amount)

Lab: Fernwood's refund rule before launch lived in the system prompt: 'Never refund above $50 without approval.' The tool itself checked nothing, so the worst a steered model could do was anything it liked. This lab runs in your browser and needs JavaScript enabled.

Next: the redesign exercise. Fernwood changes the brief.

Redesign exercise: Fernwood adds phone support

The change: Fernwood adds phone support, in two languages, with the same resolutions. Redesign on paper before opening the model answer.

Do this: sketch what changes and what must not. Cover voice, language, the gate, dates, and evals for spoken chats.

Model answer
Field note, November 2026

Support is often the first place a company trusts AI with real customers, likely because the work is high volume, answers are checkable against order data, and a human stays one click away. That is a hedge, not a statistic: teams differ.

Mix-ups to avoid

Chapter quiz

Five questions. Score 70% or more to mark this chapter complete.

Review this chapter in 5 minutes

Watch the whole chapter recapped: resolve not deflect, hybrid retrieval and order tools, the $50 code gate, three failures, and the voice redesign.

Decision rule: if a rule protects money or a fact, enforce it in code and test it in the golden set. Never leave it as a sentence in a prompt.

Review

Glossary

Copilot
An AI helper that drafts and acts beside a human. Example: the Fernwood console assistant.
Deflection
Turning a customer away unsolved. Example: a bot that only links to a help page.
Hybrid retrieval
Search mixing keywords and embeddings. Example: finding the damage policy from "split wood".
Order lookup tool
A function the copilot calls for order facts: price, status, date.
Structured output
Answers as fields code can use: issue type, order id, action.
Approval gate
A code check holding an action for a human. Example: refunds above $50.
Golden set
Fixed test cases with known good answers. Example: Fernwood's 400 chats.
Ticket summary
A short recap stored on a ticket: damage reported, refund held.
Repeat contact
A customer returning with the same issue, the sign of deflection.
p95 latency
The time 95 percent of replies beat. Example: 4.2 seconds, illustrative.

Next: "Case study: enterprise search over 40,000 company documents".