Bank Account Financial Query Architecture for LLM Assistants

    As LLM assistants move from general Q&A to scenario-specific tool invocation, personal finance querying has become a representative high-sensitivity, low-operation use case. This article outlines a practical architecture for read-only bank account access, covering authorization, aggregation, controlled query execution, and explainable presentation. It examines permission models, intent parsing, deterministic financial calculations, anomaly detection, privacy isolation, auditability, data contracts, and failure boundaries so that assistants can interpret numbers without touching funds.

    As LLM assistants move from general question answering toward scenario-specific tool invocation, personal finance querying has become a representative use case: it is highly sensitive but requires little direct operation. Users want aggregated cross-account information, explanations of spending patterns, and anomaly alerts—not a model that directly moves money. The technical value lies in turning fragmented bank account data into understandable natural-language insights. The core risks lie in authorization, privacy, data minimization, model error, and the verifiability of outputs. This article describes a practical engineering architecture and design considerations around the goal of “reading numbers without touching funds.”

    1. Functional Scope and Boundaries: Read Numbers, Do Not Move Funds

    The first principle of personal finance querying is to define clear boundaries. The assistant can answer questions such as “Which categories did my spending go to this month?”, “How much available balance will I have before payday?”, or “Are there duplicate charges?” It should not initiate transfers, modify account information, manage assets, or execute investment operations. From an engineering perspective, capabilities should be limited to read-only queries and analysis. All fund-operation intents should be rejected during intent parsing or handed off to regulated channels.

    This positioning creates two direct requirements: permissions must be read-only, and outputs must be explainable. Read-only permissions reduce operational risk, but they do not eliminate privacy risk. Data minimization, session isolation, and auditing are therefore also required. Explainable output means the assistant should state the data basis, time range, assumptions, and possible errors when presenting conclusions, so users do not mistake a model-generated summary for official bank accounting information.

    2. Overall Architecture: Authorization, Aggregation, Query, and Presentation

    A complete personal finance query capability can be divided into four layers:

    1. Authorization layer: The user actively logs in to the bank account, completes identity verification in a financial data aggregation service, and authorizes the assistant to have read-only access to specified accounts. The assistant does not obtain bank passwords; it only holds restricted tokens.
    2. Aggregation layer: Based on the account scope selected by the user, the system retrieves account names, types, last four digits of account numbers, balances, credit limits, and transaction records within a limited time window, forming a standardized snapshot.
    3. Query layer: Natural-language questions are parsed into controlled query intents, such as balance inquiry, spending summary, recurring bills, anomaly detection, chart generation, or term explanation. Calculations are then executed on structured data.
    4. Presentation layer: Calculation results are converted into natural language, tables, or charts, with data-scope notes, confidence indicators, and verification suggestions.

    The four layers should be connected through explicit data contracts. The aggregation layer provides only the fields required for queries, the query layer does not directly handle raw authorization credentials, and the presentation layer does not disclose sensitive information such as full account numbers.

    3. Account Access and Permission Model: Read-Only, Minimal, and Revocable

    Account access should follow the principle of least privilege. The assistant can access only the accounts the user chooses to connect. The authorization scope should be explicitly read-only and must not include write operations such as transfers, payments, or profile changes. Tokens should be bound to the user session, have expiration times, and support revocation at any time. After unlinking, the assistant should immediately lose subsequent access, and cached data should be cleared or invalidated according to policy.

    Data scope should also be minimized. Accessible fields typically include bank name, account name and type, last four digits of the account number, balance and credit limit, and transaction records for up to two years. Full account numbers, login passwords, and unrelated personal information should not be obtained. For credit accounts, balance, credit limit, and available credit should be distinguished to avoid mistaking a credit limit for a cash balance.

    The permission model should also support graded authorization by account, time range, and query type. For example, if a user allows queries only for the last three months of transactions, the aggregation layer should not return earlier data. If a user allows only spending summaries, then merchant category fields required for anomaly detection should also be masked.

    4. From Natural-Language Query to Financial Calculation: Intent Parsing and Controlled Execution

    The key to natural-language querying is not to let the model freely generate SQL or access arbitrary data, but to map user questions to a finite, auditable set of query intents. Intent parsing should output a structured object including query type, time range, account scope, category dimensions, and output format. A question such as “Where did my money go this month?” is parsed as a spending summary and category breakdown. A question such as “How much will I have left before payday?” is parsed as a balance query minus planned expenses.

    The execution stage should use controlled calculation functions rather than letting the model read all transactions and perform mental arithmetic. Amount aggregation, category grouping, recurring-bill identification, and balance deductions should be performed by deterministic code. The model is responsible for explaining results and organizing language. If a question involves financial terms, the assistant can explain the concept before calculating—for example, explaining what an annual interest rate means before estimating actual interest expense.

    5. Summaries, Charts, and Anomaly Detection: From Data to Insight

    Spending summaries should aggregate by category, time, and account. Outputs should distinguish income, expenses, transfers, and repayments to avoid double-counting transfers between accounts as spending. Using an illustrative basis, monthly spending might be summarized as several thousand dollars, with rent and utilities accounting for a relatively high share and categories such as dining listed separately. After subtracting planned expenses before payday, the system can then present the available balance. All summaries should state the time range and whether pending transactions are included.

    Anomaly detection can combine rules and statistics: duplicate charges can be identified through similarity in amount, merchant, and time window; unexpected fees can be identified by deviation from historical averages or by exceeding budget thresholds; and steadily rising recurring bills can be compared across consecutive billing cycles. Chart generation should support weekly spending charts, bill calendars, and customizable dashboards, and should allow users to adjust parameters. Anomaly alerts should be phrased as “suspected” rather than “confirmed,” and users should be advised to verify against bank information.

    6. Explainability and Verification: Term Explanations, Data Scope, and Confidence Indicators

    Financial answers must be explainable. The assistant should state the data source scope, statistical basis, time window, whether pending transactions are included, whether credit accounts are included, and the assumptions used in calculations. When the model is uncertain or data is incomplete, it should provide confidence indicators rather than absolute conclusions. For key numbers, users should be advised to rely on official bank information.

    Term explanations are an important way to lower the barrier to understanding. For users unfamiliar with financial terminology, the assistant can first explain concepts such as annual interest rate, available balance, credit limit, and recurring bills, and then provide a personalized calculation. Explainability also includes refusing inappropriate requests: when a user asks for a transfer, account modification, or investment operation, the assistant should clearly state the limits of its capabilities.

    7. Privacy and Security: Session Isolation, Training Isolation, Auditing, and Masking

    Privacy design should include at least four elements: session isolation, training isolation, audit logs, and masked display. Conversations within the personal finance area should not be used to train models; interactions outside that area follow the user’s regular privacy settings. Audit logs should record query intent types, data fields used, time ranges, and output confidence, but should not record full sensitive fields. Displays should show only the last four digits of account numbers, and sensitive information in transaction descriptions should be masked.

    Transmission and storage should use encryption and short-lived tokens. Data contracts between the aggregation layer and the query layer can restrict fields, preventing raw transaction details from spreading across multiple components. Caches should have expiration policies and should be invalidated immediately after unlinking. Anomaly detection and chart generation should follow the same data scope and must not expand access for analytical purposes.

    8. Engineering Illustration: Abstract Pseudocode and Data Contract

    The following is abstract pseudocode that expresses only the control flow and does not represent a real interface:

    1. # Abstract pseudocode: read-only financial query
    2. def handle_finance_query(user_id, session_id, query, account_scope):
    3. assert is_read_only_scope(account_scope)
    4. intent = parse_intent(query) # balance/summary/anomaly/chart/term
    5. if intent.type in WRITE_OPERATIONS:
    6. return refuse_with_boundary_notice()
    7. snapshot = fetch_aggregated_snapshot(
    8. account_scope,
    9. time_range=intent.time_range,
    10. fields=intent.required_fields
    11. )
    12. result = compute_finance(intent, snapshot)
    13. answer = render_explanation(
    14. result,
    15. assumptions=intent.assumptions,
    16. confidence=estimate_confidence(snapshot, intent)
    17. )
    18. audit_log(user_id, session_id, intent.type,
    19. snapshot.fields_used, answer.confidence)
    20. return answer

    The data contract can use the following abstract structure:

    1. {
    2. "account_type": "deposit_or_credit",
    3. "masked_account": "****1234",
    4. "balance": 1234.56,
    5. "credit_limit": 5000.00,
    6. "transactions": [
    7. {"date": "2025-01-02", "amount": -20.00, "category": "Dining"}
    8. ]
    9. }

    This contract exposes only the fields required for queries, masks account numbers, and trims transaction records by time range. The query layer must not hold full authorization credentials, and the presentation layer must not output full account numbers.

    9. Risks and Boundaries: Model Error, Data Delay, and Major Decision Notices

    Personal finance querying still involves model error, data delay, and differences in data definitions. Transactions may not yet be posted, categories may be inaccurate, balances in credit accounts and cash accounts have different meanings, and recurring-bill identification may produce false positives. The product should therefore position the assistant as an information query and analysis tool, not as the primary subject of financial decision-making. For major financial decisions, users should be advised to rely on licensed professionals and regulated financial institutions.

    Engineering design should also include failure degradation: when data retrieval fails, clearly inform the user and do not generate fabricated numbers; when intent is unclear, ask for clarification; when a request exceeds the authorized scope, deny access; when an anomaly is detected, only suggest verification and do not automatically take action.

    10. Implementation Recommendations and Conclusion

    For implementation, it is advisable to start with read-only queries and spending summaries, then gradually expand to anomaly detection and charts; start with a small number of account types, then refine multi-account data definitions; and establish auditing and unlinking mechanisms before opening more subscription tiers. Developers should treat permissions, data contracts, deterministic computation, explainable output, and privacy isolation as five foundational modules rather than after-the-fact patches.

    Overall, financial querying for LLM assistants connected to bank accounts represents a pragmatic way to apply large models in consumer financial services: read-only authorization enables information aggregation value, deterministic computation reduces model error, and explainable and revocable design controls risk. Only by treating “not touching funds” as an architectural constraint rather than a marketing slogan can teams build a sustainable personal finance query capability.