Inspiration

Anyone who has ever submitted a corporate expense report knows the pain. You end up stuffing wrinkled paper receipts into your wallet, taping them to sheets of paper, and spending Friday afternoons typing endless data into clunky, outdated software just to get your own money back weeks later.

On the flip side, corporate accounting teams are forced to eyeball thousands of these claims every month. It’s boring, tedious work that leads to reviewer fatigue and slips in compliance. Even worse, legacy systems rely on rigid, dumb rules—like flagging any receipt over $100—which miss clever fraud while penalizing legitimate purchases.

We asked ourselves: What if we didn't just treat expense reporting like a boring data entry form? We wanted to build an autonomous AI team of forensic accountants that can read a receipt, understand the context, check corporate policy, and catch fraud in seconds rather than weeks.

What it does

ClearAudit turns the entire expense reporting lifecycle into a zero-latency, intelligent conversation. Instead of filling out complicated forms, an employee can simply drag-and-drop a photo of a receipt or type a quick chat message like: "Audit $45.99 from Uber on 2026-06-25 for client transit."

Behind the scenes, ClearAudit instantly passes the transaction through a sequential multi-agent AI pipeline that evaluates the claim in real time:

  1. OCR Data Extraction Agent: Reads messy images or natural language text to pull exact numeric amounts, ISO dates, and merchant names.
  2. Semantic Categorization Agent: Understands the business context (e.g., mapping GitHub to Software & Infrastructure or airlines to Travel & Transit) so users never have to guess obscure accounting codes.
  3. Corporate Policy Checker Agent: Checks company-wide spending ceilings and verifies that mandatory tax documentation is attached.
  4. Forensic Fraud & Risk Analysis Agent: Acts like a seasoned auditor, evaluating duplicate charge velocity, price inflation anomalies, and numerical probability distributions to calculate an instant risk score.

ClearAudit features dedicated workspaces for regular Workers (with live UI polling and interactive calendar spending heatmaps) and Chief Financial Officers (offering executive anomaly triage, conversational policy updates, instant JavaScript PDF report generation, and automated HR email alerts for rejected claims).

How we built it

We built ClearAudit as a modern, decoupled cloud web application focused on speed, reliability, and clean separation of concerns:

  • Frontend Experience: Built with React 18, Vite, and custom Tailwind CSS. We focused heavily on a rich, glassmorphic UI with smooth micro-animations and dynamic dark/light modes. The frontend is deployed on Vercel's Edge Network with custom SPA routing rules to eliminate page reload crashes.
  • Backend State Engine: Engineered on Node.js and Express.js hosted on serverless Render containers. We used Multer for in-memory multipart file streaming, ensuring receipt documents buffer straight to cloud storage without cluttering container disk space.
  • Multi-Agent AI Core: Powered by Google's Gemini multimodal models. Instead of relying on one massive prompt, we engineered a deterministic state machine (orchestrator.js) that hands jobs off sequentially between 4 specialized agents using strict JSON validation guardrails.
  • Database & Cloud Storage: Powered by Supabase (PostgreSQL) to maintain strict relational data integrity across transactions, company compliance rules, and employee RBAC profiles, alongside cloud storage buckets for receipt binaries.
  • Mathematical & Forensic Logic: To quantify fraud risk objectively, our forensic agent evaluates statistical anomalies. We model numerical fabrication risk using Benford’s Law logarithmic distribution for leading digits $d \in {1, 2, \dots, 9}$: $$P(d) = \log_{10}\left(1 + \frac{1}{d}\right)$$ When users submit suspicious round numbers or inflated claims, we measure the standard score deviation from historical category thresholds $\mu_{\text{cat}} \pm k\sigma_{\text{cat}}$, normalizing these factors into a final quantitative Fraud Score: $$S_{\text{fraud}} = \min\left(100, \;\alpha \cdot \Delta_{\text{Benford}} + \beta \cdot \frac{|x - \mu_{\text{cat}}|}{\sigma_{\text{cat}}} + \gamma \cdot V_{\text{velocity}}\right)$$

Challenges we ran into

  • Single-Shot AI Hallucinations: Early in development, we tried asking a single LLM prompt to read the receipt, categorize it, check company rules, and score fraud all at once. The model constantly overwhelmed its context window, dropping formatting or hallucinating numbers. We solved this by breaking the workload into our 4-stage sequential state machine, where each agent performs one micro-task and passes validated JSON to the next.
  • Serverless Binary Bloat: Generating month-end PDF reports originally required heavy headless browser tools like Puppeteer. These external binaries kept causing memory spikes and crashing our serverless container instances. We completely tore that out and rewrote the PDF engine using PDFKit, compiling clean single-page executive reports directly inside pure JavaScript memory buffers with zero latency.
  • Dashboard Data Distortion: When we first built the CFO dashboard, grouping pending, flagged, and rejected expenses together completely skewed the active accounting numbers. We had to architect a strict Version 2.0 Accounting Separation Logic that separates gross velocity burn from actual cleared balance sheet totals so the CFO always sees unvarnished truth.

Accomplishments that we're proud of

  • Zero-Latency Transparency: We love watching the live polling dashboard in action. When an employee uploads a receipt, they can literally watch the status update live across the UI table every 3 seconds as the background AI agents process their claim.
  • Catching "Smart" Fraud: We're really proud of how the forensic agent thinks. If you submit a $500 invoice for AWS hosting, it clears automatically. But if you submit a $500 claim categorized under Meals at a local coffee shop, the AI immediately flags the statistical anomaly and explains its reasoning to the CFO.
  • Making Finance Feel Premium: Let's be honest—corporate finance software usually looks terrible. We're proud that we built a financial tool that feels sleek, modern, and genuinely enjoyable to use.

What we learned

  • Decoupled AI is King: We learned firsthand that breaking complex AI workflows into smaller, specialized agents with clear boundaries makes software dramatically more deterministic and reliable for enterprise use.
  • Accounting Precision Matters: Building financial software taught us that pretty UI isn't enough; every single state transition must tie back cleanly to relational database rows so the math always balances out.
  • Designing for Humans: We learned how much faster everyday tasks become when you replace rigid dropdown menus with natural language chat interfaces.

What's next for ClearAudit

  • Direct ERP Integrations: Building OAuth2 bridges to export cleared, approved audit batches directly into accounting systems like SAP Concur, NetSuite, and QuickBooks.
  • Dynamic Machine Learning Thresholds: Training unsupervised Isolation Forests on specific company historical purchasing data so anomaly weighting adapts organically to each company's unique spending habits over time.
  • Global Tax Localization: Integrating real-time foreign exchange (FX) conversion APIs and automated VAT deduction mapping for multinational enterprise teams.

Built With

Share this project:

Updates

Submission history