Writing / Stem field notes

Your AI product should get smarter every time it fails.

A bad output is evidence about how the product should work. Stem, the AI system I run every day, has recorded 844 runs that scored below 0.9, its own pass bar, since June 10. The lessons worth preserving have become an 83-case evaluation suite that every future change has to survive. The teams that turn failures into executable knowledge compound faster than the teams that fix what broke and move on.

01 / The mistake

Most failures disappear without teaching the product anything.

A bad output happens. Someone catches it. Maybe it lands in Slack. Maybe a PM opens a ticket. Maybe an engineer tweaks the prompt until that one example works again.

Problem solved, apparently.

The symptom is gone, a human did the repairing, and the system knows nothing it did not know before. That is maintenance.

A failure should leave something behind.

I learned this building Stem, my own AI system. On June 10 its retrieval eval fell from 83% to 33% the day I switched the model to JSON tool calls. The obvious reading was that JSON mode made the model worse. Revert it.

The transcripts said otherwise. Stem’s own grep had returned (no matches) for a string that sat in four files. Two runs had ended in under three seconds with a full plan in the model’s reasoning channel and nothing in its answer, and the loop had treated empty as final. One gold answer no longer matched a file the pipeline rewrites during the day. Three harness bugs, one stale fixture, zero model bugs. After the fixes: 100%, and faster.

That day changed the question I ask after a failure, from “how do I fix this output?” to “what did this failure teach me about the product?”

02 / The definition

Own the definition of good.

That incident is what evals discipline is built to catch, and the discipline starts before any failure happens.

The core move is simple to say: own the definition of good, then turn that definition into a system that can be run again and again.

Strip the jargon and an eval is a test with opinions. A task is one test case, a trial is one attempt at it, a dataset is a pile of tasks, and a grader is the logic that decides whether the attempt was any good. The trace is the path the system took, the outcome is where it ended up, and the harness is the plumbing around all of it. That is nearly the whole vocabulary.

The dataset is where the leverage lives. A golden set is assembled from real user cases, historical examples, known failures, edge cases, and the scenarios where a miss actually costs money or trust, never from imagined usage.

Graders come in a hierarchy, cheapest first: deterministic checks, then rules-based checks, then an LLM judging another LLM once it is calibrated against human labels, with humans themselves at the top, spending the scarce resource on judgment.

Run evals at three altitudes too. Capability evals ask whether the system can do a class of task at all, regression evals ask whether yesterday’s change broke last month’s win, and production evals ask how the thing performs on real traffic, which is always weirder than the dataset.

One rule I now apply to everything: every meaningful eval should be wired to a decision. Launch, rollback, model choice, routing, scope, permissions, escalation, roadmap. If no decision would change based on the result, the eval is a dashboard ornament and you can delete it without guilt.

03 / The loop

Make the lesson permanent.

Capturing the failure is the cheap step. The step that matters is generalizing it: one bad output becomes a statement of how the product should behave, and that statement becomes a case. Then the system has to prove it has not forgotten.

Learning loop / active
The production learning loop Six steps in a ring: production, observe failure, classify root cause, generalize into a rule, add a regression case, make the system change, and back to production. PRODUCTIONREAL BEHAVIOR OBSERVEFAILURE CLASSIFYROOT CAUSE GENERALIZERULE, NOT EXAMPLE REGRESSIONEXECUTABLE MEMORY SYSTEM CHANGEPROMPT / TOOL / UX

The loop runs nightly, on one machine.

04 / Memory

Your regression suite is institutional memory.

Stem used to re-read a file after editing it. Then read it again to be sure. Then again. I could add a line to the instructions, watch one run behave, and call it fixed.

That fixes an example. The product has learned nothing it can prove.

So the behavior became a case instead: edit-verify-once-no-reread-loop. Change one value in a config file, re-read it once, report done. Every routing and prompt change since July 1 has had to survive it. 85 runs, 85 passes.

Repeat that move and the suite becomes a record of everything the product learned the hard way: a file that does not exist getting summarized anyway, a README’s “production ready” taken on faith, a grader returning PASS because its engine was unreachable, a planted false premise answered instead of refuted.

The lesson lives in a test the next version has to pass.

Before launch, you test the failures you can imagine. After launch, users show you the ones you could not. Those failures are training data, and the thing they train is the organization that runs the product.

05 / Accumulation

Every lesson adds a test.

Failures are raw material. Regression cases are the lessons worth preserving: 83 of them as of August 26, up from 12 on June 11, and every new model, prompt, router, or tool has to survive all of them.

Regression ledger / 83 cases

The system must prove it remembers.

Five of them, with their full run record. A patch closes one incident. A case protects every version that follows, and one of these five is still losing.

07-01edit-verify-once-no-reread-loopone verify read after an edit, then stop85/85
07-01regression-grader-fail-closeda grader that cannot reach its engine fails closed77/79
07-02done-claim-requires-boot“production ready” is a claim until the service boots79/79
06-18honest-missinga missing file is reported missing, never summarized102/102
06-24research-refute-planted-falsea false premise in the question gets refuted2/11

The suite’s case count went from twelve in June to eighty-three by August, and every one of those numbers is a failure that stopped being able to happen twice.

The suite never forgets, so I get to.
06 / Diagnosis

The answer is not always a better prompt.

Remembering a failure is only useful if it gets classified correctly the first time.

