Inspiration

At a growing startup, the month-end close still takes the finance team about ten days. Most of that time goes to matching deposits to invoices, chasing receipts and rebuilding revenue schedules in spreadsheets. Agents could already do most of this work. But ask a CFO whether they'd let a model post straight to the general ledger and the answer is no, because nobody can see what the agent did or stop it before it lands. We wanted agents that do the work and still can't change the books on their own.

What it does

Luyten is automated finance for 10x growth startups, built first for SaaS companies. Agents run the month-end close for a group of companies in two currencies, and every change passes through a gate:

  1. Worker agents propose. Bookkeeper, Revenue, Credit & Risk and Consolidation create Proposals. None of them can post.
  2. The Red Team critiques. It runs on models the workers don't use: Grok goes first, then Gemini adds what Grok missed.
  3. The Advisor rules. It approves, amends or rejects each Proposal and writes down why.
  4. The CFO confirms anything material. Anything at or above the $10,000 Materiality threshold, and every amendment, waits in the Needs your OK queue until the CFO confirms it with one click or sends it back.

Before money moves, Credit & Risk checks the people behind each customer and vendor. It runs identity, fraud, all three credit bureaus and public records through the CRS Credit API, and Bright Data collects their public footprint. The database derives the Risk Tier from those facts, and the tier sets payment terms. Each agent follows a plain-English Charter, which the finance team can tighten but never loosen. Every number in the Board Pack drills down to its journal lines, then to the Proposal, then to the agent debate behind it. Luyten also runs as an agent on Fetch.ai's Agentverse, so you can ask the Advisor how the business is doing from ASI:One.

How we built it

SpacetimeDB is the whole backend: the ledger, the approval queue, the audit trail and the message bus between agents. The SvelteKit app subscribes to it and updates as rows change. Each agent role connects with its own identity, and every reducer checks who is calling, so the approval gate lives in the database and not in a prompt. The CFO seat is claimed once with a one-time secret. The bank feed has its own identity, and all it can do is add raw bank lines and invoices.

The accounting runs in a pure double-entry engine that stores money as 64-bit integer minor units. The database recomputes what matters before anything posts: consolidation entries are rebuilt from the books, and credit tiers come from the recorded facts, never from the agent. The workers and the Advisor run on the Claude Agent SDK, and a local bridge can send the same calls to OpenAI. The Red Team runs on Grok and Gemini through the Vercel AI SDK, and Credit & Risk runs its cascade against the CRS sandbox over MCP. Every external provider has a recorded stand-in. The full demo runs with no API keys, through the same identities and reducers as a live run.

Challenges we ran into

The hardest product question was what a startup CFO would open this app for between closes. An automated close is useful once a month, but a CFO also watches runway, burn, margin and the next raise, so we had to decide which features earned a place beyond the close. We chose a dashboard for cash, burn, runway, ARR and churn, a cost-of-service view for gross margin, and views for financing and payroll.

Agent communication was the other hard part. Getting six agents on three model vendors to propose, critique, rule and escalate in order meant defining one Proposal format that every agent reads and writes, and sending every message through the database.

Accomplishments that we're proud of

  • A rogue agent can't write to the books, and our tests prove it. On every pull request, CI runs the module smoke test, which tries every gate and refusal against a real SpacetimeDB.
  • 156 ledger engine unit tests (1,085 across the workspace), and the CRS cascade reproduces all 20 decisions in the sandbox dataset.
  • One click starts the close for a two-company group. That close produces 52 Proposals, catches a duplicate payment, and blocks two vendors before their first payment: one owner is a synthetic identity and the other is deceased.
  • Real financial analysis beyond the close. The consolidated Board Pack has the P&L, balance sheet, ARR waterfall and NRR. The dashboard tracks cash, burn, runway, DSO, churn and gross margin by cost of service, and every figure drills down to its journal lines.
  • An interface for two kinds of reader: a founder who wants the one-sentence summary on each Proposal, and a controller who wants the journal lines underneath.

What we learned

SpacetimeDB turned out to be far more than a database. Its reducers became our permission layer and its identities became our agent roles. Its subscriptions gave us a live UI and an audit trail without writing a separate backend.

We also learned that agents work better when they communicate in structure. Agents that hand each other typed Proposals and written rationales are easier to debug, test and trust than agents chatting freely. And putting a second model vendor in the critic's seat caught mistakes the first model had agreed with.

What's next for Luyten

First comes an Intake agent that reads the payables inbox, Stripe and bank accounts through read-only connectors. It writes through the same ingest-only role as today's feed. A hijacked Intake agent could add evidence but couldn't propose, rule or post. After that come per-company locks and hosted instances for a handful of SaaS design partners, and we'll widen the rollout as the Charter evals show each agent is reliable.

For customers, the payoff is a close that takes days instead of weeks, a smaller finance team, fraud and credit risk caught earlier, and books that are ready for audit at any point. Longer term, those audited books become leverage: Luyten will use them to negotiate working-capital terms for its customers, with the CFO confirming every offer through the same gate.

Built With

  • anthropic
  • apify
  • bright-data
  • claude-agent-sdk
  • crs-credit-api
  • fetch.ai
  • gemini
  • grok
  • mcp
  • moss
  • node.js
  • open-webui
  • openai
  • spacetimedb
  • sveltekit
  • typescript
  • vercel-ai-sdk
  • vite
Share this project:

Updates

Submission history