Eric Nguyen

Cal Hacks Winner: Luyten – Autonomous FinanceOct 2026

AI agents close a startup's books each month, and only the CFO says OK

Cal Hacks Winner: Luyten – Autonomous Finance

AI agents close a startup's books each month, and only the CFO says OK

#AI agents#Fintech#Full stack#Hackathon

Type
Hackathon winnerCal Hacks, SpacetimeDB track
Team
Me@bananatruck@lucamanh
Duration
36 hoursOct 2026
Frontend
SvelteKit, ViteTypeScriptTailwind
DB & ledger
SpacetimeDB
Backend
Node.js, PythonClaude Agent SDKVercel AI SDKOpenAI, Grok, GeminiFetch.ai, CRSBright Data, MossApify, Capital One Nessie
Link
Live site↗

Ask a CFO whether an AI can post straight to the general ledger and the answer is no. So in Luyten it can't. It can only ask.

Overview

Luyten closes a startup's books every month with AI agents. The agents do the work a finance team spends about ten days on: matching bank lines to invoices, accruing late bills, rebuilding revenue schedules, revaluing foreign-currency balances. But none of them can touch the ledger. They file Proposals, another model attacks each one, an Advisor agent rules on it, and anything material waits for the CFO.

The CFO's Needs your OK queue: a $245,461.64 intercompany elimination with the Advisor's ruling
The CFO's Needs your OK queue: a $245,461.64 intercompany elimination with the Advisor's ruling

Context

Two weeks before Cal Hacks, the trend was reverse engineering everything. At Cal Hacks, most of the sponsors asked for the same thing: in 36 hours, pick a finance role, build the harness for agents to do it on their own, and get it to 95% accuracy.

Cal Hacks was held at the Palace of Fine Arts in San Francisco, and about 2,000 people reportedly showed up.

Walking into the Palace of Fine Arts
The hacking floor at Cal Hacks
The hacking floor at Cal Hacks

We picked the month-end close. Every month a finance team has to close its books, and at a growing startup that still takes days. Each of those days is time not spent fundraising or networking. The tools don't grow with the company either: moving from one ERP to the next between seed, Series A and Series B is painful. Luyten is built for a startup going through that growth.

Propose, critique, rule, confirm

The landing page draws the whole flow as one graph. Each chip is a piece of work moving along a wire. Bank lines, invoices, credit facts and group balances come in on the left. Each worker turns its input into a proposal, and every proposal goes to the Red Team. The critique goes to the Advisor, and its ruling either posts straight to the ledger, when it's under $10,000, or waits for the CFO to confirm.

The agent workflow from Luyten's landing page: data in, proposals, critiques, rulings, and the CFO's confirm
The agent workflow from Luyten's landing page: data in, proposals, critiques, rulings, and the CFO's confirm
  • Worker agents propose. A Bookkeeper, Revenue, Credit & Risk and Consolidation agent each file Proposals. A Proposal never moves a balance.
  • A Red Team on other vendors critiques. Grok attacks each Proposal first, then Gemini reads Grok's critique and adds only what it missed. Different models, different blind spots.
  • The Advisor rules. It approves, rejects or amends every Proposal and always writes down why. It never proposes, so it never grades its own work.
  • The CFO confirms anything material: $10,000 or more, or any amendment. Only the CFO locks the month.
A debate: Credit & Risk wants to block a vendor, the Red Team pushes back, the Advisor rules on a narrower block
A debate: Credit & Risk wants to block a vendor, the Red Team pushes back, the Advisor rules on a narrower block

The database is the gate

A prompt that says "be careful" isn't a control. The ledger is a SpacetimeDB module, and every write checks who is calling. Each agent connects with its own identity, so a worker that ignores its instructions, or gets jailbroken, gets a refusal from the database. Money is stored as whole cents in 64-bit integers, and every conversion rounds the same way in the database and the accounting engine.

SpacetimeDB picked Luyten as one of its Cal Hacks track winners. The ledger and all of its rules live in one module that runs inside the database, so there was no separate backend to build or deploy, and the agents all work against the same live tables.

Our team with the SpacetimeDB folks at Cal Hacks
Our team with the SpacetimeDB folks at Cal Hacks

What one close does

The demo company has a US parent and a UK subsidiary, with problems planted in its books. Closing September produces about 50 Proposals:

  • 9 vendor payments matched to their bills; weak customer matches left for a person
  • A duplicate vendor payment caught and booked as money due back
  • A missing 12-month revenue schedule rebuilt for a $26,400 contract
  • Credit checks on every guarantor behind an open invoice; $48,000 fully reserved for one in bankruptcy
  • Two vendors blocked before their first payment: one owner is a synthetic identity, the other is deceased
  • A UK loan revalued at the closing rate, and about $245,000 of intercompany balances eliminated
Unmatched bank lines stay visible until the CFO accepts them with a reason
Unmatched bank lines stay visible until the CFO accepts them with a reason
The consolidated Board Pack; every number drills down to its journal lines
The consolidated Board Pack; every number drills down to its journal lines

How it's built

  • Frontend: a SvelteKit app for the CFO, with Svelte 5 and Tailwind, built on Vite. Every screen reads and acts through one data interface with two implementations: an in-browser stand-in for the demo, and a live SpacetimeDB connection. Every number drills down to its journal lines, then the Proposal, then the debate behind it.
  • Agents: five agents run on the Claude Agent SDK, each with a plain-English charter whose checkable lines map to eval scenarios. The Advisor runs on a larger model than the workers, and a bridge lets the same agents run on OpenAI. The Red Team calls Grok, then Gemini, through the Vercel AI SDK. Fetch.ai uAgents let anyone ask the Advisor questions from ASI:One.
  • Backend: the ledger is a SpacetimeDB module, with tables for the books, Proposals, approvals, agent messages and the audit trail, and the reducers that enforce the gate. The accounting itself is a separate double-entry engine with no I/O: matching, revenue schedules, accruals, FX, eliminations and consolidation, covered by 156 unit tests. A Node gateway runs the agents and starts each close.
  • Querying the data: the app subscribes to every table, so a new Proposal or ruling appears on screen the moment an agent writes it, with no polling. The agents query through tools instead: list_proposals pages through a month's Proposals ten at a time, search_policies searches the house accounting policies through Moss, and the credit tools pull bureau and identity data from CRS. The Advisor chat answers questions straight from the live books.

Testing it

1,085 tests pass across the project, including 156 for the double-entry ledger engine, and CI runs every database gate against a real SpacetimeDB. The whole app also runs in the browser with no API keys, which is what the live demo is. A full live close on real models cost $4.92.

Lessons

Agents can be dumb. Really dumb. Most of what we learned came from catching them at it.

  • A demo that works and an agent that did the work are two different things. Our first live close looked fine until we read the logs. The Advisor asked for the month's Proposals in one call, the answer was too big for the tool, and it ruled on none of them; a fallback quietly applied standard rulings instead. Paging the list ten at a time fixed it, and the next run left no Proposal unruled.
  • Put the rules where the model can't skip them. A prompt can be ignored or jailbroken, so the approval gate lives in the database: a worker that tries to post gets refused, whatever its instructions say.
  • Give tool-using models time to think. Grok answered only 13 of 48 critiques in the live run, because each one could take up to six tool steps against a 30-second deadline. The rest fell back to scripted critiques, labelled as scripted, and the deadline is now 90 seconds.
What we brought home from Cal Hacks
What we brought home from Cal Hacks