PwC
BotiqueAI
🏒 PwCπŸ€– LLMEmail AI Β· ERP Integration Β· Human-in-the-Loop
Case Study

Invoice Intelligence

From inbox to ERP in seconds β€” AI that reads, classifies and routes every invoice automatically.

An LLM-powered pipeline that intercepts employee invoice emails, classifies each one using few-shot examples from past cases, updates Eloficash in real time, and surfaces edge cases through a human-in-the-loop dashboard.

99.9%
classification accuracy
Validated on real PwC data
3
decision categories
To Pay Β· Disputed Β· On Hold
Auto
Eloficash sync
Real-time ERP update
Loop
human feedback
Corrections retrain the model
Client
PwC
Big Four consulting & audit
Project
Invoice Intelligence
Automated invoice processing
Model
LLM + few-shot
GPT-4 with labelled examples
Integration
Eloficash
ERP updated in real time
Decisions
3 categories
To Pay Β· Disputed Β· On Hold
Oversight
Human-in-the-loop
Correction dashboard
The Challenge

Hundreds of invoice emails.
No automated processing.

PwC teams received daily emails from employees and suppliers containing invoices to process. Every email had to be read, understood, categorised and forwarded to the right department β€” a wholly manual process, slow and error-prone.

Without automation, some invoices went unpaid for too long, others were settled without validation, and disputes accumulated with no structured follow-up.

Volume and variety of emails
Invoices received by email in heterogeneous formats β€” PDFs as attachments, amounts in the message body, implicit references to existing contracts.
Error-prone manual classification
An operator had to read and decide for each email: pay, dispute or hold. High error risk at scale.
ERP update delays
Eloficash was only updated after manual processing, creating gaps between the accounting reality and the system β€” sometimes lasting several days.
Untracked disputes
Disputed invoices had no structured follow-up, making fast resolution and finance-team reporting difficult.
The Solution

LLM + few-shot learning.
From inbox to ERP in real time.

Invoice Intelligence intercepts incoming emails, extracts invoice content (message body and attachments), and uses an LLM enriched with examples from past cases to decide the action to take β€” with no human intervention in standard cases.

Ambiguous cases are escalated to a supervision dashboard where operators validate or correct the decision. These corrections automatically feed the model's example base, improving it continuously.

β‘ 
Email reading
Connected to the finance team mailbox. Automatic extraction of the body, PDF attachments and metadata (sender, subject, amount).
β‘‘
LLM classification
The model analyses the content and classifies the invoice: To Pay, Disputed or On Hold. Few-shot examples from past cases anchor the decision in PwC context.
β‘’
Eloficash update
Validated decisions are pushed automatically to Eloficash via API β€” status, amount, supplier, reference β€” with no manual re-entry.
β‘£
Supervision dashboard
Low-confidence cases are surfaced to an operator. Their correction is logged and fed back as a new few-shot example in the model prompts.
99.9%
global accuracy
Measured on real data
<5s
processing time
Per incoming email
3
decision categories
To Pay Β· Disputed Β· On Hold
∞
continuous improvement
Active feedback loop
Architecture

End-to-end pipeline

The main flow processes each email in under 5 seconds. Ambiguous cases branch to the human dashboard, whose corrections continuously feed the few-shot example base.

πŸ“¬
Email Inbox
IMAP / Microsoft 365
β†’
πŸ“„
Parser
Body + PDF extraction
β†’
🧠
LLM Classifier
GPT-4 + few-shot
β†’
βš–οΈ
Decision
Pay Β· Dispute Β· Hold
β†’
🏦
Eloficash API
ERP update
πŸ”„
Feedback loop β€” Human-in-the-loop

When the model's confidence falls below the configured threshold, the invoice is escalated to the dashboard. The operator sees the full context, chooses the correct decision, and their correction is automatically added to the few-shot example base. The model improves with every correction β€” no costly retraining required.

Algorithm

Few-shot prompting
anchored in PwC context

Rather than fine-tuning an expensive model, Invoice Intelligence dynamically builds a prompt enriched with similar examples retrieved from a base of past cases. The model sees real precedents before deciding.

πŸ“ Prompt anatomy
1. System context
Role definition, decision categories and PwC business rules.
2. Few-shot examples
3 to 5 similar past cases retrieved by semantic similarity from the correction base.
3. Email to classify
Extracted content from the current email β€” body, amount, sender, parsed attachment.
4. Output format
Structured JSON: decision, confidence level, short justification, Eloficash fields.
βœ…To Pay

The invoice is recognised, the amount matches a purchase order in Eloficash, and the sender is a registered supplier. Payment triggered automatically.

"Invoice #INV-2024-0891 β€” €4,200 β€” Sodexo β€” Matches PO-7821"
⚠️Disputed

Amount diverges from the contract, duplicate billing detected, or unrecognised supplier. The invoice is frozen and a dispute ticket is opened automatically.

"Invoice #INV-2024-1102 β€” €6,800 β€” amount exceeds framework contract of €5,000"
⏸️On Hold

Missing information, hierarchical approval required, or insufficient model confidence. Escalated to the human dashboard for a final decision.

"Invoice with no order reference β€” unregistered sender β€” approval required"
πŸ–₯️ Supervision dashboard
πŸ”
Full context view
The operator sees the original email, the model's decision, the justification and the similar cases that influenced it.
✏️
1-click correction
The operator picks the correct category. The correction is timestamped, logged and immediately added to the example base.
πŸ“ˆ
Reporting & analytics
Volume processed, average confidence score, correction frequency by category β€” to monitor model quality over time.
Preview

The product in pictures

Invoice Intelligence screenshot 1
1 / 3
Tech Stack

LLM-first,
ERP-native

No costly fine-tuning. The power comes from few-shot examples and direct ERP integration. The model improves through human corrections, with no heavy ML infrastructure.

LLM & AI
🧠
GPT-4 (Azure OpenAI)
Few-shot classification with dynamically built prompts
πŸ—‚οΈ
Few-shot retrieval
Vector store of past cases β€” semantic similarity to enrich each prompt
Ingestion
πŸ“¬
Microsoft 365 / IMAP
Real-time reading of finance team mailboxes via Graph API
πŸ“„
PDF Parser
Structured extraction of invoice data from attachments
ERP Integration
🏦
Eloficash API
Automatic update of status, amount, supplier and reference in the ERP
πŸ”—
Webhook events
Real-time notifications to relevant teams on each decision
Oversight
πŸ–₯️
Next.js Dashboard
Human validation interface with full context and correction logging
πŸ“Š
Analytics & reporting
Tracking of confidence rate, volume processed and decision quality over time
BotiqueAI
Custom AI and LLM solutions for enterprise clients
← Back to portfolio