agentic ai · spend compliance

Spend Compliance Agent

When a procurement contract is signed, its terms are loaded into the ERP by hand. Across several countries or regions, the purchase orders drift from the contract — in price, in scope, in whether they reference it at all. This agent reads the contract and checks the spend against it.

What it checks

every PO, three questions
01
Linkage
Is the PO tied to a contract at all?
linkedunlinkedoff-contract
02
Price
Does the PO price match the contracted rate?
compliantnon-compliant
03
Scope
Is the PO charging for something the rate already includes?
compliantdouble chargescope gap
Example — a double charge
Contract
Day rate $1,500 — all-inclusive
Transport, mobilization and materials are inside the rate.
Purchase order
Line 1 — day rate$1,500
Line 2 — transport$400

Line 2 bills $400 for transport the day rate already covers. A line-by-line check passes it; read against the contract, it's a double charge.

Architecture

1 orchestrator · 3 subagents · 2 inline steps · 11 skills
Orchestrator Claude Code + CLAUDE.md · runs the pipeline, evaluates each step, switches to reasoning on pattern-level failure
1
Contract Interpretationsubagent
Reads contract PDFs. Extracts pricing, UOM, scope — and the inclusions and exclusions that define what each rate covers.
pdf-reader · db-manager · schema-validator · confidence-scorer
2
PO Processinginline
Loads the ERP extract, normalizes it via field mapping, routes each PO by available matching path.
excel-loader · field-mapper · db-manager · schema-validator
3
Matchingsubagent
Links each PO to its contract — direct lookup, or semantic matching when there is no reference. "Crane services" matches "lifting and hoisting"; "crane inspection" does not.
db-manager · fuzzy-matcher · confidence-scorer
4
Compliancesubagent
Scores linkage, price and scope per PO. Holds the contract's inclusions and exclusions in context to catch overlaps and double charges.
db-manager · price-comparator · uom-converter · clustering-engine
5
Report Generationinline
Queries the database and formats the compliance report. Deliverables are queries, not separate analysis.
db-manager · report-writer

The test

one contract against a year of spend

A single supplier contract, checked against a full year of the company's purchase orders — straight from the ERP.

8,704
purchase orders
$252.4M
spend
445
suppliers
39
countries
The contract priced 6 named services. Every PO collapsed them into one line.
What the contract priced — 6 services
  • Registro de hidrocarburos marino c/crom
  • Registro de hidrocarburos terrestre
  • Análisis de fluidos — marina / terrestre
  • Paleontólogo
  • Mud Logger / control geológico
  • Ayudante laminador · materiales
What every PO said — 42 times
OUTSIDE SERVICES, INSP - REPAIR AND CONSUMABLES
One line, repeated. No price on the rate card, no service named.
The agent flagged 35 POs · 42 lines · $970K of non-compliant spend — in minutes.
← Back to home