Skip to content
mentoor

The flywheel: production data back into evals

For engineers

Online evals, LLM judges, budgets and agentic RAG evaluation that feed the next release.

A chat assistant improves when every real failure becomes a test, every fix is checked against the tests, and every release is watched against a cost and speed budget.

The case

Loom & Lane sells furniture online. Lane is its support assistant: it answers delivery, returns and assembly questions from the help center, using retrieval over about 300 articles and a Claude model for the answers. It handles 6,000 chats a week. In November the return window changed from 30 to 14 days. Lane kept quoting 30 days, and nobody noticed for nine days, because only 72 chats a week get a thumbs-down.

The team builds a loop. Production produces failures, failures become eval cases, cases guard the next change, and the next release produces new production data. This is the data flywheel.

How the loop runs

1. Find the failures. Every chat has a trace id. Instead of waiting for votes, the team samples traces by signal: hand-offs to a human agent, regenerate clicks, judge failures and thumbs-down. They add a small random slice for failures no signal sees. They read the traces and give each failure a name, such as stale-return-window.

2. Judge live traffic. A model judge scores a random 25 percent of chats each week within a fixed budget. It asks one yes-or-no question per failure mode, writes a short critique first and then gives PASS or FAIL. The judge is not trusted on faith: it is checked against expert labels it has not seen, and its true-positive and true-negative rates are published next to its pass rate. A judge that passes 8 of 20 real failures overstates quality, even if it agrees with people 88 times in 100.

3. Make cases. Confirmed failures become regression cases. Names, phones and addresses are replaced with placeholders. The expected behaviour is written as a property ("states the window is 14 days"), and a grader checks it. The team also checks consent: a customer who opted out of training can still have an anonymised chat used for evaluation, but never for fine-tuning.

4. Test retrieval and answers apart. For each question the team labels the passage that answers it. Recall@k and MRR show whether retrieval found it. Faithfulness and refusal scores show whether the answer stuck to it. The set includes real customer wording and questions the help center cannot answer, where the right reply is a refusal.

5. Use search loops only where they pay. A question like "my Harlow sofa leg arrived cracked, when will a replacement reach my postcode?" needs sale terms, a damage policy, a product lead time and a delivery zone. Lane runs an agentic search for those. "What is the return window?" gets one retrieval. The loop has a step cap, a few snippets per search, and a rule to reword or stop when results are weak.

6. Hold a budget. Lane's value is the human chat it replaces, $3.00. The owner will spend 10 percent of that, so the ceiling is $0.30 per resolved chat, and the reply target is p95 under 3 seconds. The team reports cost per resolved chat, not per call, with retries and failed runs included. Averages are never used for latency, because a few slow replies hide in them.

Before and after

Before: a prompt edit, "always say 14 days", deployed to everyone on Friday afternoon, judged by whether the thumbs-down rate moved. After: nine anonymised cases added, the full suite run, the fix released to 10 percent of chats for two days, and hand-off rate, p95 and cost per resolved chat compared with the control.

What goes wrong

  • Thumbs as the only signal. Few users vote, and the ones who do are not typical. Hand-offs and resolution rates carry more weight.
  • An unchecked judge. Its errors become dashboard numbers and then eval labels. Calibrate it, and re-check when its model version changes.
  • Cases that leak or only echo. Raw personal data in a shared set is a breach, and a set made only of last week's bugs will not catch next week's.
  • Unbounded loops and tiny tests. A search loop with no cap can cost 18 times a normal chat, and an A/B test on 200 chats per side cannot separate a half-point gap from noise.

The loop only works with an owner and a cadence: someone reads the traces every week, and every release ends by feeding the next one.

Steps

  1. Mine production traces for failures

    Skill: llmops-flywheel

    Every chat has a trace id. Pull traces by signal: hand-offs to a human, regenerates, thumbs-down and judge failures, plus a small random slice. Read them, and group the failures into named categories such as stale-return-window or ignored-postcode. Names make the counts countable and the fixes assignable.

    One week of Lane traces by signal
    6,000 chats
    SignalChatsRead this week
    Handed to a human84060 sampled
    Regenerate31030 sampled
    Judge failed190all
    Thumbs-down72all
    Random slice600040 sampled
  2. Judge live traffic on a budget

    Skill: evals-online

    Run a judge asynchronously on a random sample of live chats, sized to a weekly spend. Watch the pass rate and alert when it drops. Send flagged chats to triage, read them, and keep only confirmed failures. Judge errors go to the calibration set, not the eval set.

  3. Write the judge as a binary rubric and calibrate it

    Skill: evals-llm-judge

    One judge per failure mode, with a short critique first and then PASS or FAIL, plus one example of each. Measure true-positive and true-negative rates on expert labels it has not seen, and correct the reported pass rate for them. Pin the judge version.

    Judge: return window

    Question

    Does the reply state the return window as 14 days from delivery, or decline to state one? Write two sentences of critique, then PASS or FAIL.

    Example FAIL

    "You have 30 days to return any item."

    Example PASS

    "Returns are accepted within 14 days of delivery."

  4. Turn failures into anonymised regression cases

    Skill: llmops-flywheel

    Replace names, phone numbers and addresses with placeholders. Write the expected behaviour as a property, attach a grader, tag the category, and check consent: an opt-out covers training, not evaluation. Keep the set balanced so it does not mirror last week's bugs only.

  5. Score retrieval and answers separately

    Skill: rag-eval

    Label the gold passage for each question, compute recall@k and MRR, then score faithfulness and refusals on the answer. Include real customer wording and unanswerable questions. When retrieval is fine and answers are wrong, the fault is in generation, and the reverse.

    RAG eval on 120 questions
    Run after the fix
    MetricBeforeAfter
    Recall@50.860.88
    Faithfulness0.930.94
    Correct refusals0.900.92
  6. Route multi-part questions to a bounded agent

    Skill: rag-agentic

    Send a question to the search loop only when it needs several dependent passages. Give the loop a step cap, a small result count per search and a rule to rewrite or stop when results are weak. Log every step so a bad run can be read.

  7. Set cost and latency budgets and ship in stages

    Skill: llmops-budgets

    Derive a cost ceiling per resolved chat and a p95 reply time from what a chat is worth. Alert on daily spend and p95, and cap each run. Ship each fix to a small share of traffic, check the budgets and the hand-off rate, then widen.

    Rollout plan

    Goal: Ship the stale-window fix safely

    1. 1. Rerun the offline suite; no category may drop.
    2. 2. Release to 10% of chats for two days.
    3. 3. Compare hand-off rate, p95 and cost per resolved chat with the control.
    4. 4. Widen to 50%, then 100%, if nothing regressed.
    5. 5. Name the owner of next week's trace review.

Skills this scenario uses

Where to study