Moving invoice arithmetic out of the LLM and into exact BigInt minor-unit math is the right separation of responsibilities. Letting a model extract fields and then asking a second LLM call to "double-check totals" still fails on subtle accounting edge cases like parenthesized credit notes such as (50.00) or rounding discrepancies across tax-inclusive line items.
Pairing that with a table-aware chunker that splits strictly along row boundaries and repeats column headers with a tableSplitPart marker solves the other major failure mode in financial RAG. Keeping deterministic validators stateless and free of external URL fetches also keeps workflow security audits straightforward.
Thanks Ahmet — really appreciate the thoughtful read!
You nailed the exact two traps we kept seeing in production: asking a second LLM pass to "double-check totals" almost always glosses over parenthesized credit notes like (50.00) and per-line tax-inclusive rounding drift. Keeping both tools strictly stateless with zero outbound fetches was also deliberate so teams don't get stuck in security review just to validate JSON arithmetic.
Out of curiosity, in your RAG / agent pipelines, are you running into multi-currency or VAT-inclusive invoice edge cases (or multi-page financial tables) that break standard parsers? If you ever throw a tricky test payload at the free MIT n8n blueprints and spot an accounting edge case we haven't covered yet, I'd love to add it to the deterministic ruleset.
Ahmet Özel
Moving invoice arithmetic out of the LLM and into exact BigInt minor-unit math is the right separation of responsibilities. Letting a model extract fields and then asking a second LLM call to "double-check totals" still fails on subtle accounting edge cases like parenthesized credit notes such as (50.00) or rounding discrepancies across tax-inclusive line items.
Pairing that with a table-aware chunker that splits strictly along row boundaries and repeats column headers with a tableSplitPart marker solves the other major failure mode in financial RAG. Keeping deterministic validators stateless and free of external URL fetches also keeps workflow security audits straightforward.