Agentic Expense Management
Xpendee
An expense management platform running on AI agents that capture, check, approve, and book company spend, with its reasoning visible at every step.
- Expense Automation
- Receipt Capture
- Expense Agent
- Spend Controls
- Expense Approvals
- My role
- Product design, architecture, and full-stack build
- What I built
- An expense platform where an AI agent manages every expense
- Product focus
- Agentic spend control and automation

<Product Overview/>
Most expense tools just digitize the paperwork. Xpendee eliminates it - an expense platform where an AI agent does the work, and humans step in only where judgement matters.
The problem
Expense management is still manual review at scale: someone reads every receipt, guesses the category, checks it against policy, and re-encodes it into accounting. Errors slip through, policy is enforced after money is already spent, and finance teams are always weeks behind.
The solution
Xpendee puts an AI agent in the workflow itself. It extracts and categorizes every expense, checks it against company policy, routes only genuine exceptions to humans, and posts approved spend to accounting — with a visible reasoning trail on every decision.
The approach
Every expense flows through a six-node agent pipeline: Intake, Validate, Categorize, Policy Check, Route, Record. Each one lands in one of three zones — clean expenses are handled autonomously, ambiguous ones need one-tap confirmation, and violations are escalated with a plain-language explanation.
What it delivers
Policy enforced before money moves, not after. With Pay by Bank, employees pay merchants directly from company funds using their mobile phones under pre-configured spend mandates — so payment, receipt, and accounting entry are created as one event, with nothing left to reconcile at month-end.
<Product Features/>
The core workflows and modules that make up the product.
Expense Capture
Receipts arrive by photo, file upload, or email forward. Merchant, date, amounts, and tax breakdown are extracted automatically and matched to the right category.
Routing & Approvals
Approval paths adapt to amount, department, expense type, and policy exceptions. Reviewers get a queue of decision-ready items instead of a pile of receipts.
Policy & Spend Controls
Configurable spend limits, receipt rules, category restrictions, and budgets by team or project. Out-of-policy spend is caught before money moves, not after.
Spend Mandates
Issue spend mandates for employees or projects — scoped by limit and category. Employees pay merchants directly from company funds, never out of their own pocket.
Spend Visibility & Reporting
Dashboards and custom reports across status, category, exployee, team, project, and period, with budget-vs-actual tracking and exports for finance.
Tax & Accounting Integration
Approved spend posts to the ledger — account, dimensions, VAT breakout, and withholding computed at payment — with traceable sync states with other systems.
<The AI Layer/>
How AI is designed into the product — what it decides on its own, what it hands to a human, and how every decision stays explainable.
Agent Pipeline
- 01
Intake
Normalize receipts, payments, and manual entries into one shape
- 02
Validate
Completeness, coherence, and duplicate detection
- 03
Categorize
Map to the company's real chart of accounts, with confidence
- 04
Policy Check
Deterministic rules first, LLM judgment only when rules are inconclusive
- 05
Route
Decide autonomy level and select the right approver
- 06
Record
Post to the books, update budgets, queue accounting sync
Built with LangGraph, each node writes a structured decision — input, output, reasoning, and confidence — so any expense can replay exactly why it was handled the way it was.
How Autonomy Is Scoped
Act
High-confidence, in-policy expenses are categorized and recorded without human involvement. Most routine spend never reaches a person.
Confirm
Ambiguous categories, medium confidence, or near-limit amounts are proposed by the agent and confirmed by a human in one tap.
Escalate
Policy violations, suspected duplicates, and low-confidence cases are held and escalated with a plain-language explanation of what triggered them.
Designing AI You Can Trust With Money
Explainable by default
Every decision carries its reasoning, confidence score, and the data it was based on. The UI surfaces this as a reasoning trail on each expense — no black-box approvals.
Rules before the model
Deterministic policy checks always run first; the LLM is consulted only for genuinely ambiguous judgment calls. Hard limits are never left to a model's discretion.
Fail-safe by design
AI sits in the payment path under a strict latency budget. If the agent service is unavailable, low-value payments proceed and are flagged for review while high-value ones hold for human confirmation — the system degrades safely rather than blocking or over-approving.
- Duplicate Detection
- Confidence-Based Categorization
- Policy-First Validation
- Exception Routing
- Decision Audit Trails
<How It Works/>
The agent pipeline and the engineering decisions that keep it safe, fast, and auditable.
Architecture Flow
Each expense moves through a clear agent pipeline from capture to accounting.
- 01
Capture
Employees submit a receipt by photo or email, enter an expense manually, or pay directly through Pay by Bank.
- 02
Validate
Confirm the expense has complete details, amounts that reconcile, and no duplicate or split submission.
- 03
Categorize
Match the expense to the right account in the company's chart of accounts, along with its category and tax treatment.
- 04
Apply Controls
Check the expense against company policy, mandate limits, remaining budget, and tax rules
- 05
Route
Record it automatically, ask for a one-tap confirmation, or send it to the right approver with the reason attached.
- 06
Execute Payment
Authorize the Pay by Bank transfer and commit the payment, receipt, and expense record together as one event.
- 07
Record & Sync
Post the entry to the books, update budgets, compute withholding, and sync it to the accounting system.
How It Was Built
The engineering decisions that keep the agent safe, reliable, and auditable.
Atomic payment events
A payment, its expense record, and its receipt request are created in one transaction, with the network call handled through an outbox pattern and idempotency keys. No card feeds, no matching jobs, no reconciliation step — the three records can never drift apart.
Agent in the payment path
Policy checks run synchronously before a payment executes, under a hard latency budget. Deterministic rules always run; the LLM is consulted only when rules are inconclusive. If the agent service is down, payments fail safe — small amounts execute and get flagged for review, large amounts hold for human confirmation.
Single source of truth
The agent runs as a separate stateless service (FastAPI + LangGraph) that reads context and proposes actions; Django owns all data and business rules. Every node's decision — input, output, reasoning, confidence — is persisted, so any expense can replay exactly why the agent did what it did.
<Technology Stack/>
The technologies, frameworks, and standards used to build the product.
Backend & Data
- Django
- PostgreSQL
- Celery
- Redis
- Google Cloud Run
- Docker
- Google Cloud SQL
- Google Cloud Storage
- Gunicorn
AI & Documents
- LangGraph
- Gemini on Vertex AI
- FastAPI
- pgvector
- Google Cloud Document AI
- Vertex AI Text Embeddings
- LangSmith
Frontend & Mobile
- Next.js
- React
- TypeScript
- RTK Query
- REST API
- React Native (Expo)
Payments & Integration
- Dukupay API
- NetSuite REST API
- Webhooks
- Resend
- Google Cloud Pub/Sub
<Project Highlights/>
- 01
Explainable by design
Every agent decision is logged with its input, reasoning, and confidence — any expense can show exactly why it was approved, held, or blocked.
- 02
Zero-reconciliation payments
Payment, receipt, and ledger entry are created as one event. There is nothing to match at month-end.
- 03
Tax computed at capture
VAT breakout, withholding, and deductibility checks happen the moment spend occurs — returns become review, not preparation.