← Back to all work
CASE STUDY · APPLIED AI · CONCEPT
CASE 008 · AI FINANCE

FinSight.

An AI system that turns a raw P&L into executive-ready financial analysis in 90 seconds. Deterministic cleaning and KPI math; LLM-driven narrative and Q&A. Architecture designed end-to-end, demo built on real sample data.

RoleBuilder · Sole architect
Duration1 week design
Year2026
StatusConcept · Architected

The problem.

The first three hours of every FP&A cycle are the same: pull the export, fix the column headers, normalize the date columns, recompute the variance columns the export software didn't get right, build the chart deck, write the executive narrative. None of this is the analyst's actual job. The actual job is the interpretation that comes after.

FinSight is an attempt to compress the first three hours into ninety seconds, freeing the analyst to spend their time on the part that requires real judgment. Cleaning and KPI computation are coded, deterministic, and provably correct. The LLM only does what it is good at: writing the narrative, hypothesizing variance drivers, and answering ad-hoc questions about the data.

The architecture is fully designed. The demo below is interactive and built on real sample data so it can be evaluated end-to-end without burning live API budget. Live deployment with rate limiting and per-user cost controls is the next phase.

The architecture.

Six stages, with a hard line between deterministic work (cleaning, parsing, KPI math) and AI work (narrative, hypotheses, Q&A). The split matters: a finance demo where the LLM hallucinates a number is dead on arrival.

01
Upload
CSV / Excel parser
Accepts P&L, balance sheet, and trial balance exports. Auto-detects column structure and source system (NetSuite, QuickBooks, Sage, etc.).
02
Parse
Schema inference · Deterministic
Maps detected columns to a standard internal schema. Normalizes date columns, account classifications, and currency. Flags ambiguous mappings for review rather than guessing.
03
Clean
Rule-based · Deterministic
Drops duplicates, fills internally-consistent missing values, validates row totals against subtotals, surfaces remaining anomalies. No LLM in this step. Numbers must be auditable.
04
Compute KPIs
Formula library · Deterministic
Runs standard FP&A KPI formulas: gross margin, operating margin, variance vs prior period, vs budget if provided. Top-five YoY swings auto-identified.
05
Narrate
LLM · Claude Sonnet
Receives cleaned numbers and computed KPIs as structured input. Generates a three-paragraph executive summary in the voice of a senior FP&A analyst, plus one-sentence variance hypotheses for the top swings. Hypotheses are explicitly framed as suggestions for verification.
06
Ask
LLM · Q&A endpoint
Free-text question box with three pre-baked example questions. The LLM answers based on the cleaned data only, refuses to invent numbers it doesn't have, and notes when a question requires data the upload doesn't include.

The demo.

Two real sample P&Ls, the full pipeline running in your browser. Pick a company, click run, and the system processes the upload, computes KPIs, and renders the analyst report.

SAMPLE COMPANY
Lumen Analytics Inc._PnL.xlsx
SaaS Startup · Q1 2026 · 142 rows · 8 columns
Click Run pipeline to process the sample upload

What's hard.

01

The deterministic / AI line

The single most important architectural decision is what the LLM does and what it does not. If the LLM computes the gross margin and gets it wrong by 0.3 percentage points, the demo is over and the trust is gone. KPIs and variance math are coded; the LLM only narrates and hypothesizes. This split is enforced by the API contract between layers, not a guideline.

02

Variance hypothesis honesty

An LLM will happily invent a confident reason for any variance you put in front of it. The fix is a system prompt that constrains hypotheses to data-supported claims and explicitly frames them as suggestions to verify. The variance section is also visually marked as "AI HYPOTHESES" in the report, distinct from the deterministic sections.

03

Schema variance across exports

NetSuite, QuickBooks, Sage, and Excel-built P&Ls all use different account hierarchies and column conventions. The parser cannot LLM its way out of this, it has to be a real classifier, with a fallback to ask the user when it cannot map a column with high confidence. For the demo, parsing is shortcut to two known schemas.

04

Cost control if deployed live

An open Q&A endpoint with no rate limiting is a credit-card fire. The deployed version needs per-IP rate limits, per-question token caps, and an API budget alert. For the demo, hardcoded answers serve the same recruiter-facing purpose at zero ongoing cost.

The stack.

Next.js + React
Front-end and demo interactivity. Lives at /work/finsight in the same Next.js app as the rest of the portfolio.
Inline SVG charts
Real charts driven by sample data, no external charting library. Consistent with the rest of the portfolio's visualization approach.
Claude API
Designed-in for narration and Q&A. Not currently deployed live; the demo uses representative responses.
Python (reference)
Reference implementation of the cleaning + KPI compute pipeline. Built first to validate the math, then encoded into deterministic web logic.

What's next.

The architecture is fully designed. The interactive demo proves the UX end-to-end on real sample data. The piece that has not been built is the live deployment, connecting the Q&A endpoint to a real Claude API key, adding rate limiting and per-user cost controls, and handling actual user uploads.

That phase is mostly engineering work, not architectural work. It is also a non-trivial commitment in API spend at scale, which is why the architecture-first version exists. If FinSight ever becomes a paid product targeting mid-market FP&A teams, the live deployment is the natural first step.

Up nextJPMorgan
All work ↑