If every bad output is treated as a model problem, the improvement loop becomes: bad answer, modify prompt, larger prompt, pray.

Every failed case in Stem gets its transcript read before anything is touched, then sorted into one of the four bins in the grid below.

One question sorts the first two bins fast: show the model its own failing output next to the correct one. If it can see the mistake, you probably have leverage in instructions, context, decomposition, or verification. If it cannot, stop squeezing the prompt and change the system around it.

You are debugging a system. The model is only one of four suspects.

Then agents showed up and my tidy single-turn evals stopped being enough.

An agent is a whole system: model plus instructions plus context plus tools plus state plus environment plus orchestration plus retries plus permissions plus budget. Grade only the final chat message and you are grading the press release.

The failure mode that teaches this fastest: an agent can tell you it succeeded while the file it promised never landed on disk.

WHAT THE AGENT SAYS WHAT THE DISK SAYS Wrote report-q3.md ✓ All 4 steps complete. Task finished. notes-aug.md suite.jsonl ledger.json report-q3.md ? GRADE THIS SIDE.
The transcript gives itself an A. The disk abstains.

The metric list widens too. Past raw task success you start tracking tool-call accuracy, unauthorized actions, turns per task, tokens per task, retries, latency, cost, human interventions, recovery rate, critical failures. An agent that succeeds after eleven retries and four dollars of tokens has a different problem than one that fails cleanly.

07 / Switchboard

Find the real failure surface.

The visible output is only the final link. Four bins, one verdict, one question. Hover each for the incident that earned it.

Failure classifier / the model is one suspect among many
01 / Bin

Harness bug

The model acted reasonably and the machinery betrayed it. Stem’s grep said (no matches) for a string in four files.

02 / Bin

Model limit

Correct inputs, wrong output it could not correct. Gemma wrote two quotes for three, four times, with the exact fix on screen.

03 / Bin

Stale data

The gold answer no longer matches reality. A fixture the pipeline rewrites intraday failed a correct answer.

04 / Bin

Stale environment

The running code has drifted from the code you edited. A restart never happened, so the failure reproduced identically after the fix.

05 / Verdict

Ceiling

Prompt and harness both failed. Date it, route around it. Gemma is never the code lane, re-tested on every model bump.

06 / Question

Can it see it?

Show the model its own failing output beside the correct one. If it can see the mistake, instructions and context still have leverage. If it cannot, change the system around it.

08 / The trap

The anchoring trap.

A decision-wired eval is only as good as who gets to say what counts as correct.

One trap I only saw after falling into it: anchoring eval cases to what the agent had already done quietly freezes yesterday’s mediocre behavior into a test suite that defends it. The fix is anchoring every case to an answer the user has ratified as correct, so the suite argues for the person the system serves.

09 / Arithmetic

The arithmetic that humbles everybody.

And then there is the arithmetic that humbles everybody. Chain five required steps that each succeed ninety percent of the time, with independent failures, and the whole run lands near fifty-nine percent. Ninety percent felt solid at every step, and the pipeline still hands you a coin flip and change.

END-TO-END SUCCESS / EACH STEP AT 90% 100%90%81% 73%66%59% STARTSTEP 1STEP 2 STEP 3STEP 4STEP 5
Every step at ninety percent. The pipeline had other plans.

That one line of math rewired my reliability instincts. A ninety percent step feels great in a spreadsheet. Multiply a few of them and you understand why multi-step agents need a different reliability posture than single-turn chat, and why recovery behavior matters as much as first-try accuracy.

None of that arithmetic matters if the lessons it produces evaporate after the fix ships.

10 / Compounding

Two companies can start with the same model and end with different products.

Company A handles problems as they appear. Users report bugs, engineers fix them, incidents close.

Company B reproduces each meaningful failure, classifies the cause, writes down the expected behavior, adds a case, changes the system, and re-runs everything the product already learned before going back to production.

Run both forward eighteen months. Company B holds a library of failure cases, sharper definitions of quality, routing heuristics for its own domain, and a record of when humans should step in. None of it shipped with the model.

Anyone can access tomorrow’s model. Eighteen months of learning only comes from running the loop.
11 / Eleven weeks

Twelve cases in June. Eighty-three in August.

Every one of those steps is a committed entry in Stem’s own regression record. The count matters less than the behavioral coverage it represents. The flat stretch from July 6 to August 17 is six weeks spent on other work, and the suite kept running and kept passing through all of it.

Regression cases in the suite / by commit date2026-06-11 to 2026-08-26
Regression cases in Stem’s eval suite over time A step chart. Twelve cases on June 11, 2026, rising to seventy-five by July 6, flat until August 17, then eighty-three by August 26. 0255075 Jun 11Jul 1Aug 1Aug 26 12 cases / Jun 11 83 cases / Aug 26 Jul 6 to Aug 17: no new cases, suite still running

Twelve cases in June. Eighty-three by August. Six weeks in between with no new cases, and the suite kept running through all of it.

12 / The moat

How quickly can your organization convert failure into learning?

AI systems are going to fail. The interesting question is what happens next.

You build the system. Then you build the machinery that helps the system teach you how to build its next version.

Your AI product should get smarter every time it fails. Getting smarter is the organization’s job, and it has to be wired into the product.

Numbers as of 2026-08-28, drawn from Stem’s own eval run history and regression suite. Case ids are real.