Juan Cardena Book · $500 Blog
Solutions
From prototype to production. From solo to global.
Book a strategy session · $500

Use case · Financial analysis with AI agents · 2024-2025

118 AI agents on a 276-million-record, multi-company ledger

How one master agent, one lead per company and twelve domain experts analysed the books of a nine-company business, and the method behind it.

118agents
9companies
276Mledger records
23 yrsof history
16finance workflows

The problem

A financial analysis project. The business was made of nine companies and kept its books in one ERP database, each company with its own ledger. Leaders needed one picture: where money moved, which entity was off, and what 23 years of records said. Answering one question by hand took days of queries and spreadsheets.

How the agents were organised

Master agent1 · coordinates and aggregatesCompany 1Company 2Company 3Company 4Company 5Company 6Company 7Company 8Company 99 company leads, one per legal entityGeneral ledgerSales and receivablesPurchases and payablesInventoryBankFixed assetsPayrollBudgetJobsManufacturingServiceDimensions12 domain experts under every company (shown for company 1)

1 + 9 + (9 × 12) = 118. One master agent, nine company leads, and twelve domain experts under each company. The 118 is the shape of the business, turned into a team.

The method

01

Map the entities and the domains

List every legal entity and every area of the books. That map becomes the shape of the agent team.

02

One agent per role, with a narrow scope

Each agent owns one company, or one domain inside one company. Narrow scope keeps answers checkable.

03

Governed access to the data

Agents read the ledger through one controlled SQL tool, never with their own database logins.

04

Check every number against the ledger

A finding is reported only after its totals tie back to the general ledger.

05

Aggregate up the hierarchy

Domain experts report to their company lead; company leads report to the master, who writes the group view.

06

Start with the largest entity, then roll out

Prove the full set of domains end to end on one company, then repeat the pattern across the rest.

The full Business Central flow, mapped

Before any agent ran, the whole flow of Microsoft Business Central was mapped: how every subledger posts to the general ledger, and the 16 workflows that carry the business, in five tiers. Each domain expert owns its part of this map. How an ERP works, end to end →

General ledger (chart of accounts)G/L entries · registers · posting groups · dimensionsCustomer ledgerVendor ledgerItem ledgerBank ledgerFixed asset ledgerEvery subledger posts to the general ledger: sales, purchases, stock, bank and assets all tie back to one set of accounts
Tier 1Financial foundation
  • 01Financial flow: chart of accounts to G/L entries, registers and statements
  • 02G/L account view: the hub that links every subledger
Tier 2Core transactions
  • 03Sales (order to cash)
  • 04Purchase (procure to pay)
  • 05Customers
  • 06Vendors
Tier 3Inventory and operations
  • 07Items
  • 08Costing
  • 09Production
  • 10Transfers
  • 11Lots
Tier 4Supporting finance
  • 12Bank
  • 13Fixed assets
  • 14Budget
Tier 5Analytics and reference
  • 15Dimensions
  • 16Units of measure

What it produced

A report for each of the nine companies and a group summary, built from 276 million records across 16 finance workflows in five tiers, from the financial foundation to analytics. On the largest company, the domain experts ran end to end in eight areas, which proved the pattern before rolling it out.

The same design for a hotel group

A hotel group has the same shape: many hotels, often separate companies, each with the same areas of the business. Built for a financial analysis of a multi-company business; the same design applies to a hotel group.

In this use caseIn a hotel group
1 master agentThe group view for the CEO, CFO and owners
9 company leadsEach hotel or owning company, often its own legal entity
12 domain experts eachThe same finance areas in every hotel, plus rooms, food and beverage, spa and loyalty
276M ledger recordsYears of stays, folios, guest profiles and accounts across the hotels

What it taught

The agents are only as good as the data under them. Structure beats size: the right hierarchy of small, checkable agents did what one large model could not.

The agents were the last step of a larger program: the inventory, logistics and ledger data platform underneath →

Built with AI agents · an MCP tool for governed SQL access · an ERP ledger on SQL Server · Python

In one architecture session we map your entities, your data and where agents can help, and agree what a 90-day build should cover.

Book a strategy session · $500 All use cases →