Case study · Audit-evidence review
AuditFlow
AuditFlow checks a bundle of supporting documents (invoices, purchase orders, receipts, bank statements, and ledger entries), lists mismatches and missing evidence with the documents behind each finding, and routes every finding to a person. It supports an auditor's review; it doesn't decide whether anything is fraud or non-compliance.
Team project · with Abhijit Manna
- INV
- PO
- REC
- BNK
- LED
Invoice, purchase order, receipt, bank statement, and ledger entry.
- 01IntakeModel
- 02EvidenceModel
- 03AnomalyModel + code
- 04DecisionCode
- 05WorkpaperCode
A person reviews every findingand can raise each one in Zoho Desk
- My role
- Dataset, frontend, testing, and integration; later the PDF reports and Google Drive saving
- Context
- Syndicate by Maximor AO Hackathon, Track 2: Autonomous Office of the CFO
- Status
- Hackathon build with a public demo, evaluated on synthetic cases
- Stack
- Next.js
- TypeScript
- Python
- FastAPI
- Anthropic Claude
01Problem and objective
Most of evidence review is matching
Checking a payment means confirming that its invoice, purchase order, receipt, bank record, and ledger entry agree, and noticing what is missing.
Each check is a cross-reference: does the invoice amount match the purchase order, is the vendor the same everywhere, is there a receipt at all. The project's README makes the same point: the slow part of review is usually gathering evidence and checking that records agree, not the final judgment.
The objective was to do that groundwork in a consistent, traceable way and leave the judgment with a person.
Organize
Group a transaction's documents and list the support that is missing.
Check
Run a fixed set of consistency checks, never an open-ended search.
Trace
Tie every finding to its documents and to a stable ID.
Hand over
Route every finding to a person, with its evidence attached when it becomes a ticket.
02Five-stage pipeline
Five stages, two kinds of work
Three stages use Claude to read and compare documents. The two that set outcomes, routing and the workpaper, compute them in code and ask the model only for wording.
Documents in
- Invoices
- Purchase orders
- Receipts
- Bank statements
- Ledger entries
A sample case's text files, or up to 10 uploaded PDF or image files
01 · shown as “Read”
Intake
Decided by Model
- Model
- Classifies each document and extracts its amounts, tax, dates, vendor, and references.
- Code
- A JSON schema fixes the output fields. For uploads, the model can only name files that were actually uploaded.
agents/(source on GitHub, opens in a new tab)intake_agent.py 02 · shown as “Match”
Evidence
Decided by Model
- Model
- Groups the documents into a transaction, lists missing support, and rates its confidence.
- Code
- Fixes the case and transaction IDs. Optionally runs a second pass below 0.7 confidence and keeps both passes' gaps.
agents/(source on GitHub, opens in a new tab)evidence_agent.py 03 · shown as “Check”
Anomaly
Decided by Model + code check
Findings created
- Model
- Checks for the eight issue types, giving each finding its documents, a severity, and a one-line explanation.
- Code
- Supplies a subtotal-plus-tax check per document, and replaces the model's missing PO and missing receipt answers with its own.
agents/(source on GitHub, opens in a new tab)anomaly_agent.py 04 · shown as “Route”
Decision
Decided by Code
Routing
- Model
- Writes a one-to-two sentence reason for the decision.
- Code
- Any finding routes to human review; no findings can be cleared. Confidence is reported, never used to route.
agents/(source on GitHub, opens in a new tab)decision_agent.py 05 · shown as “Report”
Workpaper
Decided by Code
Finding IDs
- Model
- Writes a short label for each row with findings.
- Code
- Builds the rows, totals, and stable finding IDs. A case with no findings makes no model call.
agents/(source on GitHub, opens in a new tab)workpaper_agent.py
After the Decision stage
- No findings: the transaction can be cleared.
- Any finding: a person reviews it in the results table.
- Optional, per finding: raise it in Zoho Desk.
- The workpaper can be saved as a PDF report, or to Google Drive.
Where findings are created
In Anomaly: the model's findings plus the two presence checks computed in code. Workpaper then gives each finding a stable ID.
Where a person comes in
After Decision. Every transaction with a finding waits for a reviewer, who sees each explanation and the documents behind it.
Where Zoho Desk fits
After review, one finding at a time, when the reviewer chooses to raise it. Only uploaded documents can be sent.
The stages run in sequence behind one API call; see orchestration/ (source on GitHub, opens in a new tab).
03Findings and ticket workflow
From a finding to a Zoho Desk ticket
A reviewer can raise any finding as a ticket, with the documents behind it attached. Sending the same finding twice never creates a second ticket.
Teammate’s workBuilt by Abhijit Manna. I describe it from the code; it is not part of my contribution.
- ReviewerAuditFlow interface
- AuditFlow APIPOST /send-to-zoho-desk
- Zoho DeskDesk REST API
Review the findingPerson
Its explanation and the documents behind it. Any finding at all sends the transaction to review.
Send to Zoho DeskPerson
One finding, or every pending one in turn. Needs a company name, and works for uploaded documents, not sample cases.
Check access and inputCode
A valid access code is required. Text lengths, the finding ID's format, and file sizes are checked.
Find or create the accountApp
Tickets are grouped under the company name, with a matching contact.
Look for an existing ticketCode
Subjects start with the finding ID, so a repeat send finds the first ticket. The check and the creation share a lock.
Plan the attachmentsCode
The uploaded files behind the cited documents: up to 19 MB each and 50 MB per ticket. Anything left out is listed.
Create the ticketApp
Subject “[AF-…] label – document”. The body names the exception, the documents, why it was flagged, and the attachments.
Attach the filesApp
One request per file. A file that fails is named in a private comment; error details are never passed on.
See the outcomeResult
With the ticket number and a link whenever a ticket exists.
What a ticket request carries
- The company name
- The finding's ID, type, label, and explanation
- Its primary and related documents
- Which uploaded file each document was read from
- The uploaded files behind those documents
What the integration doesn’t do
- Ticket status is never read back from Zoho Desk; follow-up happens there.
- Nothing is sent automatically. A person chooses each finding to send.
- Sending is turned off unless the server has access codes, and each code has a daily ticket limit.
04Evidence and validation
What it checks, and what has been tested
AuditFlow looks for eight issue types only. They are exercised by fourteen synthetic cases; real-world accuracy has not been established.
Duplicate invoiceModel
The same invoice appears more than once in a transaction.
duplicate_invoice, cases 03, 09Amount mismatchModel
Amounts disagree across the transaction's documents.
amount_mismatch, cases 04, 09, 11Missing purchase orderCode
An invoice, and no document typed as a purchase order.
missing_po, cases 05, 11Missing receiptCode
An invoice, and no document typed as a receipt.
missing_receipt, cases 06, 09, 12Vendor mismatchModel
The vendor differs between documents.
vendor_mismatch, cases 07, 10Date inconsistencyModel
Dates out of sequence. A receipt dated before its invoice is normal and not flagged.
date_inconsistency, cases 08, 10Currency mismatchModel
Different currency codes with no stated conversion between them.
currency_mismatch, case 13Tax calculation mismatchModel + code check
Subtotal plus tax doesn't match a document's stated total, within one currency unit. Code does the arithmetic; the model must treat it as authoritative.
tax_mismatch, case 14
Cases are the synthetic benchmark cases that expect the finding.
agents/ anomaly_agent.py (source on GitHub, opens in a new tab)The benchmark
Fourteen synthetic cases, each a set of plain-text documents with a ground-truth file listing the expected findings and the expected action. Two cases are clean; twelve should go to review, and every issue type appears in at least one.
evaluate.py scores a run at the case and action level: was the transaction flagged or cleared correctly. CI validates every ground-truth file and runs the Python and frontend unit tests.
Tested
- Each issue type is exercised by at least one synthetic case.
- The README reports that most cases pass on every run, and that missing PO and missing receipt are now decided by code.
- Unit tests cover the pipeline code in agents/, the Zoho Desk connector, the PDF report, and Google Drive saving.
Not established
- Accuracy on real audit documents: the cases are synthetic fixtures, not customer audits.
- Repeatability on the current code: some cases varied between runs in earlier testing, and a full re-measurement hasn't been done.
- Anything outside the eight issue types, which AuditFlow doesn't look for.
dataset/case_09.json (source on GitHub, opens in a new tab)
{
"case_id": "CASE_09",
"transaction_id": "TXN_09",
"expected_findings": [
{
"type": "duplicate_invoice",
"documents": ["INV-1009-A", "INV-1009-B"],
"severity": "high"
},
{
"type": "amount_mismatch",
"documents": ["PO-1009", "INV-1009-A", "INV-1009-B", "BNK-1009", "LED-1009"],
"severity": "high"
},
{
"type": "missing_receipt",
"documents": ["PO-1009", "INV-1009-A", "BNK-1009"],
"severity": "high"
}
],
"expected_action": "human_review"
}
05My contribution
Who built what
AuditFlow was built with Abhijit Manna. The split below follows the README's team section and the commit history.
Garvit Mathur (me)
Benchmark dataset
Wrote the first twelve synthetic cases, CASE_01 to CASE_12: the document fixtures and their ground-truth findings.
Reviewer interface
Moved the frontend to Next.js and TypeScript and connected it to the pipeline API, with sample results shown when the backend is unavailable.
Commits
d5ce3d2(commit on GitHub, opens in a new tab)56d0a6d(commit on GitHub, opens in a new tab)7a0b43f(commit on GitHub, opens in a new tab)Upload and resolver controls
Wired document upload in the interface to the upload endpoint, and added the resolver switch and the badge shown when two Evidence passes disagree.
Commits
71089a1(commit on GitHub, opens in a new tab)e57d2f3(commit on GitHub, opens in a new tab)5a875d4(commit on GitHub, opens in a new tab)The first review workflow
Built the original reviewer-decision interface and decision history. It was replaced in October 2026 by the Zoho Desk flow.
PDF reports
Added the printable report, then a PDF generator that runs in the browser, loads only when used, and can't make network requests while building the file.
Commits
44310e2(commit on GitHub, opens in a new tab)226e640(commit on GitHub, opens in a new tab)Google Drive
Connecting Drive behind a feature flag, adding PDFs and images from Drive to a check, and saving the report to My Drive › AuditFlow › company › month without overwriting. The browser talks to Google directly; the backend isn't involved.
Commits
623d70a(commit on GitHub, opens in a new tab)028e267(commit on GitHub, opens in a new tab)925b086(commit on GitHub, opens in a new tab)2e9a1ba(commit on GitHub, opens in a new tab)Testing and documentation
Unit tests for the PDF and Drive modules, a manual browser test record for Drive saving (22 checks passed, 10 not yet run), CI for feature branches, and the README's screenshots and Drive section.
Abhijit Manna
README: Agent logic, orchestration, evaluation, backend reliability, and deployment.
From the commit history
- The agent specification: data contracts, prompts, and the ground-truth format
- The five pipeline stages (the agents/ modules)
- The orchestration API, including document upload
- The Evidence resolver
- Code-decided presence checks and stable finding IDs
- The evaluation script and model comparison
- Access codes and daily limits
- The Zoho Desk integration
- Benchmark cases 13 and 14
The pipeline described on this page follows Abhijit’s agent specification. Only the parts listed under my name are ones I built.
06Engineering decisions and trade-offs
Where the model stops and code takes over
Each card separates what the code does from why. Most of these reasons are written down in the code's own comments; they are team decisions, not mine alone.
D1
Check a fixed list of issues
- Implemented
The Anomaly prompt names exactly eight issue types, and the output schema's enum rejects any other. An empty list is a valid answer.
- Why · Documented in the repository
The prompt tells the model to check these types only, not to invent others, and not to force a finding when there is none.
- Trade-off
Issues outside the eight types are not reported at all.
D2
Route in code, not by confidence
- Implemented
Any finding sends the transaction to human review, and only a transaction with none can be cleared. Confidence is reported for context but never routes. The model writes only the plain-language reason.
- Why · Documented in the repository
An earlier rule gated on confidence and auto-cleared obvious, high-confidence findings, the opposite of what was intended. The docstring records the change.
- Trade-off
Every finding costs a person's time, including minor ones. Review effort isn't reduced for findings that are probably harmless.
D3
Compute structural facts instead of asking for them
- Implemented
Missing purchase order and missing receipt are decided after the model call, from the document types Intake extracted, and replace whatever the model said about them.
- Why · Documented in the repository
The model used to drop or invent these two findings from run to run, though they are a structural fact about the documents.
- Trade-off
The check is only as good as Intake's typing: a purchase order read as a ledger entry produces a missing-PO finding, which a person then reviews.
D4
Surface disagreement instead of hiding it
- Implemented
With the resolver on, an Evidence result below 0.7 confidence gets a second, independent pass. If the passes disagree, both lists of missing evidence are kept, the lower confidence wins, and the disagreement is recorded on the workpaper.
- Why · Documented in the repository
Two independent passes that disagree are a stronger signal for review than one low-confidence pass, and a gap either pass found should never be silently dropped.
- Trade-off
An extra model call on uncertain cases, and no help when the first pass is confidently wrong.
D5
Give each finding a stable identity
- Implemented
A finding's ID is a hash of its type and its anchor document, so a re-run produces the same ID. Ticket subjects start with that ID, which is how a repeat send finds the existing ticket. If older tickets can't all be checked, the send stops instead of risking a duplicate.
- Why · Documented in the repository
The model can cite slightly different documents for the same issue from run to run, but a reviewer's ticket still has to match the finding.
- Trade-off
Two findings of the same type on the same document get numbered suffixes, which depend on the order the model returns them in.
07Limitations and future work
What it doesn't do yet
Known limits of the current code, then possible next steps. Nothing in the second list is built.
Current codeKnown limitations
One transaction per check
Evidence groups every document in a check into a single transaction, so a bundle of unrelated payments isn't split apart.
Synthetic evidence only
The fourteen cases are plain-text fixtures. The upload path accepts real PDFs and images, but no accuracy has been measured on them.
Run-to-run variation
Model-judged findings can change between runs. The interface hides severity for that reason and labels confidence as reference only.
Extraction errors cascade
A misread document type or amount flows into every later stage.
One-way integration
Tickets are created but their outcomes never come back, so reviewers' decisions don't improve the checks.
Not builtPossible next steps
Regression tests from reviewer outcomesFrom the project README
Use overturned findings as a regression set, as the README's next steps propose.
More issue types and audit areasFrom the project README
Additional anomaly types and broader audit-domain coverage, also from the README.
Repeated-run measurementProposed here
Run each case several times on the current code and publish per-type agreement and variance, with the predictions kept.
Several transactions per uploadProposed here
Let Evidence return more than one transaction, so a mixed bundle is split before anomalies are checked.
Read ticket outcomes backProposed here
Bring the result of each Zoho Desk ticket back as a labelled example for evaluation.
08Technical summary
At a glance
- Project
- Team project with Abhijit Manna, built for the Syndicate by Maximor AO Hackathon
- Frontend
- Next.js, React, TypeScript, Vitest; pdfmake for reports
- Backend
- Python, FastAPI, Uvicorn
- Models
- Anthropic Claude through the Anthropic Python SDK, with JSON-schema outputs. Each stage's model is set by environment variable; the code defaults to Claude Sonnet 5, and Claude Opus 5 for Anomaly
- Integrations
- Zoho Desk REST API with OAuth refresh tokens; Google Drive and Google Picker in the browser
- Testing
- pytest, Vitest, and GitHub Actions CI; a manual browser test record for Drive saving
- Evaluation
- Fourteen synthetic cases with ground-truth files, scored by evaluate.py
- Hosting
- Vercel for the frontend; the README lists Render for the backend
Links
- Live appauditflow-kohl.vercel.app (opens in a new tab)
- Repositorygithub.com/
abhijitmanna912001/ auditflow (opens in a new tab)
Checked against commit 2c9abd4 (opens in a new tab) from , on . Links to source files point at that commit.