All case studies
Case study · Kuroji · Private Beta

Building Kuroji, the AI CFO agent.

"Stay in the black." Kuroji is an AI agent that plugs into a founder's bank, payment processors, and payroll, builds its own event-sourced, hash-chained ledger underneath, and provides what Jared from Silicon Valley provided Pied Piper — a devoted, always-watching financial second-in-command. Three rings of capability expand outward as trust is earned: read-only insight, ledger writes, then bounded external actions.

7
AI surfaces shipped
$39
Base price / month
3
Rings of capability
$0
Hallucinated math
Product
Kuroji (kuroji.ai)
Industry
FinTech · AI CFO
Services
Full-stack, AI integration, ledger architecture
Status
Private beta (Phase 0 shipped)
The challenge

Founders need to know one number above all others.

How long until we die. Pre-seed and seed-stage founders run $500K–$5M in the bank, 1–15 employees, no full-time CFO, and currently spend $3–8K per month on a fractional CFO or try to DIY it in spreadsheets. Existing tools all break at the same point: they require manual upkeep no founder actually does.

Pain points identified

What's broken

  • Pry, Finmark, Causal, Runway.com, Jirav all require manual upkeep no founder actually does
  • Bank-native dashboards (Brex IQ, Mercury IQ) only see their own accounts
  • Pry was the closest answer — Brex acquired it; Mercury / SVB / Chase / Ramp / RBFCU customers have no equivalent
  • Spreadsheets don't scenario; "what if we delay two hires 60 days" is a 20-minute exercise nobody does on time
  • AI bookkeeping (Puzzle, Digits) replaces the bookkeeper — nobody is replacing the CFO function for pre-seed startups
  • Hallucinated financial numbers from LLMs are a catastrophic trust failure

Goals defined

What we built

  • A character, not a dashboard: customers say "I have a Kuroji," not "I bought a forecasting tool"
  • Bank-agnostic by design — Plaid + every neobank, not locked to one stack
  • Build our own event-sourced ledger; do not depend on QuickBooks as source of truth
  • Deterministic math, AI commentary — LLMs never compute arithmetic, only narrate and propose
  • Three rings of capability that expand as trust is earned — never default to autonomous
  • Hash-chained audit chain inherited wholesale from Kodori — tamper-evident by construction
The three rings

Sees. Writes. Acts.

Kuroji's capability expands outward as the founder grants trust. Each ring is a separate permission boundary, with hard guardrails, full audit trail, and reversible-by-policy actions. Default is always narrow.

Ring 1

Sees and tells

Read-only · zero financial risk

Cash on hand, burn rate, runway, MRR/ARR, transaction categorization, anomaly detection ("AWS jumped 40% this week"), live 13-week forecast, conversational scenarios, daily/weekly digest, board-update drafts. The foundation of trust.

  • Live cash dashboard with sparklines + WoW burn delta
  • 13-week forecast with scenario toggles
  • Conversational queries via ⌘K chat
  • Anomaly detection with Kuroji-explained per-row commentary
  • Tonight's brief + Three Things agenda on dashboard mount
Ring 2

Writes to your books

Medium trust · reversible, audited

Posts journal entries, reconciles bank feed, categorizes new transactions per learned rules, drafts vendor payment batches, files standard recurring entries (depreciation, accruals, deferred revenue). Every action human-confirmable.

  • Categorization rules Kuroji learns and proposes
  • Auto-reconciliation of bank feed
  • Recurring entry automation (rent, payroll JEs, depreciation)
  • Vendor payment batching (draft → approve)
  • Correcting entries with full audit trail
Ring 3

Acts externally

High trust · narrow scope · WebAuthn step-up

Pays approved vendors on the optimal date within terms, sweeps excess cash to Treasury, files sales tax, sends scheduled investor updates, negotiates with vendors over email under defined limits. Hard guardrails, full audit trail, founder-approved policies.

  • Vendor payments (ACH, check, card) on optimal dates
  • Treasury sweeps (Mercury / Brex / direct broker)
  • Sales tax filing automation (Anrok-style)
  • Scheduled investor updates with auto-drafted content
  • R&D tax credit prep + 1099 generation
Our solution

Deterministic math, AI commentary.

