FS Preparation Agent:
Financial statement engine
Converts trial balances, prior-year financial statements and supporting documents into a complete set of statements under IFRS, Ind AS or Turkish TFRS. Roughly 89,000 lines of Python behind 1,828 tests.
Commercial product — the repository is private.
CORE CAPABILITIES
Format Is Learned, Not Hard-Coded
There is no canonical FS format. The engine learns the presentation from the prior-year financial statements rather than encoding a layout per reporting framework.
Cross-Reference Graph
Nine node kinds and six edge kinds tie statement lines, notes, schedules and trial-balance accounts into one navigable graph.
Arithmetic Tie-Out
A resolved link is only confirmed once the numbers reconcile. Tolerance is scale-aware, and an unknown scale returns NEEDS_REVIEW rather than a false FAILED.
Three-Tier Page Router
An explicit cost gate on ingestion: a free text layer first, document intelligence next, and vision only for pages that genuinely need it.
8-Agent Roundtable
Eight specialist agents and roughly 25 tools, coordinated by a relevance-bidding floor market across seven phases with human-in-the-loop gates.
Grounded Figures Only
determinism.py requires every figure an agent states to come from a deterministic tool. Ungrounded numbers are flagged or redacted.
9 NODE KINDS
Edges are made by deterministic resolvers and confirmed by reconciliation — never by all-pairs LLM guessing.
6 EDGE KINDS
HAS_BREAKDOWN_IN
A statement line expands into a note or schedule.
TIES_TO_ACCOUNT
A presented figure resolves down to trial-balance accounts.
DERIVED_FROM
A figure is computed from other nodes in the graph.
COMPARED_TO_PY
The current-year node maps to its prior-year counterpart.
GOVERNED_BY_POLICY
A line or note is bound to the accounting policy that governs it.
REFERENCES
A plain cross-reference between two nodes.
EDGE PROVENANCE — created_by
DETERMINISTIC_RESOLVER
Edge created by rule-based resolution.
LLM_CANDIDATE
Edge proposed by the rescue layer, not yet confirmed.
LLM_RECONCILED
LLM-proposed edge that later passed arithmetic tie-out.
MANUAL
Edge created by a human preparer or reviewer.
TIE-OUT STATUS
The LLM rescue layer only extracts and points at cells. Figures are remapped to the real Cell and the pass/fail verdict comes from the same deterministic arithmetic — so the LLM can never hallucinate a PASS.
THREE-TIER PAGE ROUTER
A_textlayer
pdfplumber over the embedded text layer. Free.
B_docintel
Azure Document Intelligence, prebuilt-layout.
C_vlm
gpt-4o vision, reserved for scanned, rotated or ambiguous pages.
The router exists as an explicit cost gate — a page only escalates to the next tier when the cheaper one cannot read it.
MODEL TIERS
gpt-4o-mini
High-volume extraction and classification
gpt-4o
Standard reasoning tier
gpt-5.2-chat
Strong reasoning tier
gpt-4o (vision)
Pinned separately for the C_vlm page route
text-embedding-3-large
3072-dimensional embeddings
rerank-multilingual-v3.0
Cohere reranking over retrieved context
8-AGENT ROUNDTABLE
Roughly 25 tools, a relevance-bidding floor market deciding who speaks, seven phases, and human-in-the-loop gates on a preparer < reviewer < approver role ladder. A hash-chained append-only audit log records the run, and a 10-validator suite — four of them blocking — guards the output.
10 DETERMINISTIC FRF ENGINES
Lease — IFRS 16
Lessee measurement and remeasurement.
Lessor accounting
Finance and operating lease treatment on the lessor side.
PPE
Property, plant and equipment schedules and depreciation.
Employee benefits — IAS 19
Defined benefit obligation workings.
Foreign exchange — IAS 21
Translation and remeasurement effects.
Revenue — IFRS 15
Recognition across performance obligations.
Segment — IFRS 8
Operating segment aggregation and disclosure.
Impairment — IAS 36
Recoverable amount and impairment workings.
ECL — IFRS 9
Expected credit loss computation.
VUK inflation
Turkish inflation accounting adjustments.
No LLM in any of them.
TECHNICAL ARCHITECTURE
backend
Python 3.11 + FastAPI
~89,000 LOC, 1,828 tests
SQLAlchemy 2 + Alembic
27 migrations
PostgreSQL + pgvector
Relational store and embedding index
ai
Azure OpenAI
Four pinned model tiers
Azure Document Intelligence
prebuilt-layout on the B tier
Cohere Rerank
rerank-multilingual-v3.0
platform
Next.js 15
16-tab engagement workspace
Docker
Containerised services
Railway
Deployment target
