Experiment Readout

Compares two ways of showing a product, per showing and with an interval, so luck isn't mistaken for a winner. It also says honestly whether picking the version per shopper beats one winner for everybody.

Experiment Readout: screenshot from the E-commerce demo
🛒 E-commerce_search_predictE-commerce
In the demoIn the e-commerce demo, a 15 % offer on cat litter sold 851 times against 506 at list price on about 6,300 showings each, yet earned less per showing (€0.19 against €0.22; interval −€0.06 to −€0.01), so the view says keep the list price. Choosing the version per shopper does not pay with the signals the shop has: on a held-out month it earns +1.7 % on titles (0.5 to 3.0, a small gain), nothing on offers and −2.2 % on images, where a perfect signal would earn 5–12 %. Most of its experiments read no clear difference after four months. The showings are simulated.

The problem

An A/B test on a shop page is usually read off a dashboard that names a winner as soon as one arm is ahead. With a purchase rate near 5 %, thousands of showings an arm still cannot tell a 10 % difference from luck, so many winners are noise.

The next question is personalisation: instead of one winner for everybody, show each shopper the version that suits them. That only pays when the shop can see who prefers what, and most of the time it cannot tell well enough to beat the plain winner.

How it works

Each experiment stores its variants and every showing, with the shopper and whether they bought. The counts per arm come from Aito, and the difference of the second arm from the control is shown with a 95 % interval, so "no clear difference" is a reading, not a failure.

For choosing per person, _predict purchased given the shopper's signal and the arm shown is tested against the plain winner on a month it has not learned from. The page offers the per-person choice only where the interval is above zero and the gain is worth it, and says so where it is not. What-if controls project the split, the exploration floor and a guardrail from the counted arms.

For the full architecture, see the technology overview. For the broader narrative across multiple use cases, read The Predictive Application. For the whole picture, see predictive e-commerce.

See it live

This use case runs in the 🛒 E-commerce demo today. Click through to the live application and inspect the queries that produce the result.

Open the live demo →

Build it with Claude Code

Paste this prompt into Claude Code, or another coding agent, in your own codebase. It runs Aito locally from the Docker image, reads the API docs written for agents, and follows a working reference implementation.

Experiment readout: a prompt for Claude Code
Add experiment readout to this codebase using Aito, a predictive database. The feature: read out our A/B tests from the showings and purchases per variant, with an interval on the difference, and check whether choosing the variant per shopper beats one winner for everybody.

1. Run Aito locally: `docker pull ghcr.io/aitohq/aito`, then follow https://aito.ai/docker/ to start it with your own API keys (keep them in the environment, never in code).
2. Read https://aito.ai/docs/api/llms.txt for the v2 query shapes before writing any query.
3. Read the use-case guide: https://aito.ai/use-cases/experiments/
4. Use this reference implementation as the pattern (schema, data load and queries): https://github.com/AitoDotAI/aito-ecommerce-demo/blob/main/scripts/experiments_evidence.py and https://github.com/AitoDotAI/aito-ecommerce-demo/blob/main/src/experiment_stats.py
5. Find the matching tables in this codebase, design the Aito schema for them (links between tables where we have foreign keys), and load a sample.
6. Check the numbers before building the view: compare a few of them against a direct count over the same rows (SQL or a short script), and report any that differ.
7. In the UI, show the evidence behind each number (the counts, the interval or $why), and leave out patterns with too little data behind them.

Ask me before changing anything outside the new feature.