Financial arithmetic is never computed by an LLM. The LLM categorizes, narrates, proposes, and explains. Every Kuroji number traces to source events via a SHA-256 hash chain — the Kodori audit pattern applied wholesale to the ledger.

01

Event-Sourced + Hash-Chained Ledger

Every external financial event (bank txn, Stripe charge, payroll run, vendor invoice) lands as one immutable row with prev_hash + event_hash (SHA-256 chain). Idempotent on (source, source_event_id). Tampering is detectable. Same chain backs investor diligence, CPA audit, and tax-time defensibility.

  • Append-only Postgres events table
  • SHA-256 prev_hash linkage (Kodori pattern)
  • Per-source adapters normalize to canonical event shape
  • Replay-safe materialized views over journal entries
02

Conversational Scenarios

"What's our runway?" "Why did opex spike?" "What if I hire 3 engineers next month and lose our top customer?" Kuroji answers from the live ledger — Claude Opus 4.7 reasons over snapshots that are deterministically computed first, then narrated. The scenario math is always real; only the prose is generated.

  • Page-context-aware chat panel (⌘K)
  • Claude Opus 4.7 for reasoning, Haiku 4.5 for classification
  • Persistent conversation history scoped per entity
  • Tools gate every action through explicit permission
03

Seven AI Surfaces Shipped (Phase 0)

Each AI surface follows the same pattern: server-side snapshot helper → streaming or generateObject endpoint → client component with KurojiThinking loading state. Every output passes a deterministic post-processing check before display.

  • Tonight's brief + Three Things agenda on /app dashboard
  • Transactions filter insight (only when filter active)
  • Per-anomaly explain (50-event historical context)
  • Investor-update studio drafting from P&L / BS / CF
  • Rule proposals per uncategorized merchant
04

Multi-Entity Foundation

An org owns multiple entities. KumoKodo itself is the canonical multi-entity ICP — 8+ products, multiple Stripe accounts, RBFCU as the bank. Consolidation is a view across entity_id, not a separate ledger. Active-entity selection lives in a cookie-driven switcher in the AppHeader.

  • cookie-based active entity via getActiveEntity() helper
  • 16 query sites migrated to entity-scoped reads
  • Entity switcher in AppHeader
  • Consolidation as a view, not a separate ledger
  • Holding companies, indie SaaS portfolios, multi-product operators
The defensible position

The only neobank-agnostic, action-taking AI CFO.

Pry was the closest answer in spirit — until Brex acquired it. Puzzle is the closest threat, but stops at bookkeeping. Mosaic and Cube serve Series A+ FP&A, not pre-seed. Kuroji sits in the gap and earns trust progressively.

DimensionKurojiPry (Brex)MosaicPuzzleCausal
CustomerPre-seed/seed founderBrex customers onlySeries A+ FP&ASaaS bookkeepingModelers / planners
LedgerOwn, event-sourcedNoneNoneOwn, double-entryNone
AuditHash-chainedStandardStandardStandardNone
Multi-entityNativeLimitedYes (expensive)Single-entityManual
Bank-agnosticYesBrex-onlyYesYesYes
Agent actionsRing 1–3NoneNoneBookkeeping onlyNone
ScenariosConversationalLimitedSpreadsheetNoneSpreadsheet
Setup time<10 min auto-ingestManualHeavyModerateHeavy
Technical deep dive

Architecture and infrastructure.

Frontend & application

Next.js 16 (App Router) on Vercel Fluid Compute with Node 24 LTS. React 19 + Tailwind CSS v4 + shadcn/ui. Server Components + Server Actions cover all mutations; native fetch + ReadableStream covers AI streaming endpoints.

  • TypeScript (strict) end-to-end
  • React Hook Form + Zod (Zod schemas double as runtime validation at API boundary)
  • Server Actions for mutations, native streaming for AI
  • vercel.ts typed config (replacing vercel.json)
  • Biome 2.x for lint + format (single tool, faster than ESLint+Prettier)

AI layer

All AI traffic routes through the Vercel AI Gateway with the Vercel AI SDK v7. Provider-agnostic model strings, observability, fallbacks, zero data retention configurable.

  • Reasoning: Claude Opus 4.7 (scenarios, narrative, board updates)
  • Classification: Claude Haiku 4.5 (high-volume transaction categorization, anomaly classification)
  • Structured output: generateObject with Zod schemas — every proposal is a typed object
  • Tool use: AI SDK tools → server actions with explicit permission gates
  • Anthropic prompt caching for system prompts + ledger context blocks
  • Deterministic post-processing on every AI output — numbers cross-referenced against event log

