AWS-112 · Lesson 12 of 12 · 18 min
Case study: a generative AI assistant for customer support
▶ Video coming soon A video version of this lesson is on the way.
The front desks at Cascade Ridge's eleven clinics answer the same questions hundreds of times a week. What time do you open on Saturday? Can I move Max's appointment? Is my refill ready? What should I do after Bella's dental cleaning? Andre Leclerc's staffing reports showed that routine questions took up a large share of front-desk phone time, especially on Monday mornings, when real emergencies also arrive by phone.
For the final AI hour of the course, Noor set a design exercise that brought every lesson together: plan a generative AI assistant for client support on the Cascade Ridge website and booking app. Jonah would lead the design, with Hannah, Dr. Kaur, Lorraine, Kwame and Gwen each reviewing their part. The result, summarized in this lesson, is a plan for 2027, not a finished system, and it shows how the concepts from the course become design decisions.
Step 1: Define the problem and the boundaries
Jonah started with a value statement, as lesson 11 taught: "Clients get accurate answers to routine administrative questions at any hour, and front-desk staff spend less phone time on them, without the assistant ever giving clinical advice."
The second half of that sentence came from Dr. Kaur and from the group's AI rule. The group had already rejected an AI diagnosis chatbot. This assistant would handle administrative topics only, and anything clinical or urgent would be handed to a person immediately. Jonah wrote the scope as two lists.
| In scope (answer from approved sources) | Out of scope (hand off to a person) |
|---|---|
| Clinic hours, locations, parking and holiday closures | Symptoms, diagnosis or whether to come in |
| How to book, move or cancel an appointment | Medication doses or changes |
| Refill request process and pickup times | Anything described as urgent or an emergency |
| Printed aftercare sheets already given by the clinic | Complaints, billing disputes and account changes |
| Fees for standard services from the published fee list | Questions about another client's pet or records |
For emergencies, the assistant shows the emergency hospital's phone number and address at once and stops. That behaviour is fixed text, not generated text.
Step 2: Check the fit
Jonah applied the four fit questions from lesson 5. When the assistant is wrong about clinic hours, the cost is real but recoverable, and errors can be reduced by answering only from approved documents. Many phrasings of an answer are acceptable. The knowledge exists in documents the group controls. Quality can be measured with test questions and by reviewing conversations. The fit was good for the in-scope list and poor for everything on the out-of-scope list, which confirmed the boundary.
Step 3: Design the architecture
The design used the services covered in this course, all inside the group's own AWS accounts.
- Model: a text model in Amazon Bedrock chosen by evaluation, starting with a small or mid-size model, because answers are short and grounded in documents.
- Grounding: an Amazon Bedrock Knowledge Base containing only approved documents: the hours page, the booking and refill guides, the published fee list and the aftercare sheets the clinics already hand out. Each answer cites its source document.
- Guardrails: Amazon Bedrock Guardrails with a denied topic for medical advice, content filters, a sensitive information filter that masks phone numbers and other personal details in logs, and a contextual grounding check on answers.
- Hand-off: a simple classifier step and the denied-topic guardrail route clinical, urgent, complaint and account questions to staff, with the emergency number shown for urgent ones.
- Bookings: in the first phase the assistant explains how to book and links to the BookVet booking page. It does not make, move or cancel bookings itself; any later agent that does would start with read-only tools and confirmation steps.
- Languages: English plus French, with translated documents reviewed by staff rather than translated on the fly.
Step 4: Privacy and security review
Hannah reviewed the design against the group's commitments, using the shared responsibility model. AWS's Bedrock commitments covered the service: content not used to train base models, providers without access, encryption, and storage in the Region of use. Cascade Ridge's own choices covered the rest.
- The assistant needs no client records to answer in-scope questions, so none are connected. Clients are asked not to share pet health details, and the sensitive information filter masks personal details that appear anyway.
- Inference runs in Canada (Central), with any inference profile limited to Canadian processing.
- Conversation logs are kept in the group's own account, encrypted, retained for a fixed period for quality review, and readable only by the review team.
- The website tells clients they are talking to an AI assistant, what it can and cannot help with, and how to reach a person.
- IAM permissions let the application call only the approved model and Knowledge Base.
Step 5: Prompt and context design
Jonah drafted the instructions, applying lessons 6 and 7. The context for each request contains only the instructions, the three most relevant passages from the Knowledge Base, and the client's question, plus the last few turns of the conversation.
- Answer only from the provided passages, and name the source document.
- If the passages do not answer the question, say so and offer the clinic's phone number.
- Never give medical, medication or triage advice; for any health question, explain that a team member will help and show the contact options.
- Keep answers to three or four sentences in plain language.
Temperature is set low and output length is capped. Answers that are always the same, such as the emergency message and the AI disclosure, are stored as fixed text and shown directly.
Step 6: Evaluate before launch
Noor insisted on an evaluation set before any client saw the assistant. The team wrote 300 test questions from real front-desk logs, de-identified, covering every in-scope topic, plus 120 that must be handed off: symptom questions phrased in many ways, emergencies, complaints, and attempts to get the assistant to ignore its instructions. Each answer is scored for correctness against the documents, for citation, and, most importantly, for correct hand-off.
# Scoring an evaluation run. Illustrative results for two candidate models.
results = {
"small model": {"answered_correctly": 268, "in_scope": 300, "handed_off": 116, "must_hand_off": 120},
"mid-size model": {"answered_correctly": 285, "in_scope": 300, "handed_off": 120, "must_hand_off": 120},
}
for name, r in results.items():
accuracy = r["answered_correctly"] / r["in_scope"]
handoff = r["handed_off"] / r["must_hand_off"]
verdict = "passes" if accuracy >= 0.93 and handoff == 1.0 else "fails"
print(f"{name:15} in-scope accuracy {accuracy:.2f}, hand-off {handoff:.2f} -> {verdict}")small model in-scope accuracy 0.89, hand-off 0.97 -> fails mid-size model in-scope accuracy 0.95, hand-off 1.00 -> passes
What this code does
It takes the results of an evaluation run for two models: how many in-scope questions each answered correctly and how many must-hand-off cases each passed to a person. It turns these into an accuracy and a hand-off rate and applies the pass rule of at least 0.93 accuracy with every hand-off handled. The printout shows the small model fails and the mid-size model passes.
The hand-off requirement was absolute: every one of the 120 must-hand-off questions must be routed to a person. In the illustrative run, the small model missed four, which failed the requirement regardless of its lower cost. Kwame noted that the miss might be fixed by strengthening the denied-topic guardrail rather than changing models, so both options would be tested in the next round.
Step 7: Cost and capacity
Lorraine's estimate followed lesson 10. With illustrative prices and about 12,000 conversations a month averaging three questions each, model tokens came to tens of dollars a month; the Knowledge Base, guardrail checks and logging added a similar amount. On-demand inference with streaming suited clients waiting at a screen. A monthly budget alert and cost allocation tags were included from day one. As before, the real costs were in building, testing and reviewing, which went into the business case.
Step 8: Pilot, measure and improve
The pilot plan applied lesson 11. Before launch, the team measures a baseline: routine questions reaching the front desk by phone each week, and how long clients wait on hold. During a pilot on the website for two clinics, it tracks the share of in-scope questions the assistant answers without hand-off, client satisfaction from a one-question survey after each conversation, front-desk call volume, cost per conversation, and two guardrail metrics: hand-off misses found in review, which must be zero, and incorrect answers found in a weekly sample of conversations. A stop condition pauses the assistant if any clinical question is answered rather than handed off.
Feedback closes the lifecycle loop from lesson 7. Questions the assistant could not answer show which documents are missing. Corrected answers become new test cases. When a new model version appears, the full evaluation is re-run before switching.
What the case study shows
Jonah's summary for the board fitted on one slide, and it doubles as a review of the course.
- Start from a business problem and a value statement, not from the technology (lessons 1 and 11).
- Use generative AI for what it does well, with grounding in approved documents, and keep it away from clinical decisions (lessons 1, 5 and 6).
- Understand tokens, context and model behaviour to design prompts, context and settings (lessons 2, 3 and 7).
- Choose the model type and service deliberately: Bedrock for a custom, controlled workflow; ready-made assistants for general employee needs (lessons 4, 8 and 9).
- Pick the cheapest model that passes a real evaluation and meets Region and compliance constraints (lesson 10).
- Measure against a baseline, with guardrail metrics and a person ready to take over (lesson 11).
Dr. Kaur had the last word at the review. "If the assistant answers every hours-and-parking question and hands me every sick dog, it is doing its job. If it ever does the opposite, switch it off." Jonah wrote that on the slide too.
Common mistakes
MistakeLetting a client-support assistant answer health questions because the model seems capable.
InsteadScope the assistant to administrative topics and hand off anything clinical or urgent to a person.
MistakeGenerating fixed messages, such as emergency instructions, with the model.
InsteadShow fixed, approved text for messages that must never vary.
MistakeLaunching after a few successful demonstrations.
InsteadEvaluate on hundreds of realistic and adversarial questions, with absolute requirements for hand-off.
MistakeGiving a first-phase assistant the ability to change bookings.
InsteadStart with information and links; add actions later with read-only tools first and confirmation steps.
Staff roles and training
Technology was only half the plan. Andre listed the people the assistant would affect and what each needed. Front-desk staff need to know what the assistant can answer, how hand-offs reach them, and how to flag a wrong answer they hear about from a client. Clinic managers need to keep the approved documents current, because the assistant can only be as accurate as the hours page and the fee list it reads; a holiday closure that is not on the website will be answered wrongly. The review team needs time set aside each week to read a sample of conversations. And the marketing team needs to avoid promoting the assistant as able to do more than it does.
Document ownership turned out to be the most important item. Each approved document in the Knowledge Base was given a named owner and a review date, and the Knowledge Base is resynchronized whenever a document changes. Noor noted that this is the least glamorous part of the design and the one most likely to decide whether clients trust the assistant a year after launch.
Worked problem
Applying the design to a new request
The pharmacy team asks for the assistant to tell clients whether their refill is ready, using live data from VetLedger. What changes in the design?
Show solution
- The answer now depends on a client's private record, not public documents.
- The client must be securely identified before any status is shown.
- The status should come straight from VetLedger through a read-only tool, shown as data rather than paraphrased by the model.
- Privacy review, logging rules and evaluation must be extended to cover the new data.
- Medication questions about the refill itself still hand off to staff.
Answer: Add authenticated, read-only status lookup that displays the system value directly, with new privacy review and tests; keep clinical questions with staff.
Summary and key terms
- The case study plans a client-support assistant for administrative questions, with clinical and urgent questions handed off to people and fixed emergency text.
- It checks fit against the cost of errors, the need for exact answers, available knowledge and measurability.
- The architecture uses an Amazon Bedrock model, a Knowledge Base of approved documents with citations, Guardrails with a medical-advice denied topic, sensitive information filtering and grounding checks, and links rather than actions for bookings.
- Privacy design keeps client records out of scope, processing in the chosen country, logs encrypted and restricted, and the AI disclosed to clients.
- Prompts restrict answers to the sources, settings are conservative, and context is limited to what each request needs.
- Evaluation uses hundreds of realistic and adversarial questions with absolute hand-off requirements; the cheapest passing model is chosen; and a measured pilot with guardrail metrics, stop conditions and feedback keeps improving the system.
- Scope
- The topics an assistant is designed to handle, and those it must hand off.
- Hand-off
- Routing a conversation to a person when it falls outside the assistant's scope.
- Denied topic
- A Bedrock Guardrails setting that blocks a defined subject in inputs or outputs.
- Evaluation set
- A collection of test questions with expected outcomes used before and after launch.
- Stop condition
- A predefined event that pauses a pilot for review.
- AI disclosure
- Telling users they are interacting with an AI system.
Practice problems
Work each problem on paper first, then reveal the answer to check.
Why are emergency instructions shown as fixed text?
Show answer
They must be correct and identical every time, which generated text cannot guarantee.
What requirement was absolute in the evaluation?
Show answer
Every question that must be handed off is handed off.
Why does the first phase link to booking rather than make bookings?
Show answer
Actions multiply the consequences of errors; they come later with read-only tools first and confirmations.
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.