Retrieved article excerpt
Open article · Retrieved 2026-11-20T07:21:21.037534+00:00
# Emails, spreadsheets, SQL: can AI agents connect the dots?
The answer hides across emails, Excel workbooks, screenshots and databases. The flagship model is not always the best one.
November 10, 2026
12 min read
**Content**
Can an AI agent open an Outlook email, follow it into an Excel workbook, query a database it has never seen and come back with the right number?
In my last post, [How to Build your Own LLM Benchmark](https://anaivebidder.com/posts/build-your-own-llm-benchmark/), I shared tips for building your own. I kept two things back: the model names and the benchmark itself. Today you get both.
Meet [**finrec-bm**](https://github.com/rubenafo/finrec-bm), my benchmark for financial reconciliation, now on GitHub. It hands AI agents a number to verify and a pile of evidence: emails, spreadsheets, screenshots and a database. The answer has to be right to the cent, with the paper trail to prove it.
25
model configurations
22
hand-written cases
550
agent runs
$13.65
test costs
## The job in 60 seconds
Every company keeps a record of the money it receives and spends: the **ledger**. Everyone it deals with keeps their own version: the bank, suppliers, customers, the colleague with the spreadsheet. The job is to line those versions up, match every item and explain every difference.
Sounds like adding numbers. It isn’t. One payment settles three invoices. The bank keeps a fee. A euro invoice gets paid in dollars. A June sale lands in July. Somebody types 8,420 instead of 8,240.
Table titled ‘Five receipts, two versions of the truth’, comparing a colleague’s spreadsheet with the ledger. Receipts RC-25-0398 and RC-25-0404 (Fabrikam Industrial) and RC-25-0400 and RC-25-0402 (Contoso Logistics) match. RC-25-0401 (Fabrikam Industrial) shows 8,420.00 in the spreadsheet and 8,240.00 in the ledger. Totals: 60,230.00 against 60,050.00, a difference of 180. Below the table, chips list what usually hides in the gap: split payments, bank fees, FX rates, cut-off dates, duplicates, typos and conflicting emails.
Your job: find the 180.00 and explain it. Here, two digits swapped places. Remember this table: it comes back later.
> Adding up numbers is the easy part. Deciding which numbers count is the job.
Accountants do this every month, under deadline, across emails, CSV exports, Excel files and screenshots. That makes it a great test for AI agents: lots of reading, a little arithmetic and zero tolerance for “close enough”.
## What finrec-bm tests
Each case reads like a message from a colleague: *“Internal audit wants us to confirm this net cash flow. The email and the spreadsheets are in the folder.”* Nobody tells the model where to look. It gets **tools**, functions it can call, and decides for itself:
- **Emails:** `read_msg_file` unpacks Outlook `.msg` files, a binary format, into sender, recipients, dates, subject, body and attachments. Ten of the 22 cases include at least one.
- **Spreadsheets:** file readers open Excel `.xls` workbooks, CSVs and plain text, including cell formulas, fill colours and embedded pictures.
- **Databases:** `query_ledger` runs SQL against a ledger database the model has never seen. It explores the tables and **writes its own queries**, up to ten per call: 4,723 across all runs.
- **Screenshots:** `read_image_file` lets the model view images.
- **Arithmetic:** `calculate` does exact decimal maths, because floating point and money don’t mix.
The model gets 30 turns to return a structured answer: a verdict, the value the evidence supports, and every record, cell and row behind it. Four test families raise the bar one file format at a time:
1. **Plain text** · `txt-matching` · 3 cases · 89% of runs passed (67 of 75)
Find the transactions behind a reported total, converting currencies at the right monthly rate.
> **Example:** *“Coho Vineyard reported September spending of 4513368.4. Adventure Works reported 4.9M.”* Each log line shows two unlabelled amounts. Only the first amounts of two Coho lines add up, and 4.9M is a single line rounded to millions.
2. **Database + CSV** · `csv-matching` · 10 cases · 68% of runs passed (169 of 250)
Combine four or more sources: database tables, CSVs, meeting minutes and `.msg` emails. Typical traps: period cut-offs, accruals, VAT and cost allocations.
> **Example:** *“The Q3 board pack reported marketing spend of USD 1,580 thousand.”* The minutes set the rules: marketing campaigns only (the database says which), monthly average FX rates, and round only the total. Round each line first and you get 1,579.
3. **Excel** · `xls-matching` · 6 cases · 59% of runs passed (88 of 150)
Check highlighted cells against `.msg` emails and the ledger. Watch the formulas: the figure itself might be wrong.
> **Example:** The request is one of five `.msg` emails: confirm EUR 41,618.00 for two highlighted rows. Each row’s comment names whose email holds its final amount, and both people wrote theirs in hexadecimal. A third, unhighlighted row has a name too. Leave it out.
4. **Screenshots** · `img-matching` · 3 cases · 59% of runs passed (44 of 75)
Same as Excel, except the numbers live inside images: in `.msg` email bodies, attachments and workbooks.
> **Example:** Accounts payable emails a screenshot of the payment run (a batch of supplier payments) and asks whether its highlighted total agrees with the ledger. The image shows 63,950.40 and the rows add up, but one payment appears twice. The ledger supports 59,137.80.
**No LLM judges the answers.** A rule-based scorer compares the cited evidence with the expected list, so every score is reproducible. A case passes only on an exact match: every expected item, nothing extra, the right verdict and the right value to the cent. Tough? Sure. So is your auditor.
Diagram: npm run benchmark picks models, tests and cases. Each model runs its test families and cases in its own parallel lane, scores them by exact match and F1, and the results aggregate into summary.json, which feeds dashboard.html.
One command picks the models, tests and cases. Each case runs with a fresh agent and database, so no run can affect another. Results land in one summary and one dashboard.
## Your turn: spot the trap
Here’s one of the hardest cases, from the Excel family. Tailspin Toys, a group of three companies, re-bills (“recharges”) its customer Northwind Traders for the freight it paid on their orders. Three `.msg` emails land in your inbox, in this order:
> **Priya Natarajan** · Logistics manager · Mon 29 Sep
>
> “For the August recharge to Northwind Traders: it covers every freight charge on a Northwind Traders order dated in August 2025, **whichever Tailspin Toys entity booked it** (BV, GmbH or Inc), plus our handling fee for August. The fee is **highlighted in green** in freight-recharge-2025-08.xls.”
> **Tom Whitaker** · Account manager · Tue 30 Sep
>
> “Small correction to Priya’s note. The Northwind recharge **only covers the freight booked by Tailspin Toys BV** […] And the handling fee to add is the one **highlighted in yellow** in the workbook, not the green one.”
> **Ingrid Halvorsen** · Group controller · Wed 1 Oct
>
> “[…] Priya’s email is the correct one. […] The yellow figures in the workbook are the July fees, which have already been invoiced. Before we invoice it, please **confirm the August 2025 recharge to Northwind Traders: EUR 10,760.80**, per the draft.”
Here’s the workbook the emails refer to:
Excel sheet ‘handling fees’: handling fees by customer and month, 2025. Adventure Works August 410.00 in tan, note ‘August fee under review’. Northwind Traders July 598.20 in yellow and August 642.75 in green. Contoso Logistics July 530.10 in yellow.
freight-recharge-2025-08.xls, as Excel shows it. Four highlighted cells, three colours.
The freight charges live in the ledger. The customer sits in `sales_orders` and the booking entity in `entities`, so the model’s query needs two joins:
SQL query selecting charge\_id, entity\_id, charge\_date and amount from freight\_charges, joined to sales\_orders and entities, where the customer is Northwind Traders. Twelve result rows. ENT-NL: FC-7001 28/07/2025 1240.00, FC-7002 05/08/2025 2315.40, FC-7003 19/08/2025 1876.25, FC-7005 08/09/2025 1450.00. ENT-DE: FC-7010 11/08/2025 3120.80, FC-7011 26/08/2025 845.60, FC-7012 31/07/2025 610.00. ENT-US: FC-7020 08/04/2025 2780.00, FC-7021 08/21/2025 1105.35, FC-7022 07/08/2025 1960.00, FC-7023 08/12/2025 2435.10, FC-7025 07/29/2025 720.00.
Twelve Northwind freight charges, each date stored as text, exactly as its entity's system writes it.
**Does EUR 10,760.80 hold up? Which cells and charges make up the right number?** Take a minute before you peek.
Show the answer
**Not confirmed. The evidence supports EUR 15,121.25.**
1. **Follow Priya.** Tom wrote after her, but the group controller, who outranks both, wrote last and backs Priya.
2. **Keep D5**, the only green cell: 642.75. Drop C5 and C7 (yellow: July fees, already invoiced) and D4 (tan: another customer’s fee, under review).
3. **Keep every entity’s freight**, not just the BV’s.
4. **Read each date in its entity’s format.** ENT-NL (the Dutch BV) and ENT-DE (the German GmbH) write the day first; ENT-US writes the month first. So 08/04/2025 means 4 August and 07/08/2025 means 8 July.
5. **Keep the seven August charges**: FC-7002, 7003, 7010, 7011, 7020, 7021 and 7023, for 14,478.50. Add 642.75 and you get 15,121.25.
And the draft’s 10,760.80? It reads every date day first, so the US entity’s 8 July charge sneaks into August and three real August charges drop out.
Only 5 of 25 configurations passed, all of them DeepSeek. Most others found 15,121.25 but cited an email as a source record, which counts as wrong evidence (more on that below). Three GPT-6 Luna settings confirmed the draft’s 10,760.80 outright.
## Boss level: every format in one case
The quiz kept each clue in its own file. The boss level nests them, so each format holds one piece of the puzzle: an Outlook `.msg` email, an Excel workbook, a screenshot and ledger postings the model finds with its own SQL.
Five-step chain for img-matching case-03, ‘Confirm the approved net cash flow’, difficulty hard. Step 1, email (.msg): audit asks you to confirm the approved net cash flow in the review workbook; the email gives no figure and carries no attachment. Step 2, Excel: the sign-off sheet lists two drafts, Draft 1 superseded and Draft 2 approved, each naming the screenshot that holds its figure. Step 3, image: a picture inside the workbook holds the approved figure, 1,680.70; no cell holds it. Step 4, Excel: the highlighted totals come from formulas that skip rows; receipts =SUM(F4:F8) = 47,245.90, payments =SUM(F4:F6,F9:F11) = 45,385.20. Step 5, ledger (SQL): eleven postings match the formula rows one for one; 47,245.90 − 45,385.20 = 1,860.70. Result: not confirmed; approved 1,680.70, evidence supports 1,860.70.
Sound familiar? Two digits swapped places again, this time inside a picture. The superseded draft's 7,888.10 adds up whole columns and ignores the formulas.
Eighteen of the 25 configurations found 1,860.70, but only six passed. The other twelve cited the sign-off sheet as evidence: it points to the right picture but proves nothing about the total.
DeepSeek V4 Pro never got that far. It failed every screenshot case at every setting, 0 of 12, while its smaller sibling DeepSeek Flash passed 8 of 12. In one run, V4 Pro even tried to read a PNG’s raw bytes through SQL. Points for creativity.
Here’s how GPT-6.1 Sol at low reasoning cracked it, tool call by tool call. Nobody gave it the schema: it discovered the tables and wrote every query itself.
Tool calls of GPT-6.1 Sol at low reasoning on img-matching case-03, in order: read\_msg\_file net-cash-signoff-2025-09-24.msg; read\_xls\_file cash-review-2025-09.xls; query\_ledger SHOW ALL TABLES; query\_ledger SELECT \* FROM duckdb\_constraints(); read\_image\_file ncf-2025-09-15.png;