Data layer

Neon Postgres (Vercel Marketplace) with pgvector. Drizzle ORM with linear migrations checked into git. The right backbone for event sourcing + materialized views + financial reporting.

  • Append-only events table with prev_hash chain
  • Journal entries + journal_lines (double-entry, balanced by construction)
  • Materialized views: trial balance, P&L, balance sheet, cash flow
  • pgvector for semantic transaction search + vendor matching
  • Upstash Redis for rate-limiting + categorization-rule cache
  • Neon point-in-time recovery + periodic export to R2

Workflows & durability

Vercel Workflow (WDK) preferred for portfolio consistency. Vercel Crons declared in vercel.ts for daily Plaid + Stripe polls, weekly anomaly digests, scheduled report runs.

  • Month-end close, daily reconciliation, recurring entry generation
  • Scheduled investor updates, vendor payment runs
  • Inngest as fallback if WDK constraints bite
  • Crash-safe, retryable jobs with full observability
  • Vercel Queues (beta) on standby for fan-out at scale

Integrations

Per-source adapters normalize external payloads into canonical event shape and write to the event log. No vendor in the stack locks Kuroji to one neobank.

  • Plaid: bank ingestion (sandbox live; production pending Plaid approval)
  • Stripe API: multi-account revenue ingest with guided /app/connect/stripe flow + daily cron sweep
  • Gusto (Phase 1): payroll ingestion; Rippling deferred to Phase 4+
  • QuickBooks Online (Phase 1, export only): one-way CSV / IIF / QBO for CPA hand-off
  • Anrok (Phase 3): sales-tax filing automation
  • Mercury / Brex / Ramp (Phase 3): treasury sweeps, vendor payments
  • Resend: transactional + digest email; Slack API (Phase 1): optional digest delivery

