Inspiration

At Cal Hacks, we kept returning to a question that felt more human than technical: what happens when a small nonprofit has already paid to run a program, but reimbursement is held up because one line in its ledger has no context?

Our project began with one such ordinary-looking line:

North Bay Catering — $860.

Was it lunch for participants in a workforce program, or a staff celebration? The vendor and amount could not answer that question. Yet the answer could determine whether a nonprofit's reimbursement claim moved forward or came back for another round of review.

Before this hackathon, I had worked on settlement automation and financial-education software. Those experiences taught me that the hardest finance problems rarely arrive as dramatic failures. They arrive as one ambiguous transaction, one missing document, or one decision that nobody can reconstruct a month later. Behind every such line is a real person who must choose, defend the choice, and live with its consequences.

Our four-person team kept returning to that person. In our demo, Priya is a representative finance manager reviewing a workforce-development grant claim—not a claimed customer. If she includes an ineligible cost, the organization risks delay and rework. If she excludes a legitimate program expense, a mission-driven organization may leave scarce reimbursement dollars unclaimed. A confident AI answer is not enough. Priya needs the governing source, the available evidence, one clear question, and control over the final decision.

That became our central belief: the best finance agent is not the one that always has an answer. It is the one that knows when to stop and ask.

We built SwarmCFO Claims to make uncertainty collaborative instead of hiding it behind automation. It does not replace the ledger, change accounting records, move money, or submit anything to a funder. It sits in the difficult space between raw financial activity and an authorized human decision—the system of work where evidence is assembled, ambiguity is resolved, and every consequential action can be explained later.

What it does

SwarmCFO Claims is a governed reimbursement-review workspace for nonprofit bookkeepers and finance managers.

In our nine-line sample claim, Jordan, the AI Claims Agent, begins with a $36,295 September ledger. The system catches a possible $5,200 duplicate, $2,100 of October wages outside September's reporting month, a receipt-reference issue, and the ambiguous $860 catering expense.

For the question that code alone cannot answer, SwarmCFO does not guess:

  1. Our custom Apify Grant Rule Watcher retrieves the official text of 2 CFR § 200.438 from GovInfo. It stores the source URL, retrieval time, SHA-256 content hash, change state, and real Actor/run/dataset receipts.
  2. Claude Sonnet 4.6 receives that retrieved text and returns a strict structured interpretation: the relevant rule, an exact quotation, confidence, whether human context is required, and the precise question to ask.
  3. Our backend verifies that the URL is unchanged and that Claude's quotation appears character-for-character in the retrieved source. Invalid output or provider failure stops the workflow for review rather than silently authorizing a cost.
  4. Priya sees the rule beside the ledger line and confirms that the catering was a staff celebration. She excludes it and records why.

Her “No” is not a disposable chat message. SwarmCFO revises the claim, saves the decision as precedent, and proposes a narrowly scoped future policy. Priya must review and approve that policy in a separate action. When we submit an independent October claim containing a similar celebration expense, the approved policy holds it before it enters the package.

The AI still does not become the approver. Jordan attempts to approve the corrected September package, and the backend denies the action. Only Priya can approve it. The audit records the source, interpretation, question, answer, revision, policy proposal, policy approval, future hold, denied AI action, and final human approval.

The final sample reconciles exactly:

$36,295 original ledger = $28,135 retained + $8,160 excluded, with a $0 gap.

The $8,160 consists of the $5,200 duplicate, $2,100 of out-of-month wages, and the $860 celebration. These are transparent sample-case amounts—not claimed customer savings or funder-approved payments.

How we built it

We designed the architecture around a simple rule: give every kind of intelligence the responsibility it can actually earn.

  • Apify retrieves and versions the live official source. Our custom Node.js Actor uses Cheerio to isolate § 200.438 from an allowlisted GovInfo publication, normalize the text, compute its SHA-256 hash, compare it with the prior version, and write a structured dataset item.
  • Claude interprets language and recognizes ambiguity. It must return a strict schema with an exact quote, source URL, confidence, human-review flag, and suggested question. The backend rejects malformed output, source changes, and invented quotations.
  • Deterministic Python owns the money. FastAPI, Pydantic, and the Claims engine perform duplicate detection, period checks, evidence checks, reconciliation, state transitions, and role enforcement. An LLM never calculates the final claim or grants approval.
  • The human owns policy and approval. Manager decisions, policy activation, and claim approval are explicit, separate actions—not steps hidden inside one “run agent” button.

