Close is five days of reconciling, investigating and explaining — and the explaining is where nights go. This playbook drafts reconciliation checks over ledger extracts with DuckDB and turns verified variances into review-ready narratives, under one iron rule: every figure in the prose traces back to the extract, or the sentence doesn't ship.
Tier: Core · Workflow area: ERP Data & Close · ~40 minutes
Month-end has two AI-shaped layers. The mechanical layer — tie-outs, account movements, flux calculations — is SQL over extracts, which AI drafts in minutes. The narrative layer — "why is freight expense up 34%?" — is where accountants burn evenings converting numbers into sentences for controllers and auditors. AI is excellent at both and dangerous at the second: a fluent variance story with one invented figure is worse than no story. The workflow order is therefore absolute: compute first, verify the numbers, and only then let the model narrate numbers that already exist.
Standardize the extracts once. Pull the same artifacts every month: trial balance by account and company code (current, prior month, prior year, budget), G/L line items for flux-prone accounts, subledger balances (AR, AP, fixed assets) for tie-outs. CSV or Parquet, one folder per period, consistent columns. Consistency is what makes the whole pack rerunnable in month two.
Generate the reconciliation pack in DuckDB. Describe your extracts' columns and ask for the standard checks:
-- Tie-out: subledger to G/L control account, per company code
SELECT g.company_code,
ROUND(g.gl_balance, 2) AS gl_control,
ROUND(s.sub_balance, 2) AS subledger,
ROUND(g.gl_balance - s.sub_balance, 2) AS diff
FROM gl_balances g
JOIN ap_subledger_totals s USING (company_code)
WHERE g.account = '2100000'
AND ABS(g.gl_balance - s.sub_balance) > 0.01; -- pass: 0 rows
-- Flux: movements beyond threshold (>10% AND > 25,000)
SELECT account, account_name,
cur.balance AS current_bal,
pri.balance AS prior_bal,
ROUND(cur.balance - pri.balance, 2) AS delta,
ROUND(100.0*(cur.balance - pri.balance)
/ NULLIF(ABS(pri.balance),0), 1) AS delta_pct
FROM tb_current cur JOIN tb_prior pri USING (account, account_name)
WHERE ABS(cur.balance - pri.balance) > 25000
AND ABS(100.0*(cur.balance - pri.balance)
/ NULLIF(ABS(pri.balance),0)) > 10;
Every check carries a comment stating its pass condition. Verify the pack once against a period you already closed by hand — the known-answer test that earns it a place in the process.
Drill each flagged variance to its drivers — still in SQL. For each flux line, decompose from the G/L detail: top documents, vendors or cost centers explaining the delta. This produces the evidence table: e.g., freight expense +134,200, of which vendor F-2210 +98,400 (new distribution contract, 14 documents), fuel surcharge postings +21,300, remainder +14,500 across 40 documents. The evidence table, not the trial balance, is what the narrative step consumes.
Narrate from the evidence table only.
Draft a variance explanation for the month-end flux file.
Audience: controller review. Tone: neutral, precise, no adjectives
like "significant" without a number attached.
Use ONLY the figures in the evidence table below. Do not compute
new figures, do not round differently, do not speculate on causes
beyond the driver labels provided. Where the drivers do not fully
explain the delta, state the unexplained remainder explicitly.
Format: 3-5 sentences per account, each figure exactly as given.
[paste evidence table]
The "unexplained remainder" instruction is the honesty valve — it forces the residual into daylight instead of letting fluent prose paper over it.
Trace-check before anything leaves your desk. For every number in the draft narrative, find it verbatim in the evidence table; for every causal claim, confirm it restates a driver label rather than inventing a story. This is a five-minute ctrl-F exercise, and it is the control: fluency is not evidence. Fix, or delete, any sentence that fails.
File narrative, evidence table and query pack together. The close binder entry for each account: the reconciliation output, the evidence table, the narrative, and the query-pack version that produced them. Next month is a rerun: same queries, new extracts, new evidence tables, fresh narratives — and the drafting that consumed evenings compresses to an hour of verification.
Ledger extracts are the company's finances at full resolution — counterparties, salaries in payroll accounts, margin structure. They belong in tenant-approved tools under your data-processing terms, never in consumer chat windows, and narratives inherit the confidentiality of the numbers they contain.
Close AI works when the pipeline runs one direction: SQL computes, humans verify, the model narrates only what survived verification — with unexplained remainders declared. That ordering is what lets you hand an auditor the narrative, the evidence table and the query that made it, in one motion.