One-day hackathon demo for a Duvo automation that validates purchasing intent, reviews vendor invoices before payment, and closes vendor disputes from Gmail replies.
The workflow:
- Duvo Automatic Ordering validates the upstream PO context from forecast, inventory, supplier, and approval data.
- Vendor invoice arrives in Gmail.
- Duvo extracts invoice fields from the attachment/body.
- Duvo compares the invoice against Google Sheets purchase orders and uploaded policy files.
- Duvo logs the review in
invoice_reviews. - Duvo asks for human approval before sending dispute emails or marking high-value invoices ready for payment.
- Duvo handles vendor replies, links them back to the open invoice case, and closes the loop when a correction or missing PO is confirmed.
flowchart LR
Gmail["Gmail invoice inbox"] --> Intake["Intake Agent<br/>classify invoice queue"]
Intake --> Ordering["Ordering Context Agent<br/>Duvo Automatic Ordering"]
Forecast["demand_forecasts"] --> Ordering
Inventory["inventory_position"] --> Ordering
Rules["supplier_rules"] --> Ordering
POs["purchase_orders"] --> Ordering
Ordering --> Validation["Invoice Validation Agent<br/>vendor, PO, amount, VAT, duplicate risk"]
Validation --> Risk["Risk & Policy Agent<br/>approved / needs_review / dispute"]
Risk --> Sheets["Google Sheets<br/>invoice_reviews"]
Risk -->|low risk| Ready["Ready for payment"]
Risk -->|risky action| HITL["Human-in-the-Loop approval"]
HITL --> Vendor["Vendor Resolution Agent<br/>send dispute or PO request"]
Vendor --> Reply["Vendor reply in Gmail"]
Reply --> Validation
Sheets --> Dashboard["Dashboard Agent<br/>money at risk, open cases, audit trail"]
In the batch demo, Duvo processed three invoice emails, reordered them by risk, blocked EUR 10,150 in duplicate and overcharged payments, requested approval, sent vendor dispute emails, and updated invoice_reviews with Gmail message IDs.
- Duvo run:
5715c7c8-62f9-4e00-9794-1ffc64d82724 - Google Sheets output:
invoice_reviews!A7:N9 - Batch result: 3 invoices processed, 3 disputes, EUR 10,150 blocked.
- Human-in-the-Loop: approval required before sending all vendor dispute emails.
- Dashboard Agent summary: count by status, money at risk, open cases, Automatic Ordering context, Gmail message IDs, and Sheet rows updated.
src/vendor_invoice_autopilot.py- deterministic review engine used for local validation and demo output.scripts/run_demo.py- runs synthetic invoices through the review engine and writes a Sheets-ready CSV.data/*.csv- seed data for Google Sheets tabs, including Automatic Ordering context.demo_inbox/*.eml- Gmail-style sample messages for the live story.demo_invoices/*.json- extracted invoice payloads matching the sample messages.demo_replies/*.json- vendor reply payloads that resolve open dispute and missing-PO cases.duvo/*.md- assignment SOP, approval policy, and demo script to paste into Duvo.tests/test_vendor_invoice_autopilot.py- acceptance scenarios for invoice review and closed-loop vendor replies.
python3 scripts/run_demo.py
python3 scripts/run_real_case_test.py
python3 -m unittest tests/test_vendor_invoice_autopilot.py tests/test_real_case_email_flow.pyThe demo writes out/invoice_reviews.csv. Import data/vendors.csv, data/demand_forecasts.csv, data/inventory_position.csv, data/supplier_rules.csv, data/purchase_orders.csv, and out/invoice_reviews.csv into Google Sheets as the demo tabs.
The real-case smoke test writes out/real_case_invoice_reviews.csv and uses the four email fixtures in live_cases/emails/.
For a faster Google Sheets setup, import outputs/vendor_invoice_autopilot_workbook.xlsx. It already contains the vendors, demand_forecasts, inventory_position, supplier_rules, purchase_orders, invoice_reviews, and demo_reviews_backup tabs. Rebuild it with scripts/create_workbook.py after changing demo data.
- Connect Gmail and Google Sheets in Duvo.
- Enable the Duvo
Automatic Orderingskill on the assignment. - Upload the files in
duvo/as assignment reference files. - Create a Google Sheet with tabs named
vendors,demand_forecasts,inventory_position,supplier_rules,purchase_orders, andinvoice_reviews. - Paste
duvo/assignment_sop.mdinto the assignment SOP. - Send one of the
demo_inbox/*.emlexamples, or copy the email body into a real Gmail message. - Run the assignment and show Duvo's live execution/audit trail.
- Real workflow: procurement-to-payment control, not just invoice checking.
- Complexity: demand/PO validation, extraction, policy lookup, PO matching, duplicate detection, risk scoring, conditional approval, and closed-loop vendor reply resolution.
- Duvo capabilities: Automatic Ordering, Gmail, Google Sheets, Files, Human-in-the-Loop, audit/live execution.
- Business impact: prevents overpayment and reduces AP review time.
- Wow moment: Duvo does not start at the invoice. It validates why the PO exists, blocks bad invoices before payment, emails the vendor with approval, reads the vendor's reply, updates the case state, and leaves a complete audit trail.