Billing (Kuroji's own)

Kuroji bills its own customers via Stripe Checkout + Customer Portal + Billing Meters + webhook. One transparent plan: $39 base + metered overage. No tier upsell theatre. The base + overage combo is shown live in /app/billing so there are never surprise invoices.

  • Stripe Billing Meters API for $0.10/chat-message + $2/investor-update overage
  • 21-day free trial with hard quota caps (TRIAL_INCLUDED)
  • TRIAL_SIGNUPS_PAUSED env-var kill switch (existing customers unaffected)
  • canUseFeature() blocks past-trial usage with HTTP 402
  • <ChatUsageChip /> in chat panel + <TrialChip /> in AppHeader
  • /app/admin/trials live trial-cost monitor + kill-switch status
  • Single applySubscription() webhook handler writes through to subscriptions table

Security & secrets

Bank credentials never touch us — Plaid handles OAuth. Plaid access tokens + Stripe restricted keys are encrypted at rest via AES-256-GCM; key derived from AUTH_SECRET via scrypt with versioned salt.

  • AES-256-GCM secrets at rest via src/lib/crypto/secrets.ts
  • pnpm encrypt:secrets migrates plaintext rows
  • pnpm decrypt:check verifies deployed key matches stored ciphertext
  • TLS 1.3 only, HSTS + secure headers via vercel.ts
  • WebAuthn step-up required for Ring 3 money-movement actions
  • Auth.js v5 with database sessions on Neon (auditable, revocable)

Compliance roadmap

Hash-chained ledger is the audit log. Tamper-evident by construction, queryable by date, CPA-presentable on day one. SOC 2 prep starts at Phase 4.

  • SOC 2 Type 1 prep at Phase 4 (Drata or Vanta)
  • Type 2 within 12 months of first paying customer
  • CPA-friendly exports: CSV, QBO-compatible IIF, PDF reports
  • GDPR-ready data export + deletion subject to retention class
  • Reproduces Kodori's defensibility story for financial data
Key features

What's shipped today.

Phase 0 surface is largely complete. Live in single-user dogfood on the KumoKodo portfolio (8+ products, multiple Stripe accounts, RBFCU bank) — the canonical multi-entity ICP. Plaid production is the last blocker before external pilots.

Live Cash Dashboard

Runway, burn, MRR, anomalies, sparklines, WoW burn delta, "Kuroji on watch" since-stamp, per-source health dots.

13-Week Forecast

Visualized, scenario-toggleable. Built from materialized P&L / balance sheet / cash flow views over journal entries.

Page-Context-Aware Chat

Slide-in chat panel (⌘K) injected with buildPageContextPrompt(). Conversation history persisted, scoped per entity.

Tonight's Brief + Three Things

streamText brief and generateObject agenda mount on the dashboard. Zero items returned rather than manufactured work.

Anomaly Explain

Per-anomaly toggle generates Kuroji-explained commentary against a 50-event historical context, with persisted ack flow.

Investor Update Studio

Primary CTA on /app/reports. streamText draft over computed income statement, balance sheet, and cash flow.

Categorization Rules

Deterministic rule replay + AI propose-accept loop on /app/rules. Kuroji learns; humans approve; audit credits the human.

Secrets at Rest

AES-256-GCM for Plaid access tokens + Stripe restricted keys. Migration + key-rotation tooling included.

Multi-Entity Switcher

Cookie-based active entity via getActiveEntity(). 16 query sites migrated. Consolidation as a view, not a separate ledger.

Event Log + Hash Chain

Every external event hash-chained. SHA-256 prev-hash linkage, idempotent on (source, source_event_id), tamper-evident.

First-Run Onboarding

Guided 3-step flow at /app/onboarding. Connect Stripe → Plaid → first scenario in under 10 minutes.

/app/admin/trials

Admin-only cost monitor: live trial count, estimated burn, worst-case ceiling, kill-switch status.

Plans & pricing

One plan. Transparent overage.

Cost-modeled against live Anthropic Opus 4.7 ($5/$25/M tokens), Sonnet 4.6 ($3/$15), and Plaid Transactions pricing (~$0.40/Item/mo). One transparent metered plan beats three-tier upsell theatre — the metered model aligns price to value at every level, never goes underwater, and is shown live in /app/billing so there are never surprise invoices.

Kuroji Base

$39/mo

Per entity · 21-day free trial

  • 75 chat messages / month
  • 2 investor update drafts / month
  • 5 connected sources
  • All dashboard + page AI surfaces
  • Daily brief + weekly digest
  • Audit chain + learned rules
  • Trial capped at 20 msgs / 1 update

Overage

Metered

Past included quotas

  • $0.10 / chat message past 75
  • $2.00 / investor-update draft past 2
  • $1.00 / month / extra source past 5
  • $29 / month / additional entity
  • Live running total in chat panel
  • /app/billing shows projected total

Enterprise

Custom

Required for Ring 3 + SOC 2

  • Usage-based at cost + 30% margin
  • Money movement (Ring 3 actions)
  • SOC 2 + dedicated DPA
  • BYO Plaid / SSO via WorkOS
  • Custom retention + audit export
  • Named CSM + migration assistance

Margin sanity check (post-cache) · Typical user (80 msgs, 1 update, 3 banks): $39 charged / ~$8 cost → 80% gross margin · Power user (400 msgs, 5 updates, 5 banks): $80 charged / ~$33 cost → 59% margin · Extreme user (900 msgs, 20 updates, 5 banks): $157 charged / ~$72 cost → 54% margin.

Built with

Technology stack.

Next.js 16React 19TypeScript (strict)Tailwind 4shadcn/uiVercel Fluid ComputeNode 24 LTSvercel.tsDrizzle ORMNeon PostgrespgvectorUpstash RedisVercel AI SDK v7Vercel AI GatewayClaude Opus 4.7Claude Haiku 4.5Anthropic prompt cachingVercel WorkflowInngest (fallback)Vercel CronsPlaidStripeStripe Billing MetersGustoResendAuth.js v5WebAuthn (Ring 3)AES-256-GCM secrets at restVercel BlobBiome 2.xVitestPlaywrightfast-check
Private beta

Want early access?

Kuroji is in private beta — currently dogfooding on the KumoKodo portfolio while we wait on Plaid production approval. First external design partners go live shortly after. Request access to evaluate, or contact us if you'd like a similar AI-agent product built for your domain.

Build with us

Want a project like this?

We build production-ready AI applications and SaaS platforms. Let's discuss your next project.