What I’d fix before building an AI agent
What a wrong invoice match taught me about choosing what to automate and what to check before the system acts.
The lookup found a settled bill with the right invoice number. It belonged to a different supplier, and the amount was different. Two suppliers had used the same number.
That happened in the invoice workflow I built. It’s the example I’d use if someone asked me to build an agent that can answer, “Has this supplier been paid?” I’d start by asking how the business knows it has the right bill, and what the payment record actually proves.
Fix the front door
Before the system parses an email or calls AI, it checks that the sender’s domain is on an approved list. Staff forward supplier invoices from work email, which helps keep unrelated mail out of the queue. The invoice still goes through review.
A PDF with selectable text can go through a text parser. A scanned PDF may look identical on screen, but its pages are images. The workflow renders those pages and uses optical character recognition, or OCR, to read them. If a team also receives standalone photos, I’d test an image reader on the pictures people actually send, including the one taken at an angle with the total cut off. Whatever produces the draft, the reviewer needs the original and somewhere to flag an amount or currency they can’t confirm.
Write down what the business already decides
Who can sign depends on the department and invoice amount. A manager might be able to approve a routine purchase, while a larger bill needs someone with a higher limit. Before automating routing, I’d ask the team for an invoice close to a signing limit and have them show me who would get it. I’d ask what happens if that person is away, too.
The same exercise works at the payment end. A bill can have a zero balance because it was paid, credited, voided, or written off. An early version of the check I built relied on the balance. I changed it to require evidence that payments covered the bill. The workflow also checks the invoice number and amount and evaluates the vendor match. When it can’t confirm the match, it leaves the existing status in place and shows why.
Make the agent show how it read the question
In What happens after AI reads the invoice?, I suggested asking which invoices a person approved in the past three months. An invoice can arrive in August and be signed in September. For that question, I’d use the signing date and show it alongside the approver and the currency. If two people share a name, I’d want the assistant to ask which one.
I’d bring the same care to “How much did we spend with this supplier?” Do we mean the value of their invoices or what we paid? Over which dates? A useful answer shows what was counted and keeps the CAD and USD totals separate. Then the person asking can click into a record or compare the result with what Finance sees.
The next place I’d try an agent is on exceptions. It could collect the relevant details from an invoice and an email thread, explain why a match needs review, or draft a question for the person who can resolve it. I’d try it on cases the team has already resolved and see whether it gets them to the right question sooner.
For your own workflow, try a small test. Ask two people what approved or paid means and have each show you the record they’d look at. If they reach for different records, you’ve found a good place to start. Once the rules are clear, the next job is handing them over. I walk through that in What your team should be able to do after I hand over an automation.