🏦 Bank Statement Processing

End-to-End Flow Documentation

System Overview

This document describes the end-to-end flow for processing bank statements across multiple banks. Each bank has its own statement structure (page layout and transaction placement). The system converts statements into HTML templates, applies bank-specific rules, audits incorrect statements using AI, fixes detected issues, and generates corrected statements.

🎯 Key Objectives

Multi-Bank Support
Handle 12+ different bank statement formats
AI-Powered Audit
Automated validation and error detection
Template Generation
Standardized HTML output formats
Error Correction
Automatic fixing of detected issues

Supported Banks & Template Structure

Monzo 3 Pages
Page 1: Main
Page 2: Transactions
Page 3: End Statement Content
Coverage: From Page 1 up to before Page 3
Royal Bank 3 Pages
Page 1: Main
Page 2: Transactions
Page 3: End Statement Content
Coverage: From Page 1 up to before Page 3
LLOYDS Bank 3 Pages
Page 1: Main
Page 2: Transactions
Page 3: End Statement Content
Coverage: From Page 1 up to before Page 3
NatWest 3 Pages
Page 1: Main
Page 2: Transactions
Page 3: End Statement Content
Coverage: From Page 1 up to before Page 3
HSBC 3 Pages
Page 1: Main
Page 2: Transactions
Page 3: End Page Content
Coverage: From Page 1 to Page 3
Tide 3 Pages
Page 1: Main
Page 2: Transactions
Page 3: End Statement Content
Coverage: From Page 1 up to before Page 3
Barclays 4 Pages
Page 1: Main
Page 2: Transactions
Page 3-4: End Statement Content
Coverage: From Page 1 up to before Page 3
Revolut Ltd 3 Pages
Page 1: Main
Page 2: Transactions
Page 3: End Statement Content
Coverage: From Page 1 up to before Page 3
Starling Bank Ltd 3 Pages
Page 1: Main
Page 2: Transactions
Page 3: End Statement Content
Coverage: From Page 1 to Page 3
Santander UK plc 3 Pages
Page 1-2: Main
Page 3: Transactions
Coverage: Transactions start from Page 3
Metro Bank 3 Pages
Page 1-2: Main
Page 3: Transactions
Coverage: Transactions start from Page 3
Modulr 3 Pages
Page 1: Main
Page 2: Transactions
Page 3: End Statement Content
Coverage: From Page 1 to Page 3

High-Level System Flow

1
Template Preparation
  • Each bank statement format is converted into a static HTML template and saved in backend
  • Templates are divided into pages (Main, Transactions, End Statement) based on bank-specific layouts
  • A rule set is defined for each bank (page order, transaction start/end, validations)
2
User Input
User uploads a PDF bank statement (potentially incorrect or inconsistent).
3
Data Extraction
The system extracts structured data from the PDF, including:
  • Account details
  • Statement period
  • Balances
  • Transactions
4
Rule Evaluation (AI-Powered)
  • AI identifies the bank type
  • AI validates extracted data against bank-specific rules, such as:
    • Transaction placement
    • Page boundaries
    • Missing or inconsistent fields
5
Audit Report Generation
AI generates an Audit Report containing:
  • Detected issues
  • Rule violations
  • Formatting or data inconsistencies
6
Statement Fixing
Based on the audit report:
  • Incorrect data is corrected
  • Layout issues are fixed
  • Data is re-mapped into the correct HTML template
7
Final Output
A corrected bank statement is generated from the HTML template.
Output can be exported as:
  • PDF
  • HTML (for review or further processing)
⚠️ IMPORTANT NOTE

Model Limitation: Maximum processing capacity is limited to 10 Pages per statement.

Roles of Bank - Audit & Generation Protocols

🔲 Revolut Ltd - Statement Generation & Audit
Header Requirements MUST
  • Top Left: Revolut Logo (left-aligned)
  • Top Right: "Transaction statement" heading
  • Only first letter of each word capitalized in heading
AI Role Definition STRICT
  • Specialized financial-document AI for Revolut standards
  • Enforce formatting, syntax, spacing, alignment rules
  • Validate HTML template structure
  • Generate correction prompts for non-compliant statements
🟠 Modulr - Audit & Generation Rules
System Role STRICT
  • Specialized financial-document AI for Modulr-style statements
  • Responsible for generating and validating Modulr bank statements
  • Enforce every formatting, syntax, spacing, alignment, and logic rule
Validation Scope AUDIT
  • Template structure compliance
  • Transaction data accuracy
  • Balance calculations
  • Date format consistency
🔵 Tide Business - Formatting & Validation
Header Section MUST
  • Top Left: Tide Brand Logo (left-aligned)
  • No additional text on left header
  • Top Right: Business information section
Business Rules STRICT
  • Business-specific statement formatting
  • Company details placement validation
  • Account type identification (Business)
  • Registration number verification
🔴 Santander UK - Business Statement Audit
Audit Protocol AUDIT
  • Analyze statement against strict validation rules
  • Report any discrepancies found
  • Global formatting and syntax verification
  • Business account-specific checks
Column Structure MUST
| Date | Description | Paid In(£) | Withdrawn(£) | Balance(£) |
  • Exactly 5 columns in specified order
  • Currency symbol (£) mandatory for monetary columns
  • Date format changes based on context
🟣 NatWest - Compliance Auditor
System Instructions STRICT
  • Expert Bank Statement Compliance Auditor
  • Specializing in NatWest documentation standards
  • Analyze input data and generate strict Audit Report
  • Verify document authenticity markers
Audit Objectives AUDIT
  • Validate statement structure compliance
  • Check NatWest-specific security features
  • Verify transaction sequence integrity
  • Flag formatting inconsistencies