I wanted a small finance example where I could check every number and make the working visible. I used Codex to build this independent prototype around one question: what contributed to the change in quarterly operating income?
I chose public Novartis figures with comparable quarters in the same statement, so the task could stay focused on that reconciliation. It compares reported Q4 2025 with Q4 2024. This is new demonstration work using public reports, not work I performed for Novartis.
Explore the full report, or start with the original quarterly bridge.
Start with a comparison that can be checked
The source is a manually reviewed extract of the company's financial report. Each financial line carries an identifier, its two period values, the unit, its sign and a report reference. Automatic PDF extraction is outside this version.
The Python pipeline checks the input before calculating: both quarters must be present, the reporting basis and units must agree, and the expected financial lines must be unique and complete. I kept expense values negative as shown in the income statement.
That sign convention matters. Other expense moved from minus $659 million to minus $447 million. The expense became smaller, so its contribution to operating income was positive $212 million.
Reconcile before writing
Reported operating income moved from $3,530 million to $3,616 million, an increase of $86 million. The pipeline calculates seven changes: sales, other revenues, cost of goods sold, selling and administration, research and development, other income and other expense. I left the gross-profit subtotal out of the bridge because adding it alongside its component lines would count part of the movement twice. The seven signed contributions sum to the same $86 million, with a zero residual.
The interface shows those movements as a bridge. A reader can highlight income increases or reductions, select a financial line, inspect its two original values and open the relevant report page. A second view lists the normalized figures together.
The bridge explains the arithmetic. It doesn't establish operational causes. The short brief therefore separates calculated observations from the company's own explanation, which has a separate evidence reference. The comparison also stays within reported IFRS actuals; budget, forecasts, constant-currency measures and core non-IFRS results would require different inputs.
Give the narrative a small, relevant context
This version builds the brief from checked calculations and a bounded set of relevant report summaries. It makes no model requests and has no inference cost. Numbers are produced by financial arithmetic, rather than generated as prose.
During review, the first narrative validator exposed a gap: checking format, numbers and citation identifiers could still accept a numberless sentence that contradicted the facts. A real citation could also be attached to an invented cause.
I narrowed the optional OpenRouter adapter after that review. It is implemented and disabled; its permitted task is to select and order up to three exact approved statements derived from the facts and evidence. Newly written prose is rejected. A live comparison would still need to test whether model selection is useful. No live inference has been run.
Inspect the failure boundaries
The saved evaluation contains 22 deterministic cases. Alongside reconciliation, they check deliberately wrong signs, mismatched units, incomparable periods, missing or duplicated financial lines and incorrect totals. Brief validation checks the exact approved-statement contract, including rejection of unknown citations, invented metrics, unsupported quantities, a numberless contradiction and an invented cause attached to a real citation.
The interface shows each expected and actual result. Rejecting a deliberately bad input is a successful test. These checks exercise this fixture and its explicit acceptance rules; they do not establish general truth detection or benchmark an LLM's financial reasoning.
A sanitized trace records the calculation stages and the hash of the reviewed source extract. The hash identifies the normalized input, not the bytes of the original PDF.
Connect a service to an inspectable interface
The backend uses Python and FastAPI. The interface uses React and TypeScript within this Next.js site. Refreshing the calculation requests the Python service through the site’s API. A saved result keeps the same source figures, chart and checks available when that service is unavailable.
The result is a working prototype with a narrow question and visible working. Broader ingestion, automatic extraction, private financial data, forecasting and production deployment remain outside its scope.
Expand the same report, without losing the source
The first bridge covered one quarterly change. I wanted to see what else the same document could explain. I used Codex and specialist agents to review all 54 pages, then built a curated dataset from selected financial tables.
The wider explorer compares quarterly and full-year figures, product sales, regions and therapeutic areas. It also follows cash from opening to closing balance, separates reported IFRS income from the company's core measure, and keeps the balance sheet tied to its year-end dates. The source map shows which pages supplied structured figures and which were reviewed for context.
A small detail mattered with newer products: some prior-year cells are blank. Turning those blanks into zero would create a growth comparison the report does not support. I kept them unavailable. Currency rates, share counts and earnings per share also retain their own units rather than being forced into USD millions.
The page uses the same separation as the original prototype. Python builds the financial views and checks their identities. React lets the reader choose periods and inspect the result. The refresh control calls the real FastAPI service; browsing the saved result is labeled separately.
See the source, request flow and exact calculation code. That walkthrough also explains what was manually transcribed, what the software calculates and what has not been tested with an LLM.
Project sources & checks
Novartis Q4 and full-year 2025 report. The consolidated income statement is on page 17; operating-performance commentary is on page 5. Data period: Q4 2025 versus Q4 2024, reported IFRS, USD million.
Inspect the seven contributions, original figures, page references, validation cases and sanitized calculation trace.
The saved review contains the normalized source facts, zero-residual bridge, deterministic brief and 22 evaluation case results. It records zero model calls.