Case study
ai-evals: testing AI assistants that never answer the same way twice
I run AI assistants on three production sites. Ask one the same question twice and you get two different answers, so an ordinary test, which asks once and checks the answer, can’t tell you whether it works. I built ai-evals to answer that question before every release, and published it so others can use the approach.
- Project
- Open source (Apache 2.0), on GitHub
- Tests
- The AI assistants on eireford.com, wedocompute.com and lesspane.com
- Built with
- promptfoo, Node.js, Gemini on Vertex AI as the judge
- Used as
- A release gate: every assistant change passes on staging before it reaches the live site
How it works
Ask more than once
Every test runs several times. Facts, prices and safety must pass every run; tone and helpfulness must pass two of three. A test that passes only sometimes counts as a bug, because a customer gets whichever answer comes up.
A judge that is checked first
An AI judge grades the open-ended answers, but before each run it grades answers a person already graded. If it disagrees with the person, its grades of the real answers aren’t trusted.
Cheapest check first
Exact text and patterns catch most mistakes for free. The AI judge is used only where wording legitimately varies, and every judge instruction says exactly what fails.
An independent price list
For LessPane, a separate copy of the pricing formula is the answer key, checked against the live site before every run, and each price question is asked several ways.
Safe to run anywhere it is allowed
Tests that make bookings run only against a local copy of the site. Everything else is read-only and paced under each site’s rate limit.
AI agents as customers
A model plays a customer’s own AI assistant and orders from LessPane over MCP. The tests check what it did (which tools, with what details, how many bookings), not only what it said.
What it found
- A real defect: asked about a full-time job, an assistant gave an email address but not the résumé link. Fixed.
- A bug in a test: a comma in a test file cut a two-part question in half, so a correct assistant looked wrong. The suite now tests its own tests, and the prompt change made for the false alarm was reverted.
- Three over-strict grading rules that failed good answers. Each was narrowed, with a new example for the judge.
- A staging deploy that finished out of order and served an older version. Caught before release.
- In an AI-agent ordering feature: "next Tuesday" booked on a Wednesday, and retries matched by a guessable id. Both fixed before release.
After the first round of fixes, a full run against staging had no failures and no flaky tests in 117 graded answers. The lessons apply to any team shipping AI: evals are code and have bugs, read the actual answer before fixing anything, and keep only the fixes a real failure justifies.
Have an AI feature in production?
I can build the same for yours: tests written around what your assistant must never get wrong, run before every release, and a plain report of what they find. Write to info@wedocompute.com.