💡 Inspiration

Every accounts payable team has the same problem: most invoices are boring. They're correct, they match their purchase order, and they should just get paid. But a handful every single day have a price variance, a short delivery, a missing PO, or they're an outright duplicate — and those few exceptions eat the entire team's day.

The cost isn't just wasted hours. A missed duplicate or an over-billed line isn't a typo — it's real money walking out the door. We wanted to build something that lets AI agents do the routine work so people only spend time on the decisions that actually need a human — without ever losing control of the money or the audit trail.

That's Project Clarus.

🤖 What it does

Clarus runs the full Invoice-to-Pay process end to end:

Ingest — invoices arrive by email, EDI, or upload, picked up by a UiPath RPA robot. Extract — an AI agent turns the raw document into structured data (vendor, line items, totals, PO reference). 3-Way Match — a deterministic engine checks each invoice against its purchase order and its goods receipt. Branch — clean invoices under our policy threshold are auto-approved (straight-through processing). Anything with an exception, or over threshold, is routed for review. Triage — an AI agent classifies the exception (price variance, quantity, duplicate, missing PO) and recommends an action with its reasoning. Human approval — a reviewer in UiPath Action Center approves, rejects, or escalates. No money moves without a named human decision. Post to ERP — once approved, an RPA robot posts the invoice and schedules payment.

Every step writes to an audit log, so any invoice has full lineage — from ingestion to payment, including who approved it and why.

🏗️ How we built it

Clarus has three layers:

Orchestration — UiPath Maestro (BPMN 2.0). Maestro runs the process, branches on the match result, and routes to a human task in Action Center. Orchestrator manages the invoice queue and the RPA robots. Agents — Python + FastAPI. Four specialists:

Extraction Agent — LLM with structured outputs, document → structured invoice. Match Agent — deterministic, rule-based code, not an LLM — because a 3-way match is exact arithmetic and auditors need it perfectly reproducible. Triage Agent — LLM reasoning, classifies exceptions and recommends actions. ERP Robot — unattended RPA that posts approved invoices.

Operations Console — React 18 + TypeScript + Tailwind + Framer Motion. A live dashboard with the invoice queue, invoice detail with a per-agent timeline, a process view, and a governance/audit view.

The FastAPI service is the integration seam: Maestro calls it over HTTP at each agent step. That keeps orchestration and agent logic cleanly separated — UiPath governs the process, the agents do the work, and either side can evolve independently.

Our guiding principle throughout: deterministic where it must be auditable, LLM only where you genuinely need judgment, and a human gate on every dollar.

🧠 What we learned

Not everything should be an LLM. Our most important design decision was making the 3-way match plain deterministic code. In finance, reproducibility beats cleverness — an auditor has to be able to re-run a match and get the identical result. Human-in-the-loop is a feature, not a fallback. Framing the human approval as a first-class governance step (rather than "the AI failed, ask a person") changed how we designed the whole flow. The orchestration boundary matters. Letting Maestro own the process and FastAPI own the agents made both far easier to build and reason about.

🧱 Challenges we ran into

Designing the deterministic/LLM split so the system is smart where it helps and rigid where it must be. Getting reliable structured output from the extraction agent across messy, inconsistent invoice formats. Wiring Maestro → FastAPI → Action Center into a clean end-to-end run with a real human task in the loop. Building audit lineage that captures every agent action and the human decision, so nothing is a black box.

🚀 What's next

More exception types and a confidence-driven auto-approval policy. Vendor-level learning so recurring exceptions get smarter recommendations. Deeper ERP integrations and live payment scheduling. A reviewer feedback loop so human decisions continuously improve the Triage Agent.

Built With

Share this project:

Updates