DataFocus · Journal
How to Check Where an AI Data Answer Came From: SQL, Tables and Fingerprints
A four-step routine for checking an AI-generated number: read the SQL that ran, confirm the tables, compare the definitions, and keep the data fingerprint so the figure can be re-checked later.
To check where an AI data answer came from, ask for its receipt and read four things in order: the SQL that actually ran, the tables that SQL touched, the business definitions behind each measure, and a data fingerprint that lets you confirm later that the same rows were used. DataFocus states that every query in its ontology products returns the SQL that ran, the tables it used and a data fingerprint (product brief); the routine below works with any tool that exposes those same items. If an answer comes with only prose and a number, you have nothing to verify, and the number should be treated as unchecked.
What does a query receipt contain?
A receipt is the record a system keeps about one question and the data work done to answer it. The DataFocus homepage describes it this way: every call records sources, definitions and the returned scope, and every change records before and after, the diff and who approved it (datafocus.ai). The product brief adds that every query has a receipt, every change has an approval record, and agent actions also go to an audit log.
For an analyst, the useful fields are these:
| Receipt item | What you check with it |
|---|---|
| SQL that ran | Filters, joins, grouping, time window |
| Tables used | Whether the source is the one you expect |
| Definitions cited | Whether "revenue" or "active customer" means what your team means |
| Returned scope | Which rows and period the answer covers |
| Data fingerprint | Whether a later re-run sees the same data |
The brief's own example is a demo on built-in sample data, in Chinese. A business user in Data Search and an agent (Claude Code through MCP) obtained matching totals by requesting department: Operations Support 7,842,000, Procurement 6,966,000 and Digital 5,786,000 yuan. The agent's answer cited the SQL and a receipt field named evidenceRowsSha256. This is a published demonstration, not a customer result.
Step 1: How do I read the SQL?
You do not need to be a database engineer. Read the query in this order:
- FROM and JOIN. Which tables, and how are they linked? Every join needs a key you recognize.
- WHERE. Are the date range, status and region filters the ones you asked for? Silent filters (for example, only
status = 'paid') are a frequent reason an answer differs from the finance report. - GROUP BY. Does the grain match the question? "By department" should group by department, not by department and month.
- The aggregate.
SUM,COUNT(DISTINCT ...)andAVGanswer different questions. Check that the one used is the one you meant.
Here is a hypothetical example, illustrative and not run. You ask, "What was Q3 spend by department?" and the receipt shows:
SELECT d.name, SUM(p.amount) AS spend
FROM purchase_orders p
JOIN departments d ON d.id = p.dept_id
WHERE p.order_date >= '2026-07-01' AND p.order_date < '2026-10-01'
GROUP BY d.name;
Check: the date filter uses order date, not payment date; the half-open range covers the whole quarter; amount is a purchase-order amount, which may or may not be the figure your finance team calls spend. Each of those is a question to settle, and each is answerable from the SQL alone.
Step 2: How do I confirm the tables are the right ones?
Compare the "tables used" list with where you would have gone yourself. Two failure patterns to look for in this kind of review:
- Right name, wrong layer. A raw staging table and a curated reporting table can both contain an
orderscolumn set. If the receipt names the staging one, the answer may include rows that the curated layer deliberately excludes. - Missing table. If your question mentions customers and the tables list has no customer table, the system filtered or grouped on something else.
DataFocus states that AI follows the objects and relationships defined in the ontology rather than guessing (product brief). The practical consequence for review is that the join paths you see in the SQL should match relationships someone modeled on purpose. A join you cannot find in the model is a reason to ask why it exists.
Step 3: How do I check the definitions used?
Most disagreements between an AI answer and a dashboard are definition disagreements, not arithmetic errors. DataFocus states that a business definition is set once and used by search analysis, dashboards, control panels, the ontology agent and external agents, so that they all produce the same figures (product brief). Whether or not you use that product, apply the same test:
- Find the definition the answer cites (for example, "net revenue = gross revenue minus returns").
- Compare it with the definition on your existing dashboard or report.
- If they differ, decide which one is correct and fix the source of the definition, not just this one answer.
In the Flash manual, the Answers module in an ontology has an Import External button that brings in answers already saved in the BI Workspace, and Pinboards and Data Apps have matching import buttons (manual r57). That gives you a way to put an existing, trusted answer next to a new one and compare the two receipts line by line.
Step 4: How do I spot a wrong join?
A wrong join rarely produces an error. It produces a plausible number that is too large or too small. Three quick checks:
- Fan-out. Joining a one-row-per-order table to a one-row-per-line-item table repeats the order amount for every line. If the total is far above the source system's total, suspect this first.
- Dropped rows. An inner join discards rows with no match. If a department has no match in the lookup table, its spend disappears from the result.
- Row-count sanity. Count the rows in the main table for the same filters and compare. After a join, the count should change only in ways you can explain.
A hypothetical illustration, not run: if a purchase order with a 1,000 amount has three line items and the query sums the order amount after joining to line items, the order contributes 3,000. The SQL shows the join; the fix is to aggregate at the right grain before joining.
What is the data fingerprint for?
The fingerprint answers a different question from the SQL. The SQL says what was asked; the fingerprint says what data came back. Store it with the number in your report. When someone asks next quarter why a figure moved, a matching fingerprint on a re-run suggests the returned data is unchanged, while a different one points to changed rows, so look at the load history before suspecting the logic.
Why keep receipts at all?
Beyond your own review, record-keeping is a regulatory theme. Article 12 of the EU AI Act says high-risk AI systems "shall technically allow for the automatic recording of events (logs) over the lifetime of the system" (Regulation (EU) 2024/1689, Article 12). Most analytics questions are not high-risk systems under that Act, so this does not mean your dashboards are covered. It does show the direction: logs that let a person reconstruct what a system did are becoming an expected property.
When should I escalate?
Escalate to the data owner or the modeling team when:
- the SQL joins tables with no relationship you can identify;
- the definition cited differs from the one finance or the business uses;
- the total differs from a trusted source and the difference is not explained by filters or timing;
- a re-run returns a different fingerprint and nobody has reported a data load;
- the answer has no receipt at all.
Do not patch these in the report with a manual adjustment. The receipt gives you a precise question to send: which line of the SQL, which table, which definition.
Limits of this routine
Reading a receipt shows what was computed, not whether the underlying data is correct. A clean query over a table with duplicate rows still gives a wrong total. Fingerprints detect change, not error.
Next step
Read the product brief for how receipts, approvals and audit logs fit together, and the Flash manual for the Answers, Pinboards and Data Apps modules.