Modernizing San Francisco’s Invoice Review Process
Overview
The Cal Poly Digital Transformation Hub (DxHub), in collaboration with Amazon Web Services (AWS), worked with the City and County of San Francisco’s Mayor’s Office of Housing and Community Development to explore how generative AI can support their invoice auditing process. The City manages contracts with more than 200 nonprofit partners, requiring staff to manually verify roughly 100 projects each quarter—a task that involves reviewing documentation ranging from 30 to over 800 pages per organization to ensure billed expenses match payment records and supporting materials.
To address this challenge, the DxHub team built an intelligent reconciliation tool that automates the extraction and alignment of invoice line items with their corresponding backup documents. Leveraging Optical Character Recognition (OCR), AI-driven extraction, and fuzzy matching, the tool demonstrates potential AI use cases for aiding the City’s review of unstructured data.
Problem
San Francisco’s finance team confronts a massive administrative bottleneck: validating invoices from nonprofit partners requires a three-step verification process that matches invoice line items to supporting documents (payroll records, receipts, invoices) and then to payment proof (bank statements, checks, credit card records). Nearly all of this work is done manually.
Staff create individualized spreadsheets for each organization, pull gross payroll figures, compute FTE distributions, and track vendor payments across documents where entity names rarely align. Nonprofits submit materials in varying formats, frequently with gaps or errors that spark repeated clarification requests.
Innovation In Action
The DxHub team created an intelligent reconciliation tool to assist the city’s current review process. Staff upload all documentation—invoices, payroll records, receipts, bank statements—in a single batch via drag-and-drop. The system automatically categorizes each document by budget line using filename conventions, with AI stepping in when files are ambiguous.
The tool parses line items from CSV invoice files and matches them to uploaded PDFs using a dual-verification approach: amounts must match and at least one keyword must align. This prevents false matches that occurred in early testing with common dollar figures. When reviewers click on a sub-item, the system highlights the corresponding text directly on the relevant PDF pages.
A Boolean search function allows users to query uploaded PDF documents using OR/AND logic with specific amounts and keywords. Reviewers mark each match as either “Invoice” or “Proof of Payment,” and the system generates a report showing which line items have been matched with corresponding backup documents.
When automated matching falls short, reviewers can manually highlight text or link PDF pages to specific line items—preserving human oversight of the reconciliation process. As one client remarked after a recent demonstration, the tool was “a whole leap beyond what you showed us last time.”
Technical Solution
The platform runs on a serverless AWS architecture deployed via Cloud Development Kit (CDK), enabling single-script provisioning for consistent, repeatable infrastructure setup. Document processing accommodates multiple formats—PDFs, CSV files, and scanned images—using Amazon Textract’s optical character recognition to extract text and numerical data.
An AI classification layer powered by Amazon Bedrock categorizes uploaded documents by budget type when filename conventions aren’t sufficient. The matching engine relies on Lambda functions to perform AI-based extraction and fuzzy matching, using proximity and keyword searching to align entities with invoice line items.
Amazon Cognito manages user authentication for secure staff access. DynamoDB stores matching data and serves as a cache to avoid re-extracting entities from documents previously uploaded to the system.
Supporting Documents
| Source Code | All of the code and assets developed during the course of creating the prototype. |
| Architecture Diagram | A diagram that describes the technical components needed to implement the solution. |
About the DxHub
The Cal Poly Digital Transformation Hub (DxHub) is a strategic relationship with Amazon Web Services (AWS) and is the world’s first cloud innovation center supported by AWS on a University campus. The primary goal of the DxHub is to provide students with real-world problem-solving experiences by immersing them in the application of proven innovation methods in combination with the latest technologies to solve important challenges in the public sector. The challenges being addressed cover a wide variety of topics including homelessness, evidence-based policing, digital literacy, virtual cybersecurity laboratories and many others. The DxHub leverages the deep subject matter expertise of government, education, and non-profit organizations to clearly understand the customers affected by public sector challenges and develop solutions that meet the customer needs.
