Building an Evidence-Driven AI Variance Engine in 3 Weeks for Mycroft
Over three weeks, Mycroft fellow Adwait Changan built a local agent that computes financial variances deterministically, traces every number to its source, and refuses to guess why the numbers moved.
Most finance AI demos promise to explain why a number moved. The Mycroft finance investigator, built by fellow Adwait Changan over three weeks, does something narrower and more deliberate: it computes exactly how the numbers moved, traces every figure back to its source, and then stops, handing the "why" and the sign-off to a human. The interesting part of this project isn't that it does the math. It's where it stops.
Week one: building books before building an engine
Before any engine can find a variance, it needs books to read. The first week was spent building six synthetic datasets from scratch, no real company data required: budgets, actuals, and the underlying ledger transactions, plus customers, headcount, and the account mappings that tie a raw transaction to a line on the income statement. These weren't just spreadsheets. Every table shipped with a schema, a provenance record noting where each number came from, and validation rules that a row had to pass before it could ever reach the engine. The first run validated 43 data rows across the six synthetic datasets, and any row that failed validation simply never made it into the pipeline.
Week two: a deterministic variance bridge
The second week built the actual math engine, designed so that the same inputs always produce the same answer, with no model guessing involved anywhere in the middle. The engine computes four variances: revenue, expense, payroll, and EBITDA. It then does the less glamorous but essential work: applying materiality rules so a two-dollar gap doesn't get flagged the same way a hundred-thousand-dollar one does, reconciling control totals so the parts still sum to the whole, and tracing every calculated number back to the source records it came from. The sample run produced a clear headline: budgeted EBITDA of $350,000 against actual EBITDA of $230,000, a gap of $120,000. The engine's job was to decompose that $120,000 bridge, showing exactly how much of the gap came from revenue, how much from expense, and how much from payroll, all the way down to the underlying transactions.
Week three: wrapping the engine in an agent
The third week wrapped the deterministic engine in a local, evidence-driven agent, running with no external model in the loop. The agent is conditional: it selects which finance tools to use based on what the data actually shows, not a fixed script. As it works, it retains evidence records and an execution trace of every step it takes. At the end, it produces two reports from the same run: one machine-readable, meant for the next system in a pipeline, and one human-readable, meant for a reviewer. The sample run generated seven investigation steps, retained 41 evidence references, and passed 12 tests. Every claim in the final report points back to a specific record; nothing gets asserted that the trace can't support.
The boundary is the design, not a limitation
The project's core claim is that Mycroft is an evidence engine, not an oracle. It validates the underlying books, computes variances deterministically, and shows its full work, from budgeted EBITDA all the way to actual, traced back to source. What it deliberately does not do is tell you why revenue missed its target, or sign off on the result. It explains the mathematical performance bridge and hands business causation and final approval to a human finance reviewer. That's stated as an intentional design choice, not something the system fell short of.
A stated caveat
One caveat is stated plainly: this is a synthetic sample and a draft workflow. Materiality judgment, causal explanations for why numbers moved, and distribution of the final reports still require a named human finance reviewer in the loop. The system computes and traces; it does not judge or approve.
Key takeaways
- The project built six synthetic financial datasets with schemas, provenance records, and validation rules before any variance math was written, validating 43 data rows in the first run.
- The variance engine is fully deterministic, computing revenue, expense, payroll, and EBITDA variances the same way every time, with materiality rules and control-total reconciliation built in.
- A sample run bridged a $120,000 gap between budgeted EBITDA ($350,000) and actual EBITDA ($230,000), tracing the gap to its component causes.
- The agent wrapping the engine runs locally with no external model, retains an evidence trail, and produces both a machine-readable and a human-readable report from each run.
- The sample run logged seven investigation steps, 41 retained evidence references, and 12 passed tests.
- The system deliberately explains the math and traces the numbers but does not assert business causation or sign off on results; those steps are reserved for a human finance reviewer.
Try it yourself
The closing challenge is to design your own version of this boundary: build a deterministic finance variance engine that traces every calculated number back to a source record, wrapped in an agent that retains evidence and writes both machine and human reports but never states a business cause it can't trace. This project is part of the Mycroft Financial AI initiative from Humanitarians AI Fellows.
Chapters
- 0:00Intro: Designing an evidence engine, not a forecasting oracle
- 0:30Week 1: Creating synthetic ledger databases with strict schemas
- 1:15Week 2: Building the deterministic variance math bridge
- 2:00Week 3: Wrapping the engine in a local, evidence-driven agent
- 2:45Generating dual outputs: Machine JSON and human-readable Markdown
Full transcript(auto-generated, with timestamps)
Intro: Designing an evidence engine, not a forecasting oracle
[0:00]This is onyx in for humanitarians AI. This week, fellow Edwait Changen built the Mikraftoft finance investigator over three weeks from an empty folder to a local evidence-driven agent that turns raw financial data into an evidencebacked variance report. The interesting part isn't that it does the math, it's where it stops. It explains the numbers and hands the why and the sign off to a human. Act one, the synthetic ledger. Before an engine can find a variance, it needs books to read. Week one, built them from scratch. Six data sets. No real company required.
Week 1: Creating synthetic ledger databases with strict schemas
[0:31]Budgets, actuals, and the ledger transactions underneath them, plus customers, headcount, and the account mappings that tie a raw transaction to a line on the income statement. Synthetic, but shaped like the real thing. What makes it a data set and not a spreadsheet? Every table ships with a schema, approvements record saying where each number came from, and validation rules. The first run validated 43 data rows across six synthetic data sets and a row that fails validation never reaches the engine. Act two, the deterministic engine. Same inputs, same answer every time. No model guessing in the middle. The engine computes four variances, revenue, expense, payroll, and eBa. Then does the unglamorous work. It applies materiality rules so a $2 gap
Week 2: Building the deterministic variance math bridge
[1:15]Isn't flagged like a $100,000 one. reconciles control totals so the parts still sum to the whole and traces every calculated number back to the source records it came from. Here's the headline the sample produced. Budgeted EBITA 350,000 actual EBITa $230,000 a gap of $120,000. The engine's job is to show you that bridge decomposed how much came from revenue, how much from expense, how much from payroll down to the transactions. Act three, the investigator. Week three, wrap the engine in a local evidence-driven agent that decides what to look at and writes down why. It's a local evidence-driven agent, no external model in the loop. And it's conditional. It selects finance tools based on what the data shows, not a fixed script. As
Week 3: Wrapping the engine in a local, evidence-driven agent
[2:00]It works, it retains evidence, records, and execution trace of every step. And at the end writes two reports from the same run, one machine readable for the next system, one human readable for the reviewer. The sample run is a receipt you can audit. Seven investigation steps, 41 evidence references retained, 12 tests passed. Every claim in the final report points back to a record. Nothing is asserted that the trace can't support. The verdict: Mikra is an evidence engine, not an oracle. It validates the books, computes the variances deterministically, and shows its work, the full bridge from budgeted EBITa to actual trace to source. What it deliberately does not do is tell you why revenue missed or sign off on the result. It explains the mathematical performance bridge and leaves business causation and final approval to a human finance reviewer. That boundary is the
Generating dual outputs: Machine JSON and human-readable Markdown
[2:46]Design not a limitation. One caveat stated plainly, this is a synthetic sample and a draft moft workflow. Materiality, causal explanations, and distribution still require a named human finance reviewer. Your turn. Paste this into Claude and think about the boundary before you build. Design a deterministic finance variance engine that traces every calculated number back to a source record and an agent that retains evidence and writes both a machine and a human report but never states a business cause it cannot trace. The hard part isn't the math. It's deciding upfront exactly where the machine should stop. Building the MRO finance investigator from financial data to an evidence-backed agent. This is Onyx in for humanitarians AI.
More from Mycroft Financial AI
3:16How to Test Mycroft's Finance AI Agent: Breaking the Books on Purpose
3:18Deterministic What-Ifs in Mycroft: Scenario Analysis Without AI Guessing
3:17Mycroft Update: Why Your AI Agent Ignores Your Code
3:47Fencing the AI: Why Our Finance Agent Cannot Approve Itself
3:53Refusal by Design: Implementing 15 Failure Safeguards in AI for Mycroft
2:17