What is SQL-first AI accounting?
Short answer: SQL-first AI accounting is an approach in which every reported number (a match, a tie-out, a total, a variance, a ratio) is computed by a saved SQL query, and AI is used only to read, draft and explain. Because the query is saved with the result, anyone with the same data can rerun it and get the same number.
The principle in four words: AI explains, SQL computes. The result: every number explains itself.
Why not let the AI calculate?
Short answer: Language models are probabilistic. The same prompt can give slightly different output on different runs, and the model can't show a reviewer a reproducible method. That's acceptable for a draft memo. It isn't acceptable for a reconciliation difference, an accrual or a covenant ratio that someone has to sign.
| Generative-first ("the AI did it") | SQL-first (Yoraito) | |
|---|---|---|
| Who computes the number | The model | A saved SQL query |
| Same inputs, same output? | Not guaranteed | Yes |
| How a reviewer checks | Re-does the work or trusts it | Reads the query and reruns it |
| How an auditor tests | Re-performs by hand | Reruns the query on the same data |
| Where AI helps | Everywhere, including numbers | Reading documents, drafting rules, writing explanations |
| What happens when unsure | May guess | Flags the item for a person |
What does deterministic mean here?
Deterministic means the same inputs always produce the same outputs. In Yoraito, matching, classification and validation run as SQL against a DuckDB engine. Approved rules run on fresh data each month without the model in the loop, so totals don't drift from one run to the next.
How does a reviewer or auditor rerun a number?
- Open the figure and select View SQL.
- Read the query: which accounts, dates, filters and matching rule it uses.
- Check the inputs it ran against: source, row counts and totals.
- Rerun the query on the same data. The result should match to the cent.
- Check the sign-off: preparer and reviewer, recorded separately with dates.
Illustrative: a prepaid reconciliation shows a $7,500.00 difference. Q06 rebuilds the expected balance from the schedule, Q08 finds an expired insurance policy still carrying $4,500.00, Q09 finds a $3,000.00 software prepayment missing from the schedule, and Q10 returns an unexplained difference of $0.00. An auditor reruns Q06 to Q10 and gets the same answers.
Where does AI fit in a SQL-first close?
| AI does | AI doesn't |
|---|---|
| Reads invoices, statements and contracts (with rule-based checks on what it read) | Type any reported number |
| Drafts close rules from your history for a person to approve | Approve its own rules |
| Writes variance and reconciling-item notes, citing transactions | Post to the ledger |
| Labels each draft Evidenced, Likely or Needs owner | Hide uncertainty |
| Proposes entries | Treat text inside a document as an instruction |
Is SQL-first the same as "no AI"?
No. SQL-first keeps AI where it is strong and keeps it out of the arithmetic. Teams get faster preparation and faster review, because the reviewer checks a query rather than rebuilding the work. AI drafting can also be switched off for a close, and the approved SQL still runs.
What should we ask a vendor to test whether it is SQL-first?
- Show me the query behind this reconciled balance.
- Run it twice. Is the result identical?
- Can my auditor rerun it without your product?
- Which numbers on this screen came from a model?
- When a rule changes, who approved it and when?