The interface is built with Next.js 15, React 19, and TypeScript. We made it exception-first: the selected expense, exact rule, evidence, missing context, and required human decision occupy the center of the page. Provider details and persisted audit receipts remain available in a technical drawer without overwhelming the bookkeeper's task.

Guided work items, precedents, policies, and audit associations persist in SQLite, while claim packages persist as JSON. We verified the real HTTP workflow across two Uvicorn process restarts so the approved policy, independent future hold, final approval, and audit history do not disappear with a process or browser refresh.

Challenges we ran into

The hardest challenge was resisting the temptation to make the AI look magical. One large prompt could have produced a faster demo, but it would have mixed rule interpretation, financial calculation, policy creation, and approval into an answer nobody could safely trust. We spent much of the hackathon separating those responsibilities and making the boundaries visible in the product.

Live external data created another hard problem. A page can change, an Actor run can fail, and a model can cite words that were never in the source. We therefore hash and version the retrieved text, preserve provider receipts, validate the literal quotation, and fail closed. When the system cannot prove its source, the human sees a hold—not a fabricated green checkmark.

Durable learning was equally difficult. We did not want “memory” to mean a chat transcript or a hard-coded sentence claiming the next month would be safer. We persisted the manager's answer, proposed a policy, required separate approval, submitted a genuinely different October claim, and demonstrated the resulting hold after real backend restarts.

Finally, finance software loses trust the moment its numbers disagree. We aligned the revision, work item, schedules, risk inputs, approval target, and KPI cards around one reconciliation equation and tested that the arithmetic remained consistent throughout the workflow.

Accomplishments that we're proud of

The moment we are proudest of is not when the AI does something. It is when the AI is told No, changes course correctly, and still does not take authority away from the human.

We completed and verified:

  • A real Apify-to-Claude path from an official public source to a cited human-review question in the product.
  • Literal citation validation, source provenance, and fail-closed behavior for provider failures.
  • A human correction that becomes a precedent, then a separately approved policy, then a guardrail on an independent next-month claim.
  • A code-enforced denial when the Claims Agent tries to approve its own work.
  • A fully reconciled sample package: $36,295 original, $28,135 retained, $8,160 excluded, and $0 gap.
  • 44 passing backend tests, a successful production build across 16 routes, and a restart verification preserving 24 audit events across two actual backend process restarts.

What we learned

I entered the hackathon thinking autonomy meant an agent doing more. I am leaving convinced that mature autonomy means understanding exactly what the system may do, what it must remember, and when it must return control to a person.

We learned that explainability is not a paragraph generated after a decision. It is an exact source, evidence beside the affected transaction, a named decision-maker, a reason, a before-and-after state, and a record that survives long enough to be useful.

We also learned that “learning” inside a business process should not mean silently retraining a model. In SwarmCFO, learning is explicit and governable: a manager's answer becomes a recorded precedent, a proposed policy, a separate approval, a versioned rule, and visible proof that the next case was evaluated against it.

Most importantly, we learned that keeping a human in the loop should not mean using a person as a rubber stamp. Priya is involved at the exact moment her context matters, and the system respects both her “No” and the limits of its own role.

What's next for SwarmCFO Claims

Next, we would replace sample receipt references with actual uploaded-document verification and connect accounting and payment evidence directly to every ledger line. We would add production identity, tenant isolation, stronger authorization, observability, and policy migration reviews when an official rule changes.

We would then pilot the workflow with nonprofit bookkeepers and finance managers and measure what matters: preparation time, missed exceptions, false holds, reviewer effort, and the time required to explain a past decision. We do not want to claim impact before earning that evidence.

We also plan to publish the Grant Rule Watcher Actor for reuse and expand it carefully to additional official grant sources.

SwarmCFO is built around one belief: when public-purpose money is involved, every dollar deserves evidence, every exception deserves an owner, and every AI action deserves a boundary.

The future of finance is not AI replacing Priya. It is giving Priya a teammate that completes the repetitive work, asks when it does not know, remembers what she decides, and never takes her authority away.

Built With

+ 20 more
Share this project:

Updates

Submission history