0:00Intro: MOFUSA Tech Academy
Welcome to MOFUSA Tech Academy. Beyond learning, towards mastery.
0:09From a Friday tweak to a blocked release
On a Friday, someone at Brightcart tweaks the assistant's instructions to "be more concise". It reads better. It ships. By Monday, complaints are rising: the shorter replies have started leaving out important refund conditions. Now rewind. This time, the same small change automatically triggers a full evaluation. A red alarm flags a drop on refund questions, the change is blocked, and it's fixed before any customer sees it. That's the goal of this episode: turning everything we've learned about evaluation into a pipeline that runs automatically, every time a prompt, model, document or setting changes.
Season Four, Module Sixteen, final stop: designing an evaluation pipeline.
0:59Evaluate the parts, and the whole
A real AI system is a chain of steps. Brightcart's assistant classifies the customer's intent, retrieves relevant policy text, calls the order system, writes a reply, and runs a safety check. Evaluate each step on its own as well as the whole. Did it fetch the right policy section? Did it call the order tool with the right order number? Is the reply grounded in what was retrieved? Then the end-to-end questions: was the customer's problem actually solved, in one reply, and across the whole conversation? Component metrics tell you where things go wrong.
If a reply quotes the wrong policy, was the writing at fault, or did retrieval fetch the wrong document? Without step-by-step evaluation, you're guessing.
1:50Evaluation guidelines
Before anything is automated, write evaluation guidelines. Define exactly what "correct", "grounded", "helpful" and "safe" mean for Brightcart. Add rubrics with examples of good, borderline and bad replies, written together with Sana's team. Rule on the tricky cases in advance: if the policy doesn't cover a situation, the right answer is to say so and offer a human, and that counts as correct, not as a failure. Guidelines turn vague opinions into consistent judgements, for human reviewers and AI judges alike. And link them to business outcomes, so you can later check that a better score really means more problems solved.
2:34Evaluation data and slices
Next, the evaluation data, best organised like shelves of test sets. A golden set of a few hundred to a thousand representative tickets, with expert answers, versioned and locked away from anything used to build the system. Slices of that set, by topic, language, customer type and difficulty. An adversarial set of manipulation attempts, privacy probes and unsafe requests. A regression set, where every bug you ever fix becomes a permanent test, so it can never quietly return. And fresh samples from production, reviewed regularly, because real customers always surprise you.
Slices matter more than people expect. Imagine an assistant scoring eighty-five percent overall, but only sixty percent for customers writing in a language other than English. The overall number would hide a group that's being failed. Always break results down.
3:32Choosing a method per criterion
Then choose a method for each criterion, the toolbox from this module. Classification metrics for routing. Retrieval metrics for fetching documents, which we'll define in Season Five. Exact checks for tool calls. Claim-by-claim judging for policy accuracy. Validated rubric judges for tone and helpfulness. Red-team pass rates and over-refusal rates for safety. Schema checks for format. Logged measurements for speed and cost. And, once live, business outcomes like resolution and satisfaction.
4:07Evaluating the evaluation
Here's a step many teams skip: evaluating the evaluation itself. Is it reliable? Run it twice. If scores move noticeably just because of randomness in the model or the judge, you need more test cases or repeated runs. How uncertain are the numbers? A simple technique, bootstrapping, resamples your test results with replacement many times and looks at the spread. With two hundred cases, expect roughly five points either way. Is it valid? Check that higher scores really go with better human ratings and, later, better business outcomes.
And is it practical? A full suite with AI judges costs time and money, so many teams run a quick subset on every change and the full suite nightly or before each release.
4:58Automate: evals as tests
Now automate it, just like software teams automate their tests. Any change, to the instructions, the model or its version, the policy documents, the tools, the settings or the safety rules, triggers an evaluation run. A quick smoke test runs in minutes; the full suite runs before release. Results are compared with the current production version, metric by metric and slice by slice, with error bars. If a must-pass gate fails, or a real regression appears, the release is blocked. Otherwise, the results go to a dashboard for sign-off.
And every run records the exact versions involved, model, prompt, documents and judge, so any result can be reproduced and explained.
5:46Online evaluation: shadow runs and A/B tests
Offline tests can't predict everything, so evaluation continues after release. A new version can run in shadow mode first: it answers silently alongside the live system, and its outputs are compared but never shown. Then an A-B test: send a small share of conversations, say five percent, to the new version, and compare resolution and satisfaction, with proper statistics, while watching safety metrics closely. Every day, sample live conversations for judging and human review. Collect feedback: customer ratings, and especially the edits Sana's team makes in suggest mode.
And close the loop: every new failure found in production becomes a new test case. Over time, the evaluation suite grows into one of the company's most valuable assets.
6:39Try it yourself: where should Dev invest?
Brightcart's pipeline finds the right policy ninety percent of the time. Given the right policy, the generator answers correctly ninety-five percent of the time; given the wrong one, only twenty. Overall, that's eighty-seven and a half percent. Dev can either improve retrieval to ninety-eight percent, or improve the generator to ninety-nine. Which helps more? Pause.
Better retrieval lifts the overall score to ninety-three and a half; a better generator, only to ninety-one. Most of the errors start with the wrong document. Without measuring each component separately, Dev might have spent weeks polishing the wrong part.
7:27Guidelines people agree on
Evaluation guidelines have to be clear enough that two people reach the same verdict. When two agents first label the same fifty replies, they disagree on twelve, mostly about what counts as "resolved". So the team sharpens the definition: resolved means the question is fully answered, or a correct next step is given with a time frame. They add worked examples of borderline cases, and relabel. Disagreements drop. If people can't agree on what good looks like, no automatic metric can measure it.
8:03Shelves of test sets
A mature evaluation pipeline keeps several test sets, each answering a different question. The golden set asks: are we good overall? Slices ask: is any group of customers being left behind? Hard cases, collected from real failures, ask: did we fix what broke? The red-team set asks: can we be manipulated? And fresh samples from production ask: has the world changed since we built the others? One test set can't answer every question.
8:36A gate that respects noise
Brightcart's automated evaluation runs on every prompt change. Policy accuracy on the two-hundred-and-fifty-ticket golden set is ninety percent. A new change scores eighty-eight. Should the build fail? Pause. Not on that alone. With two hundred and fifty cases, scores naturally wobble by around four points either way. Set the gate to fail only on drops larger than the noise, or automatically re-run on more cases to confirm. A test that fails on random noise quickly trains everyone to ignore it, and then it can't protect you when something really breaks.
9:19How long will an A/B test take?
Brightcart wants to know whether a new version raises the resolution rate from seventy to seventy-three percent. It sends five percent of conversations to the new version. How long will the test take? Pause. To reliably detect a three-point difference, the new version needs about three thousand five hundred and fifty conversations. Five percent of fifty thousand a month is two and a half thousand, so the test takes about a month and a half. That's the reality of online testing: small improvements need lots of traffic, so decide in advance which differences are worth detecting.
10:01Reading production every day
Numbers aren't enough; someone should read real conversations every day. Brightcart handles about sixteen hundred and sixty-seven conversations a day. A random one percent is about seventeen, small enough for one person to review, plus every conversation flagged by the automatic checks or rated badly by a customer. Each failure gets a label, and the worst join the hard-case shelf. A short weekly meeting shares what the team saw. Reading production is how you discover the problems your test sets never imagined.
10:35Evaluating multi-step tasks
Some requests take several steps. "Change my delivery address and tell me when it'll arrive" means finding the right order, checking whether it has shipped, calling a tool to update the address, and confirming the new date. Brightcart evaluates each step: the right order, the right tool with the right details, a date taken from the system rather than invented. Then it checks the outcome: did the address actually change in the database? A friendly confirmation means nothing if the update never happened.
11:09The pipeline, end to end
Here's the whole pipeline. Every change triggers an automated run across the golden set, the slices and the red-team set, with checks, a judge, latency and cost. The scorecard, with error bars, is compared against the current version. If the gates pass, the change goes to a small online test with guardrails, and then to everyone. Meanwhile, daily sampling of production feeds new failures back into the test sets. Every failure makes the tests stronger, and that loop is what turns a demo into a dependable product.
11:47Better offline, flat online
Prompt version eight beats version seven by four points on the golden set, more than the noise. But in the live test, resolution and satisfaction don't budge. Why might that be? Pause. Perhaps the golden set no longer matches what customers actually ask. Perhaps the improvement was in a category that rarely comes up. Or perhaps policy accuracy wasn't what was holding satisfaction back; maybe it was speed, or tone. Offline evaluation predicts online results only as well as your test sets resemble reality, so keep comparing the two, and update the test sets when they drift apart.
12:32Myth vs Fact
Myth: once you've evaluated the model, you're done. Fact: prompts change, documents change, models get updated, customers ask new things. Evaluation is a pipeline that runs continuously, not a report you write once.
12:48Recap
Let's recap. Evaluate every component of the system as well as the end result. Write clear guidelines with rubrics and examples. Organise evaluation data into a golden set, slices, adversarial and regression sets, and production samples. Check that the evaluation itself is reliable and valid, with bootstrapped confidence intervals. Automate it to run on every change, with gates that block regressions. And keep evaluating after launch, with shadow runs, A-B tests and feedback, turning every new failure into a test. One sentence to remember: nothing ships without being measured, and every failure becomes a test.
13:32Next: prompt engineering
Mission complete. Brightcart's evaluation now runs automatically: a quick check on every change, a full suite before release, results by slice, release gates, and continuous evaluation once live. And that completes Module Sixteen. With measurement in place, we can finally start improving the assistant, beginning with the cheapest and fastest tool of all: what we say to it. Prompt engineering, starting with in-context learning and the anatomy of a prompt. See you on the map.