← Act I · Projects

Case 001

Enterprise Agents

agentsautomationpythonretail

My personal agents answer to me. These ones answer to a business: a retail company running physical stores, where I built the AI and reporting infrastructure from zero. The hard part was the terrain. Sales data arrived as a tangle of emailed feeds in mixed formats, the warehouse system's own numbers could not be trusted, and nothing was documented anywhere. The job was to build a reporting layer more trustworthy than the sources it stands on, and make it run with nobody watching.

The problem: retail runs on yesterday's numbers

When I arrived, reporting was manual and end of day. Sales and stock data lived in fragmented feeds that arrived by email, changed format without notice, and disagreed with each other. Turning that into a picture of the business meant a person assembling numbers by hand, so by the time anyone saw a problem it was already a day old. Retail punishes that lag: stock runs dry, surpluses pile up, and buying decisions get made on instinct.

Diagram of the agent fleet: entry points, digestion, results, and compound agents
The fleet, end to end: raw feeds are digested into clean datasets, results are built and verified, and then agents consume each other's results. The dashed line is the weekly agent rebuilding the price table the daily agent depends on.

The morning briefing agent

Every morning, before anyone is at a desk, the first agent wakes up in the cloud, reads yesterday's sales feed, and rebuilds the executive dashboard: sales for every store, category mix, best sellers, and comparisons that actually mean something, the same weekday last week and a four week same weekday average, computed on the retail calendar the business really runs on rather than the calendar on the wall. Every write is idempotent, so a re run can never duplicate a sale. Nobody compiles a report anymore; the report shows up like a newspaper.

The warehouse agent

The second agent pulls the entire warehouse out of the management system every morning through its API: every item, SKU, size, colour, and exactly where it sits, from retail ready shelves to the repair pipeline. It builds a print ready report in the company's brand palette, and then the important part happens: a separate verification layer recomputes every number from the raw data, deliberately re implementing the logic rather than importing it, so a bug can never validate itself. If a single check fails, nothing ships. The principle is written into the runbook: a missing report is acceptable, a wrong report is not.

The store report agent

The biggest single build reconstructs the wide workbook that heads of department actually read: stock, sales, cover, and size mix for every store, one sheet per store plus a combined view, assembled from three incompatible feeds including a PDF that has to be parsed back into tables. Every visible number in it is a live formula over hidden data sheets, so any department head can drill into any figure. This build also taught the most expensive lesson in the fleet: a delivered report once understated sales badly because most of the daily files fell outside the default search window and were silently never fetched. The fix became a permanent rule, enforced in code: enumerate every day the report claims to cover against the files actually present, and go hunting for any gap, however far back it sits.

The replenishment brain

Deciding what to pick from the warehouse and send to which store used to be a judgement call made by whoever was free. The replenishment agent turns it into a reproducible, auditable allocation. It reads every sendable unit, reads what each store holds and sells by category and size, and produces a per store pick list a warehouse assistant can work straight off, plus a stays in warehouse sheet, so every single unit is accounted for somewhere. It even runs two philosophies side by side, push stock to where it sells versus fill each store to its target, and where the two disagree, that gap goes to the buying leads as a business question instead of being resolved silently by code. A conservation check proves the allocation adds up exactly: provable, not just plausible.

What enterprise agents actually take

Running unattended is a discipline, not a feature. Every agent in the fleet follows the same rules. Executive surfaces get numbers; caveats, timestamps, and exceptions go to the operator, never the dashboard. Every database has exactly one writer. Agents stop and notify rather than guess when a feed looks wrong or a total moves implausibly. And sometimes the right agent is no agent: one loader was deliberately downgraded to a plain deterministic script because that made it more reliable overnight. An agent nobody trusts is just a script with opinions. Making the fleet trusted infrastructure was the actual project, and none of it operates blind: it all draws context from the company brain, the knowledge system with its own case file.