
The problem
The first question from a new customer is how much history they need before the predictions are worth using. A demo that runs on years of data cannot answer it, and a vendor's promise is not an answer either.
The question has a measurable answer per field. Some fields are predictable from a few weeks of data; others need months. Knowing which is which decides what to automate on day one and what to keep in review.
How it works
_evaluate holds out part of the tenant's own history and predicts it from the rest, so the answer is "what would this tenant get today, with the data it has?" Because the evaluation is a query rather than a training run, it can be rerun whenever the history grows.
The same check runs in a real onboarding: evaluate on the history the customer has, and start automation on the fields that already clear the bar.
{
"testSource": {
"from": "purchases",
"limit": 200
},
"evaluate": {
"from": "purchases",
"where": {
"supplier": { "$get": "supplier" },
"description": { "$get": "description" },
"amount_eur": { "$get": "amount_eur" }
},
"predict": "cost_center"
},
"select": ["accuracy", "baseAccuracy", "cases"]
}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 ERP.
See it live
This use case runs in the 📋 ERP demo today. Click through to the live application and inspect the queries that produce the result.
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.
Add cold-start check to this codebase using Aito, a predictive database. The feature: show how accurate the cost center, account code and approver predictions would have been with only a week, a month, three months or a year of our history, each tested on the month that followed, against the base rate. 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/cold-start-check/ 4. Use this reference implementation as the pattern (schema, data load and queries): https://github.com/AitoDotAI/aito-erp-demo/blob/main/src/app.py and https://github.com/AitoDotAI/aito-erp-demo/blob/main/src/aito_client.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.



