AI Spend Analysis Every invoice line classified, monthly
Every month, every invoice line is put in the right category, so you can see what the company spends and where to save.
- Installed for you · one-time$249
- Run for you$297/month
- Custom build · this process$6,000–12,000 one-time
- Starts whenSchedule Trigger (monthly, after AP close)
The subscription covers one ERP source and up to 50,000 lines a month with a standard UNSPSC taxonomy. Multiple ERPs, a custom taxonomy, or contract-compliance checks are a custom build. Custom builds start at $2,000 site-wide; this band is for this process and its integrations.
AI Spend Analysis is an automation Agentmelt installs in Google Sheets. The free template is a file you import yourself; the kit ($49) adds the setup guide and prompts. Installed for you costs $249 one-time and is live within two working days of access, with a recorded walkthrough and 30 days of fixes. Run for you costs $297/month, with setup and maintenance included. A custom build of this process is $6,000–12,000 one-time; custom builds start at $2,000 site-wide. No call is needed for any option. Written by Max Zeshut; last revised 2026-09-17.
Reference stack: Claude + n8n. Node names are on each step; the file is under the template.
Founder at Agentmelt
Reviews every build before it goes live; the workflow escalates to a person, never past one.
What is spend analysis?
AI spend analysis is the automated classification of every purchase — each invoice and purchase-order line — into a consistent category taxonomy, supplier and cost centre, so procurement can see what the company buys, from whom, and where the savings are. Instead of a consultant's one-off spend cube, a workflow reads the lines from the ERP and card feeds each month, classifies them with a language model against your taxonomy (UNSPSC or your own), flags the uncertain ones for a person, and publishes the cube with the changes explained.
- We only know what we spend by supplier, not by category — the ERP account codes are too coarse to negotiate with.
- Someone builds a spend cube in Excel once a year; by the time it is finished it is out of date.
- The same supplier is spelled four ways and sits in three cost centres.
- Maverick spend outside contracts only shows up when the invoice arrives.
- We had a spend analysis done by a consultancy and could not repeat it.
If two of these are yours, this is the process to look at first. Free audit — or read on.
What it looks like once it runs.
AI spend analysis (spend analytics) uses machine learning to classify every invoice and purchase-order line into a category taxonomy, normalise supplier names, and build the spend cube — supplier × category × business unit × time — that procurement needs to find savings. Run as a scheduled workflow it refreshes monthly instead of once a year, and an AI agent writes the opportunity summaries a category manager would otherwise spend a week producing.
- Month-end +2 Invoice and card lines are pulled from the finance system; supplier names are cleaned and matched to one list.
- +2, 9:00 Each line is categorised; low-confidence lines wait in a sheet for a quick review.
- +3 The spend cube is built: by supplier, category, cost centre and month.
- +3, 10:00 Savings opportunities — the same item bought from three suppliers at three prices — arrive as half-page briefs.
Most companies have 30–60% of spend unclassified or classified as “other”. Supplier names are duplicated across systems (IBM, I.B.M., International Business Machines Corp). Spend analysis is done once a year by a consultant, is out of date by the time it is presented, and the savings it identified are never tracked.
Every month, the spend cube refreshes automatically: 95%+ of spend classified to a level-3 category, suppliers deduplicated, and a short list of opportunities — maverick spend, supplier fragmentation, price variance for the same item — with the numbers attached. Category managers start from the list, not from the extract.
Trigger, then 8 steps.
All eight steps run without anyone; a person sees only what the guardrails escalate.
Schedule Trigger (monthly, after AP close)
Extract AP and PO lines
Invoice lines and PO lines from the ERP (SAP, Oracle, NetSuite, Dynamics) and the card or expense platform: supplier, description, GL account, cost centre, amount, currency, date. Line level, not header level — headers hide the categories.
Normalise suppliers
Cleans legal suffixes and punctuation, then matches to a master supplier list using fuzzy matching plus tax IDs where available. Unmatched names go to a review queue; matches above the threshold are applied automatically.
Classify each line
An LLM classification step assigns each line a level-1/2/3 category from your taxonomy (UNSPSC or a custom tree) using the description, supplier, GL account and cost centre, and returns a confidence score. High-confidence lines are accepted; the rest go to review.
Learn from corrections
Reviewers correct low-confidence lines in a sheet. Corrections become few-shot examples and supplier → category rules for the next run, so accuracy climbs month over month.
Build the spend cube
Aggregates classified lines by supplier, category, business unit, cost centre and month into the table your BI tool reads (Looker, Power BI, Metabase).
Detect opportunities
Deterministic checks: same item bought from several suppliers at different prices, categories with many small suppliers, spend outside contracted suppliers (maverick spend), spend without a PO, contract expiries in the next 90 days.
Write the opportunity briefs
For each flagged opportunity the agent drafts a half-page brief with the numbers, the suppliers involved and a suggested action (consolidate, renegotiate, enforce PO policy). Category managers edit and own the brief.
Publish and track
Posts the monthly summary and briefs. Each opportunity gets an owner and a status in the sheet so realised savings can be reported against the estimate.
No step waits for a person.
What the workflow hands to someone, by rule:
- Classification below the confidence threshold is reviewed by a person before it enters the cube.
Every month, the spend cube refreshes automatically: 95%+ of spend classified to a level-3 category, suppliers deduplicated, and a short list of opportunities — maverick spend, supplier fragmentation, price variance for the same item — with the numbers attached
Every month, the spend cube refreshes automatically: 95%+ of spend classified to a level-3 category, suppliers deduplicated, and a short list of opportunities — maverick spend, supplier fragmentation, price variance for the same item — with the numbers attached.
No decisions needed. Anything the guardrails flag is handed to a person; the rest ran alone.
Each pattern page explains it in plain words and lists every automation that uses it.
The template is built on n8n (how the n8n AI Agent node works); the same steps run on Make, Zapier or plain code. The tool is chosen to fit your accounts, you own the result, and the template comes in all three formats.
A typical first month — a 400-person services company, 14 months of AP data, on NetSuite and Power BI.
Not a client report
Spend analysis was a consultant's deck once a year: 38,000 AP lines and $21M, a third of it filed under 'other', supplier names duplicated across three systems. By the time the deck was presented the data was five months old, and the savings it named were never tracked to anyone.
The first month- Week 1The AP and PO extract runs against 14 months of history. Supplier normalisation merges tax-ID matches automatically and proposes the rest; the category manager approves about 300 merges. Supplier count: 2,140 to 1,610.
- Week 2First classification pass to UNSPSC. Most spend lands at level 2 and three quarters at level 3; every line under the confidence threshold — about 3,000 — goes to a review sheet.
- Week 3Corrections from the review sheet are learned. The cube is published to Power BI with a run id; the source lines are untouched.
- Week 4The opportunity step flags three items with numbers attached: overlapping software subscriptions ($410k), temp-staffing rates varying 22% for the same role ($1.3M), and 18% of spend with no PO. The agent drafts the three briefs; the category manager takes them to the CFO.
- Months 2–3Weekly incremental runs keep the cube under a week behind. Classification reaches 96% at level 2 and 91% at level 3 by the third monthly run.
| Metric | Before | After a month |
|---|---|---|
| Spend classified to level 3 | ≈40% — the rest 'other' or free text | ≈75% after the first run, 91% by the third |
| Distinct suppliers | 2,140 | 1,610 |
| Age of the spend picture | 5 months | under a week |
| Opportunities with an owner | 0 | 3, tracked monthly — savings count as realised only when finance confirms |
The same composite as the worked example in the section above, so the two agree. Classification rates follow the blueprint's stated learning curve; first spend analyses typically find 5–12% of analysed spend addressable, and what is realised depends on who owns each opportunity.
This is a worked example, not a client's results: the company is a composite of a stated size, and the figures are the ranges this blueprint's own metrics make typical at that size. A real engagement replaces it, with permission, once an install has run a month.
Data it touches
- AP invoice lines and PO lines (ERP)
- Corporate card and expense platform transactions
- Supplier master (with tax IDs where available)
- Category taxonomy (UNSPSC or custom)
- Contract register (suppliers, terms, expiry dates)
Guardrails
- Classification below the confidence threshold is reviewed by a person before it enters the cube.
- Supplier merges are logged and reversible; tax-ID matches are the only automatic merges.
- The AI agent drafts briefs; savings are only reported as realised when finance confirms them.
- Source lines are never altered — the cube is a derived table with a run id.
What spend analysis is, and why it was always out of date
Spend analysis answers three questions: what did we buy, from whom, and at what price — across every system, business unit and country. The output is the spend cube, and everything procurement does (sourcing waves, supplier consolidation, contract compliance, budget planning) starts from it. The traditional way to build one is a consulting project: extract the AP data, spend weeks classifying lines in Excel, present a deck, repeat in eighteen months.
The reason it was always stale is that classification was manual. A mid-size company generates 20,000–100,000 invoice lines a month, and a person can classify a few hundred an hour. Machine learning changed the economics: a classifier reads the description, supplier and GL account and assigns a category in milliseconds, and — this is the part that matters — it gets better every time someone corrects it. Run monthly, the cube stops being a snapshot and becomes a live dataset.
How AI classification works on spend data
Two approaches, usually combined. Rules and lookups: a supplier that only sells one thing (a law firm, an electricity utility) maps directly to a category; a GL account often narrows it to a level-1 category. These handle a large share of spend with certainty and cost nothing. Machine learning for the rest: a language model reads the line — “HP LaserJet toner 26A black” — and returns the category (Office supplies › Printer consumables › Toner) with a confidence score. Modern LLM classification with a few hundred labelled examples per category reaches 90–95% agreement with human reviewers on level-2 categories and 85–92% on level-3, and the review loop pushes those numbers up over the first three months.
Supplier normalisation is the unglamorous half. “Amazon Web Services”, “AWS EMEA SARL” and “Amazon Web Svcs” are one supplier; without normalisation the cube shows three, and supplier-fragmentation analysis is meaningless. Fuzzy matching on cleaned names gets most of the way; tax IDs and DUNS numbers, where you have them, make merges certain.
The taxonomy decision
UNSPSC is the standard four-level taxonomy (segment, family, class, commodity) with tens of thousands of codes. It is free, widely understood and what most analytics tools expect. Its weakness is that it is built for products, not for the way procurement teams think about services and IT. Most companies use UNSPSC at levels 1–2 and a custom tree beneath it for their biggest categories (IT/software, professional services, marketing, logistics). Whichever you choose, freeze it before classification starts; changing the tree halfway invalidates the corrections the model learned from.
What the cube finds, with a worked example
A 400-person services company runs the workflow on 14 months of AP data: 38,000 lines, $21M. After normalisation the supplier count drops from 2,140 to 1,610. Classification lands 96% of spend at level 2 and 91% at level 3 by the third monthly run. The opportunity step flags: software subscriptions bought by 11 cost centres from 34 vendors with six overlapping tools ($410k, consolidate); temp staffing from 9 agencies at rates varying 22% for the same role ($1.3M, renegotiate to a panel of three); 18% of spend with no PO, concentrated in two business units (policy enforcement, not a sourcing event). The agent writes the three briefs; the category manager takes them to the CFO the same week. Typical addressable savings identified by a first spend analysis are 5–12% of the analysed spend; how much is realised depends entirely on whether someone owns each opportunity, which is why the workflow tracks them.
Where the AI agent fits, and where it must not
The agent writes the briefs — the narrative around the numbers that a category manager would otherwise spend days producing. It reads the flagged opportunity, the suppliers, the spend history and the contract register and drafts what happened, what it costs and what to do. It does not classify silently (the classifier does, with confidence scores and review), and it does not declare savings realised (finance does). Those boundaries are what make the output defensible in front of a CFO.
What it connects to.
| Tool | Role in this workflow |
|---|---|
| n8n | Extraction, normalisation, review loop, cube build |
| Claude | Line classification and opportunity briefs |
| Postgres / BigQuery | Spend cube and history |
| Looker / Power BI / Metabase | Dashboards on the cube |
| Google Sheets | Review queue and corrections |
Want this running without building it?
$297/month
We set it up in your tools, run it on our servershost it on our n8n cloud (or deploy it to your own n8n, Make or Zapier), watch it, and fix it when something changes. Setup included, cancel monthly; the automation stays yours if you leave.
$6,000–12,000 one-time
Your systems, your rules, your edge cases. A one-off build delivered into your accounts to keepon Claude and n8n, delivered into your accounts to keep, with documentation and a recorded walkthrough.
The subscription covers one ERP source and up to 50,000 lines a month with a standard UNSPSC taxonomy. Multiple ERPs, a custom taxonomy, or contract-compliance checks are a custom build.
Also sold one-time, installed in your own accounts, as part of the data analysts package and the financial analysts package and the supply chain & procurement teams package — do it yourself $49 · installed for you $249 · done for you $490.
When this becomes a custom build.
The subscription covers the standard version — $297/month, setup and maintenance included. Three things move it to a custom build ($6,000–12,000 one-time), delivered into your accounts to keep. If one of them is you, say so on the audit and the plan prices both.
More than one ERP or spend source.
A custom taxonomy instead of UNSPSC, or category rules that encode your own procurement policy.
Contract-compliance checks — flagging spend outside negotiated terms.
Running the standard version first is the usual path: the exceptions it logs in the first month are the scope of the custom build, with your own numbers. How custom builds work.
Frequently asked questions.
How accurate is AI spend classification?
With a frozen taxonomy and a review loop, 90–95% of spend at level 2 and 85–92% at level 3 in the first months, rising as corrections feed back. Lines below the confidence threshold are reviewed by a person, so the cube never contains an unreviewed low-confidence guess.
Which ERPs and data sources does it work with?
SAP, Oracle, NetSuite, Dynamics, Sage and QuickBooks for AP and PO lines; Ramp, Brex, Pleo, Expensify and bank feeds for card spend. Any source that can export line-level data with supplier, description, amount and account works.
Do we need UNSPSC?
No, but you need a fixed taxonomy. UNSPSC levels 1–2 with a custom tree for your largest categories is the common choice. We set it up with you before the first classification run.
How is this different from the spend module in Coupa or Ariba?
Those modules classify spend that flows through their own platform. The workflow classifies everything — ERP, cards, expenses, off-platform invoices — and writes to your own database, so it works alongside a P2P suite or without one.
What does AI spend analysis cost?
$297/month as a subscription for one ERP source and up to 50,000 lines a month. Multiple sources, custom taxonomies or contract-compliance checks are a one-off build from $6,000. Compare that to a one-time consulting spend analysis, which usually costs more and is stale on delivery.
What is the difference between spend analysis and spend analytics?
Spend analysis is the exercise: classifying purchases and reading the result to find savings. Spend analytics usually means the tool or dashboard that shows it. This workflow does the analysis part continuously — classification, cleansing, the cube — and writes the result into whatever analytics layer you already use (a BI tool, a spreadsheet, the procurement suite).
Can machine learning classify spend without a full taxonomy first?
Yes. The workflow starts from a small taxonomy — usually the 30–60 categories procurement already negotiates on — and classifies against it with confidence scores. Lines below the threshold go to a review queue; the corrections feed the next run. You extend the taxonomy where the review queue shows a gap, not up front.
How is this different from spend analysis services?
A service delivers a spend cube as a project — typically every one to three years, with the classification logic staying with the consultancy. The workflow runs monthly in your own accounts, the taxonomy and the rules are yours, and a person reviews only the uncertain lines. It costs less per year than one project and never goes stale.
What this blueprint is built on.
Vendor documentation the steps rely on, and the rules the guardrails are written against.
- Google Cloud — BigQuery documentation cloud.google.com/bigquery/docs
- UNGM — United Nations Standard Products and Services Code (UNSPSC) www.ungm.org/Public/UNSPSC
- n8n docs — AI Agent node docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/