Case study · AI automation agency
Document AI for an Irish life-insurance brokerage
An n8n pipeline reads each signed policy pack with OCR and GPT, checks it across documents, and puts it in front of ops staff for review before it goes to the insurer.
| Client | A life-insurance brokerage in Ireland |
|---|---|
| Employer | Previous company (an AI automation agency), as a contract AI engineer |
| My part | Built the AI pipeline. Owned the React review dashboard (75% of its commits). |
| Users | The brokerage's operations team, working with 47 advisors across 7 sales boards |
Problem
When a client signs on DocuSign, the brokerage has a pack of documents to check before the policy can go to the insurer: the fact find, the application, the statement of suitability and the direct debit mandate. Someone had to read them, compare values across them, and check the premium against what the advisor recorded on the sales board. That manual pass took an estimated 20-30 minutes per policy.
Constraints
- The documents are scans and signed PDFs, so OCR errors are common. A single wrong digit in a bank account number would break the direct debit.
- Some fields can't be left to a model at all. An IBAN is either valid or it isn't, and a premium either matches the sales record or it doesn't.
- One DocuSign envelope can hold several policies, and the same envelope can arrive more than once, so duplicates had to be stopped at every stage.
- A person signs off on every policy. The AI prepares the work and flags problems, and staff make the call.
Architecture
- Signed envelopeDocuSign webhook
- Match and createFind the client and advisor on the sales boards, create the policy, drop duplicate envelopes
- OCRMistral OCR on every document
- Extraction agentGPT classifies each document and fills a structured schema through an n8n output parser
-
Validation agentsCross-document checks for identity, underwriting risk and financial details, each issue with a severityDeterministic checksIBAN checksum (ISO 7064 mod-97), premium within 1 euro of the sales board, duplicate guards
- Supabase PostgresPolicies, extracted fields and flags
- Review dashboardOps staff confirm, work the flags and send documents out
- LLM or OCR step
- Plain code
- Human decision
What I did
I built the pipeline in n8n. Intake listens for signed DocuSign envelopes, matches each one to a client and advisor on the brokerage's sales boards, and creates the policy record. Each document then goes through Mistral OCR and a GPT extraction agent that works out which document it is looking at and returns the fields as structured output.
On top of extraction I designed the cross-document validation. Separate agents compare identity details, underwriting risk answers and financial figures across the documents in a pack. Within the first 7 months they raised 3,219 flags on 1,443 policies, including 100 critical age-band cases that would otherwise have reached an insurer.
I kept the checks that have one right answer in plain code. IBANs are validated locally with the ISO 7064 mod-97 checksum, which catches OCR slips in account numbers. Premiums must match the sales board to within 1 euro. Duplicate prevention runs at every stage, because envelopes can repeat and can carry more than one policy.
I also took over the React, TypeScript, Vite and Tailwind review dashboard from a teammate who started it, and wrote 75% of its commits. It's where ops staff see each policy, its extracted values and its flags. Database and infrastructure changes on my side cut its load time from about 15s to 2s.
Results
Stack
Timeline
- Intake and extraction: DocuSign webhook, sales-board matching, OCR and the GPT extraction agent.
- Cross-document validation agents, with severities so staff could sort critical cases first.
- Hardening with deterministic checks for IBANs, premiums and duplicates.
- Took over the review dashboard and cut its load time from about 15s to 2s.
- Over the first 7 months, monthly volume grew from 74 to 719 policies.
The client is described by country and industry instead of by name.