How we built it
Closing the books every month is slow, manual, and error-prone. Finance teams export bank statements and ledgers as messy CSVs, then spend hours matching transactions line by line, chasing exceptions, and re-categorizing the same merchants over and over. Most "AI accounting" tools try to fix this by letting a model decide the numbers — which no finance team can trust or audit.
I wanted the opposite: let deterministic rules own the math, and let AI assist where judgment helps — with a human in control and an audit trail behind every decision. That's ClosePilot, my submission for the Autonomous Office of the CFO track.
What it does
ClosePilot is an AI-assisted accounting workspace that turns raw financial evidence into a review-ready close.
- Company workspaces — sign up, pick a business type, and get accounting categories and report mappings scoped to your company.
- Deterministic reconciliation — matches bank and ledger rows on amount, reference, date and merchant, and detects duplicates and one-to-many (split) matches. Every result has a confidence score and a plain-language explanation.
- Human-in-the-loop review — suggested and ambiguous matches go to a review queue. Approve or reject; rejects move to Exceptions.
- Learning memory — approve a merchant correction (e.g.
AWS India→Amazon Web Services India) and ClosePilot remembers it for that company. Rules stay visible and revocable. - Smart categorization — a cascade of human override → learned rule → deterministic keyword → AI fallback → uncategorized.
- Accounting reports — categories roll up into P&L, Cash Flow and Balance Sheet using deterministic accounting logic. No number is ever produced by the model.
- Ask CFO — an AI copilot that summarizes the close, explains exceptions, flags open risks, and answers questions grounded only in the actual financial evidence (it cites the records it used).
- Audit trail — every automated decision and human action is recorded.
How we built it
- Frontend & app: Next.js 16 (App Router) + React 19.
- Auth: NextAuth (credentials) with per-company membership.
- Database: PostgreSQL on Neon via Prisma 7. Reconciliation results, learning
memory, categories and review actions all persist, scoped by
companyId. - AI: OpenAI Responses API (
gpt-5-nano) behind isolated API routes, using strict JSON-schema outputs so the model can only ever return suggestions — never post or change a match. - Engine: a plain-JS deterministic matching and accounting layer, so the same inputs always produce the same numbers.
- Orchestration (AO): I built the app itself with multiple orchestrated agent sessions — GLM (via TensorMux) for planning, Grok Build for implementation, and Codex for review — with a separate session per task.
Challenges we ran into
- Keeping AI honest. The hardest design call was making AI genuinely optional and non-authoritative. Matching and reporting are deterministic; AI is boxed behind schema-constrained endpoints and a human approval step.
- Real persistence, not localStorage. The prototype kept everything in the browser, which leaked across accounts and never hit the database. I moved reconciliation, learning memory, categories and review decisions into Postgres, each scoped per company, so nothing bleeds between workspaces.
- Schema vs. reality. Several API routes were written against an imagined schema (wrong field names, missing required columns), so writes silently failed. Aligning every route to the real Prisma models — and extending enums for report mappings — was fiddly but essential.
- Graceful AI fallback. When the AI endpoint is unavailable, the CFO copilot and categorization fall back to local deterministic evidence instead of breaking.
Accomplishments that we're proud of
- A close that is deterministic where it must be, AI where it helps, and auditable end to end.
- Learning memory that visibly improves automation per company while staying fully revocable.
- Reports generated by real accounting logic — trustworthy numbers, not guesses.
What we learned
- Finance software lives or dies on trust and auditability — the AI's job is to assist judgment, not replace the ledger.
- Persisting per-tenant state correctly (and never in the browser) matters more than any single feature.
- Multi-agent orchestration (plan → build → review) is a genuinely effective way to ship a non-trivial app.
What's next for ClosePilot
- Live data connectors (Setu bank feed, Gmail receipt inbox, Dodo Payments settlements) to replace CSV uploads.
- OCR-based receipt extraction and evidence matching.
- Multi-currency and multi-entity consolidation.
- Exportable, audit-ready close packages.
Built With
- nextjs
- openai
- postgresql
- prisma
Log in or sign up for Devpost to join the conversation.