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 — a Cross-Reference Graph links every statement line to its note and ledger account, and every link is confirmed by arithmetic, not model judgement.
Commercial product — the repository is private.
Architecture
No product screenshots — this is a backend engine. The diagram below is the system itself.
Format is learned, not hard-coded
There is no canonical FS format. The engine learns presentation from the prior-year financial statements rather than encoding a layout per reporting framework.
Edges are earned, not guessed
Links are made by deterministic resolvers and confirmed by arithmetic tie-out — never by all-pairs LLM guessing. Tolerance is scale-aware, and an unknown scale returns NEEDS_REVIEW rather than a false FAILED.
Grounded figures only
determinism.py requires every figure an agent states to come from a deterministic tool. Ungrounded numbers are flagged or redacted.

Figure 01 — Cross-Reference Graph construction and arithmetic tie-out.
Open full size ↗The graph
Cross-Reference Graph
9 NODE KINDS
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.
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.
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.
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 is 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