
The problem
When a reviewer corrects a predicted GL code or approver, the correction usually disappears into the ledger. It fixes that one invoice and teaches nobody anything. Yet a run of corrections pointing the same way is the clearest signal a team gets that a rule is missing or a pattern has shifted.
The corrections are data. Asked the right question, they say which vendor keeps getting recoded, to what, and by whom, which is exactly what a rule author needs to know.
How it works
Each override is stored as a row: the field, the predicted value, the corrected value, and the context of the invoice. _relate over that table finds which corrected values co-occur with which context, and a second _relate looks for the driver behind the strongest ones. A pattern that keeps recurring surfaces as a rule candidate for review, next to the plain counts of overrides by field and by corrector.
Mining the overrides adds a governance step on top of the predictions: a human decides whether a recurring correction should become an explicit rule.
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 accounting.
See it live
This use case runs in the 🧾 Accounting 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 override mining to this codebase using Aito, a predictive database. The feature: log every correction users make to a prediction and surface the recurring patterns, which values people correct to and what drives it, as rule candidates. 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/override-mining/ 4. Use this reference implementation as the pattern (schema, data load and queries): https://github.com/AitoDotAI/aito-accounting-demo/blob/main/src/quality_service.py and https://github.com/AitoDotAI/aito-accounting-demo/blob/main/src/app.py and https://github.com/AitoDotAI/aito-accounting-demo/blob/main/src/data_loader.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.



