Inspiration

Finance managers at SMBs have 4,000 transactions, a policy PDF nobody reads, and no time. Violations slip through. Split charges go unnoticed. A $2,850 Four Seasons stay gets approved because it looked like normal travel. We built the tool that actually catches it.

What It Does

BrimIQ is an AI expense intelligence platform built on real anonymized SMB data (4,400+ transactions, 50 employees, 6 months from a fleet trucking company).

Talk to Your Data — Ask questions in plain English, get charts and summaries back. Multi-turn context: "What did Marketing spend on software?" → bar chart → "Compare to Engineering?" → updated view, no re-explanation.

Policy Compliance Engine — Two-phase AI detection across 6 targeted rule types: split transactions, personal expenses on corporate cards, high meal charges, duplicate billings, luxury hotels, and alcohol without business context. Phase 1 runs deterministic rules in milliseconds. Phase 2 sends flagged violations to Claude in concurrent batches — it knows that a $250 diner charge from a long-haul driver crew is different from a solo manager at a steakhouse. Result: 95 meaningful violations instead of 800+ noise.

AI Pre-Approval Workflow — Finance team sees the request, employee spend history, department budget, and Claude's approve/deny recommendation. One click to decide.

Automated Expense Reports — Transactions grouped by employee + period + category, policy-checked inline, routed to the CFO with approval workflow built in.

Data Engineering

The raw dataset had 4,235 real transactions but zero employee identity or department structure — just a ledger. We built a 50-person org chart (Operations drivers, Sales, Management, Finance, IT), attributed all transactions to employees, then added 232 synthetic transactions for non-Operations departments using real MCC codes and realistic CAD amounts. Sales and Management records were intentionally seeded with policy violations (luxury hotels, split charges, high-end dining) to showcase all four platform capabilities against realistic patterns.

How We Built It

Backend: FastAPI + Python, streaming via SSE. An ExpenseAgent orchestrates multi-step reasoning through Claude's tool-use API with specialized tools for SQL queries, policy scanning, approvals, and report generation.

AI Engine: Phase 1 deterministic rules pre-filter 4,400 transactions to ~95 candidates. Phase 2 runs 3 concurrent Claude API batch calls (15 violations each) with full company context — employee role, merchant type, industry norms — re-ranking severity and generating audit-ready reasoning per violation.

Frontend: Next.js 15 + TypeScript + Tailwind CSS + Recharts. Streaming chat, grouped violation explorer, and a policy page that explains each detection rule with real data examples.

Challenges

Noise vs. signal: A naive amount > $50 rule generated 800+ violations — useless. Rebuilding Phase 1 with 6 targeted rules tuned to the actual data patterns brought signal quality from ~15% useful to ~95% actionable.

Scale + timeout: Enriching 800 violations sequentially with Claude would take hours. We built concurrent batching with progressive fallback — Phase 1 results hit the database immediately; Phase 2 AI context layers in without blocking.

MCC unreliability: Real-world merchant category codes are messy. BLACKJACKS ROADHOUSE is classified as a bridge toll (MCC 4784). We built merchant-name-aware filtering on top of MCC logic to handle it.

What We Learned

The most valuable thing Claude does isn't following rules — it's recognizing patterns a rules engine would never catch, and explaining why something is suspicious in plain English that a non-technical finance manager can act on immediately.

Built With

Share this project:

Updates