local AItestingautomation

I grade my AI every night with questions I already know the answers to

After my home AI scored 72% in my head-to-head test, I wasn't happy. I wrote this to myself:

A 72% score is not accurate. How do we improve future answers before they give wrong answers?

The answer was to stop testing occasionally and start testing every night.

The nightly routine

  1. 1:30 am: a script picks yesterday's real questions: up to 10 from my team and 4 of mine.
  2. My backup AI server answers each one twice, because a model that gets it right once and wrong once isn't reliable.
  3. 7:30 am: Claude grades every answer against the actual database.
  4. I get an email only if something missed. No news is good news.
  5. Every miss goes into a permanent re-test set, so it gets asked again until it's fixed.

On top of that, a weekly check runs Saturday night on a fixed set of 24 questions plus fresh ones, graded Sunday morning. That fixed set went from 19/4/1 on the first run to 21/3/0 a week later.

The question bank

Real questions are messy, so I also built a bank of questions where I know the right answer: 344 questions covering all 173 datasets in my warehouse. Each one has an answer key, a query I've verified by hand.

The trick: the answer keys run right before and right after the AI answers. Live data changes during the day, so a fixed answer would go stale. Six bank questions run every night.

The pilot scored 27 pass, 1 partial, 1 unsure out of 29. The "unsure" was my own fault: I'd worded the question ambiguously.

Writing the answer key was the real win

Just writing those verified queries surfaced about 60 problems in my data and documentation. I fixed 20 wrong-number issues in one afternoon. The AI hadn't even answered anything yet.

Most "AI mistakes" were data bugs

This was humbling. When I dug into the misses, a lot of them weren't the AI's fault:

  • A data feed was sending product names with HTML tags stuck inside them.
  • A time-zone mismatch shifted dates by a day for part of every evening.
  • An outdated note told the AI a column didn't exist, so it worked around a column that was right there.
  • Tax was hiding inside invoice line items, inflating sales.

And sometimes the answer key itself was wrong. Keys go stale when you change what a number means.

One sentence, big difference

The most common miss was the AI adding helpful-sounding side remarks with a wrong figure in them. So I added one sentence to its instructions, roughly: answer what was asked and leave out side remarks.

  • Wrong side remarks dropped from 42 to 26.
  • Answers got 22% shorter.
  • After a follow-up data fix, the same 16 answers went from 23 wrong remarks to 12, then to 7.

Surprises

The test polluted itself. My test replays were being logged under my name, so the next night's picker thought they were real questions I'd asked. I gave the test its own identity.

Follow-up questions don't replay well. A question like "and what about last month?" makes no sense without the conversation before it. One of those tied up a server for 21 minutes, so now every answer has a 10-minute cap. Asked as one clear question, the same thing mostly worked.

Bank vs. real: in mid-November, bank questions passed 90–100% at about 40 seconds each, while real questions passed only 50–60% at about 3 minutes. Real people ask harder, vaguer questions than the ones I write. That gap is exactly why I test both.

The cost of all this: Claude does the grading inside my existing setup, so there's no separate paid judge running up a bill.

What I'd tell you

  • When the AI "misreads" something, check the data first. It's often the data.
  • When its query matches the answer key but the numbers differ, suspect the time zone.
  • Only alert yourself when it's wrong, or you'll stop reading the alerts.
  • Fix it at the source, re-ask the same night, and never let a miss leave the test set until it passes.
← All articles