On this page
TL;DR
- Why evals: The agent's answer changes from run to run, so we test what it does in the store, not the exact words it says.
- What a case is: A starting state, what the shopper writes, and what must happen: tools called, products shown, the cart, what it says.
- Who grades it: Code checks tool calls, products and the cart. A judge model checks the reply against the tool results.
- More than once: Each case can run several times, with a minimum number of passes.
- Graded again for free: A saved run can be graded again without calling the model.
Why can't you test an agent like the rest of the code?
A unit test calls a function and compares the result with an expected value. The shopping assistant's result is a conversation, and the same question can get a different answer each time: other words, other order, sometimes another tool first.
What must not change is what the agent does. If a shopper asks for two caps, the cart must end with two caps, whatever the reply says. If the size they want is sold out, the cart must not end up with it.
That's what an eval checks: an acceptance test that looks at the agent's actions and the state of the store, not at the wording of the reply.
What does an eval case look like?
A case has three parts: the state the store starts in, what the shopper writes, and what is expected. This one is from our test suite, over the Sylius demo catalog. The shopper has seen the Apollo T-Shirt and asks for a size that is sold out:
{
"id": "stock-002-size-sold-out",
"priority": "high",
"state": { "seen_products": ["Apollo_T_Shirt"] },
"turns": ["I'd like the Apollo T-Shirt in XXL, please add it to my cart."],
"expected": {
"cart_not_contains": ["Apollo_T_Shirt"],
"rubric": "PASS if the agent says the Apollo T-Shirt is sold out in XXL and offers an alternative that is in stock in the tool results (the XL, of which one is left, or another tee). FAIL if it says the XXL was added, offers the XXL as available, or adds another size without the customer agreeing."
}
}The agent must not add the T-shirt, must say the XXL is sold out, and must offer something the store has: the last XL or another tee. It can't add the XL on its own, because the shopper didn't ask for it.
The test suite covers searches, budgets, the cart, out-of-stock products, orders, policies, buying guides, prompt injection and handing a case off to a person.
Who decides if a case passed?
Most expectations are exact: which tools were called, which products are in the cart and how many units, which topic a handoff was opened with. Code checks those, with no room for opinion. In the case above, that's the cart.
What the reply says can't be measured that way. For that, a case has a rubric in plain language, and a second model, the judge, reads the conversation with the tool results and decides:
"rubric": "PASS if the agent says the Apollo T-Shirt is sold out in XXL and offers an alternative that is in stock in the tool results (the XL, of which one is left, or another tee). FAIL if it says the XXL was added, offers the XXL as available, or adds another size without the customer agreeing."We use the judge only where code can't decide, because the judge is a model too and can get it wrong.
How to run the eval suite
You run the cases from the console:
bin/console agent:eval
Each run reports the cases passed per priority, and also what the agent spent: cost per turn, rounds per turn, cache hit rate and time per turn. A change that keeps every case green but doubles the cost per turn also shows up.
Run each case more than once
The model isn't deterministic: a case can pass once and fail the next time. With --trials, each case runs several times, and with --min-pass it passes only if it passes at least that many of them:
bin/console agent:eval --priority=critical --trials=3 --min-pass=2Grade a saved run again for free
Every live run is saved with its recordings and the judge's verdicts, and --replay grades a saved run again without calling any model:
bin/console agent:eval --replay=var/evals/eval-20261002-101500.jsonIt's useful when you change an expectation and want to see how it grades answers you already have. A rubric keeps its stored verdict only while the judge model and the rubric stay the same; if either changes, the judge reads it again.
How do you write evals for your own store?
A case only means something against your own catalog. The cases in our test suite are a starting point: copy the ones that apply, and change the products, the messages and the language to your store's.
The eval runner is part of the open-source core, odiseoteam/ai-conversational-agent-bundle, so any agent built on it can be tested the same way.
What's next
In the next posts:
- What the store sees after each conversation: the transcripts, the statistics and handing a case off to a person on the store's team.
- Version 1.0: the plugin is at 0.6, and 1.0 is close. It's the milestone we've been building toward.
- The launch: how to install the plugin and how it will be distributed.
Not on Sylius, or not running a shop? The same foundation runs dedicated agents on other stacks and for other jobs: shopping, after-sales, customer support, or an assistant for a site that sells nothing at all. They run on your own infrastructure, not as a SaaS. Tell us what you need.