Back to Projects
~/projects/invoice-ai[LOADED]

InvoiceAI

Next.jsGemini 2.0 FlashOlmOCR

Automated invoice processing that pulls from Outlook, extracts data with AI, and organizes by job site.

A full-stack system for Diamond Homes Construction that automatically pulls invoice attachments from Outlook, uses OlmOCR and Gemini to extract structured data, then organizes everything by construction job address. No more manual data entry or hunting through email.

InvoiceAI screenshot

The Problem

Diamond Homes Construction drowns in invoices from dozens of vendors, all arriving via email. Manual data entry is slow and error-prone. When tax season hits, finding the right invoice for the right job becomes an archaeological dig through Outlook folders.

The Solution

The system connects to Outlook via Microsoft Graph API and pulls invoice attachments automatically. OlmOCR converts PDFs to markdown, then Gemini extracts vendor, amount, date, and service type with JSON schema validation. Files get renamed and organized by job site address.

Interesting Details

  • Outlook integration via Microsoft Graph API automatically pulls attachments with date filtering and deduplication
  • OlmOCR converts PDFs to markdown before Gemini 2.0 Flash extracts structured data
  • Address-first filenames like 4407Sedona_Perdomo_587244_Paint_20250227_6000.00.pdf make finding invoices trivial
  • Vendor normalization maps variations ("B&W Chemical Toilets" to "BWChemicalToilets") to prevent duplicates
  • 85-90% address extraction accuracy with parallel batch processing

Built With

Next.js 15React 19Gemini 2.0 FlashOlmOCRMicrosoft Graph APIPythonSQLite