JAGADISWAR / LEARNINGS / FORMFINANCE
FINANCE / AUTOMATION

What I learned
building FormFinance.

Buildathon prototypePythonFastAPIAI/MLOCR

An AI finance workflow for settlement verification, deduction reconciliation, evidence matching and auditable financial decisions.

LEARNINGS / FORMFINANCEBUILDATHON PROTOTYPEAMBATI JAGADISWAR REDDY
01 / OVERVIEW & STATUS

What it is, and where it stands.

FormFinance was built for the Razorpay AI Buildathon 2026 (Track 04, AI Finance Controller). It takes a settlement PDF, extracts the amounts with OCR, runs rule-based checks, matches deductions to supporting evidence, sends unclear cases to an AI agent, and records an approve, flag or escalate decision with an audit trail.

The settlement pipeline lives inside a larger monorepo called FormWise, which already provided document upload, OCR and an AI-provider layer. The pipeline is a prototype working on synthetic data.

Status
Buildathon prototype
Event
Razorpay AI Buildathon 2026, Track 04
Data
Synthetic demo settlements; no live Razorpay integration (stated in the README)
Backend
Python, FastAPI, with a separate OCR worker using PaddleOCR
Frontend
Next.js 15, React 19, TypeScript
AI layer
Pluggable provider interface with Ollama and mock implementations
02 / WHAT I LEARNED

Lessons from the build.

The main design question was how much to trust an AI model with money. The answer in this build is: as little as possible, and always on the record.

LESSON / 01

Deterministic first, AI second

The verifier is plain code with no LLM: settlement arithmetic (gross minus deductions equals net, within a 1% tolerance), positive amounts, net not above gross, each deduction not above gross, and extraction confidence of at least 0.5.

LESSON / 02

Three outcomes beat pass or fail

Each deduction ends up verified, disputed or unverifiable, and a settlement ends up approved, flagged or escalated. “Unverifiable” is a different problem from “wrong”.

LESSON / 03

Auditability is a feature

Extraction, verification, agent investigation and the final decision are each written as finance audit events, so a decision can be traced back to the checks behind it.

LESSON / 04

Evidence changes the answer

Deductions are compared against evidence extracted from supporting documents (amounts, dates and normalized references), so a deduction can be confirmed by something other than itself.

TECHNICAL CONCEPTS

OCR to structured data

PaddleOCR text is parsed into settlement and deduction models with a confidence score for each extracted deduction.

Tolerance-based comparison

Amounts are compared with a small percentage tolerance rather than exact floating-point equality.

Confidence thresholds

Low-confidence extractions are marked unverifiable instead of being guessed at.

Agent routing

Only deductions the rules cannot settle are passed to the finance agent, which returns a structured result.

Provider abstraction

The agent depends on an AI provider interface, which makes it possible to swap a local model for a mock in tests.

Service and worker split

The API handles requests while OCR runs in a separate worker service.

03 / CHALLENGES & DECISIONS

Challenges and engineering decisions.

Where the build pushed back, and what I decided to do about it.

Messy input

OCR output is not always reliable

CHALLENGEA misread amount could produce a confident but wrong verification.

DECISIONEvery extracted deduction carries a confidence value, and anything under the threshold is marked unverifiable and escalated to the agent or a human.

AI boundaries

Deciding what the agent should touch

CHALLENGESending everything to an LLM is slow, costly and hard to audit.

DECISIONRules run first and settle the clear cases. The agent only investigates ambiguous deductions, and its investigations are logged as audit events.

Testing

No real financial data to test with

CHALLENGEReal settlement reports are sensitive and were not part of this prototype.

DECISIONThe tests use generated PDF fixtures covering a valid settlement, a deduction mismatch, missing evidence, an escalation case and chargeback evidence that matches or does not.

Architecture

Adding finance logic to an existing platform

CHALLENGEThe settlement work had to fit the FormWise monorepo rather than start from nothing.

DECISIONIt was added as separate modules (settlements, evidence, verification, audit) that reuse the platform’s document, OCR and AI-provider layers.

04 / POTENTIAL IMPROVEMENTS

What I would improve next.

Ideas grounded in what the current code and documentation say is missing.

From prototype
to something sturdier.

  • Test against realistic, labelled settlements, not only synthetic ones, before drawing conclusions about accuracy.
  • Add policy-aware rules, such as fee ranges and tax rates, on top of the current arithmetic and consistency checks.
  • Move persistence from the local demo storage to Firestore, as the README roadmap describes.
  • Add role-based access, multi-tenant separation, and a multi-level approval workflow.
  • Connect to a real settlement data source and make the verification rules configurable instead of hard-coded.

The code is the artifact.
The learning is the leverage.

Concise notes on FormFinance, written to make the decisions behind it easy to discuss in a review, interview or collaboration.