A Glass-Box AI Analyst for Financial Red Flags
It shows every step of its work — every claim cited, every number traceable to its source.
This flagship project (final name under wraps until public launch) is a local-first tool that reads a listed Indian company's annual report and produces a ranked, cited, severity-and-confidence-scored set of accounting and solvency red flags. It proposes escalation; a human decides.
The Problem — Trust Is the Bottleneck, Not the Answer
In June 2026, SEBI passed an ex-parte order against Rajesh Exports, alleging roughly ₹15.15 lakh crore of misrepresented revenue across FY21–25. The numbers had been public for years. The failure surfaced through a shareholder complaint — not the audit. It is the canonical modern failure in regulated finance: the answer existed, but nobody made the reasoning legible.
Generic "chat with your PDF" tools make this worse — confident, black-box verdicts nobody can sign. In regulated finance, an answer you can't defend to an auditor or a risk committee is worthless. This project is built on the opposite premise: it sells defensible, auditable, legible judgment, not answers.
The Architecture — Math in Code, Language in the Model
The single most important design decision in this tool is a hard split of responsibilities:
- Deterministic math lives in code. Altman Z-Score, Beneish M-Score, DSO, interest coverage and every other metric are computed in a tested TypeScript compute layer, validated against Enron — the classic worked example. Numbers are reproducible and can never be hallucinated, because the LLM never does arithmetic.
- The LLM (Gemini) only reads and reasons. It handles the qualitative sections — related-party notes, contingent liabilities, the auditor's report, going-concern language — and articulates a reasoning chain over the pre-computed metrics, including plausible benign explanations, because honesty is a feature.
- A grounding validator polices the boundary. Every number in the model's output must round-trip to provenance — a computed value, a source figure, a page anchor. Anything unaccounted for is rejected as ungrounded, never shown to the user.
Judgment is bounded by a closed rubric of five flag families — solvency, earnings quality, related-party exposure, audit signals, and leverage — and every flag honours a six-part evidence contract: claim, exact citation, computed metric with formula, reasoning chain, severity with calibrated confidence, and a recommended next step.
What v1 Ships
- A dual-pane workbench: click any conclusion and the exact source line highlights in the original PDF — the "it actually read it" moment.
- Ranked flag cards with severity and calibrated confidence, plus an exportable evidence pack an analyst could hand to a committee.
- A curated demo set running end-to-end: Rajesh Exports FY24 as the hero case, TCS FY24 as the clean control.
- Bring-your-own-document: extraction proposes draft figures from a local PDF, a human reviews and accepts each value in a source-linked grid, and only confirmed data flows into the unchanged compute layer — with confidence capped by data tier.
- Packaged as a native macOS desktop app (Tauri) as well as a local web app. Local-first: no accounts, no multi-tenant backend — model calls are the only network traffic.
Verified, With Honest Limits
- 208/208 unit tests green across compute, reasoning, extraction, UI and eval integrity; the strict TypeScript build compiles clean.
- An eval harness against a hand-labelled gold set: 100% metric accuracy and 100% combined flag recall on the hero case, with citation round-trip checks.
- Triage, never a verdict. The tool proposes what an analyst should investigate — it never declares fraud.
- Narrative flags are curated-only for now. Generating them for user-supplied documents is deliberately research-gated rather than shipped half-trustworthy.
Why It Matters
This project is a working, miniature proof of the thesis explainable-AI companies build at enterprise scale: audit-ready, explainable AI for risk and compliance. It demonstrates the judgment that separates production AI from demos — knowing what the model must never be trusted with, and engineering that boundary as a validator rather than a hope.
The code lives in a private repository ahead of public branding — happy to walk through it, the eval harness, and the architecture decision records.