How to Connect AI Assistants to Bank Accounts: A Practical Architecture for Personal Finance Analysis

    This article walks through a practical, read-only architecture for connecting AI assistants to bank and credit card accounts for personal finance analysis. It covers the five layers of the system—account connection through licensed data aggregators, transaction normalization into analysis-ready fact tables, rule-first classification with model fallback, compiling natural language questions into controlled queries, and governance with field-level minimization and full audit trails—along with optional cloud components, trustworthiness practices such as traceability and transparent calculation basis, and a developer checklist for shipping safely. Readers will learn why monetary calculations must stay in the data layer, how confidence thresholds and human confirmation loops reduce errors, and how to keep the assistant an analyst rather than an operator.

    1. Why Personal Finance Analysis Is a Priority Scenario for AI

    Personal finance management has long suffered from the same pain points: data scattered across multiple accounts and channels, complex statement structures, and a high barrier posed by financial terminology. Users often know only that they “spent money,” not where it structurally went. At the same time, large language models have improved rapidly at natural language understanding, long-context attribution, and structured summarization, turning “ask one question in plain language, get a spending breakdown” from a concept demo into a usable product capability.

    A new product form has recently emerged: an intelligent assistant that, with explicit user authorization, connects to bank and credit card accounts and answers questions such as “Where did my money go this month?”, “How many unpaid bills remain before the next payday?”, “Can I afford this large purchase?”, and “Roughly how much can I save each month?” From a technical perspective, this capability does not connect a model directly to a bank’s core system. It is supported by a layered architecture: an account connection layer, a data normalization layer, an analysis and reasoning layer, and a permissions and audit layer.

    One point of basic consensus on permission design is worth noting: the connection is read-only. The assistant cannot transfer, manage, or invest user funds, so it carries no trade execution or investment advisory function. What genuinely needs to be designed well is “what can be seen, what can be inferred, and how to prevent a misjudgment from being taken as a conclusion.”

    2. Overall Architecture: Five Layers from Account Connection to Conversational Analysis

    The mainstream approach is not to have the model or application scrape online banking directly, but to complete authorization and data retrieval through a regulated account data aggregation service. The user completes identity verification and authorization on their bank’s side, and the application receives only a credential representing that connection; all subsequent reads are performed on the basis of this credential. This approach yields three benefits:

    • Credentials never land in the app: the application never touches the user’s online banking password, reducing the credential exposure surface;
    • Authorization is revocable: the user can disconnect at any time on either the bank or the application side, and read access is immediately invalidated;
    • Compliance is explainable: what the bank faces is a vetted data access party, not uncontrolled scraper traffic.

    2.2 Data Model Layer: Unifying Heterogeneous Payloads into Analysis-Ready Fact Tables

    Field naming, precision, time zones, and merchant name formats differ enormously across institutions. To make the model’s output stable, raw payloads must first be normalized into a unified fact table, typically including:

    • Account dimension: institution name, account name, account type (checking/savings/credit card), last four digits of the account number, current balance, credit limit;
    • Transaction dimension: transaction time, posting time, amount and currency, debit/credit direction, raw merchant description, normalized merchant name, category, whether it is an installment, whether it is a refund or reversal;
    • Derived dimension: statement period attribution, subscription identification, recurring bill flags, an approximation of disposable income.

    A schematic structure looks like this:

    1. {
    2. "account": {
    3. "institution": "Some Bank",
    4. "name": "Daily Spending Account",
    5. "type": "checking",
    6. "mask": "****4821",
    7. "balance": 18420.55,
    8. "currency": "CNY",
    9. "credit_limit": null
    10. },
    11. "transactions": [
    12. {
    13. "txn_id": "t-9f2c",
    14. "posted_at": "2026-08-14T09:12:00+08:00",
    15. "amount": -128.50,
    16. "direction": "debit",
    17. "merchant_raw": "SQ *GREEN LEAF COFFEE #221",
    18. "merchant_norm": "Coffee and beverages",
    19. "category": "Dining",
    20. "recurring": false,
    21. "reversed": false
    22. }
    23. ]
    24. }

    One engineering principle is non-negotiable: store amounts as integers in the smallest currency unit or as high-precision decimals; binary floating point is prohibited. All aggregation must be computed in the data layer, never left to the model to “do in its head.”

    2.3 Classification and Grouping Layer: A Sensible Split Between Deterministic and Probabilistic Work

    Spending classification is the core of this kind of feature and the easiest place to go wrong. Mature solutions use a two-stage design of “rules first, model as fallback”:

    • The first stage is handled by deterministic rules: a merchant normalization dictionary, keyword patterns, recurring detection (the same merchant, similar amounts, appearing at a fixed interval three or more times is judged a subscription or recurring bill), and exclusion of transfers and internal movements;
    • The second stage hands transactions that cannot be classified to the model for semantic categorization, with a confidence score and a summary of the basis;
    • The third stage routes low-confidence results into a user confirmation queue, and every user correction flows back as a new entry in the vocabulary or rules, forming a loop that keeps converging.
    1. def classify(txn, rules, model):
    2. hit = rules.match(txn.merchant_norm, txn.amount, txn.channel)
    3. if hit and hit.confidence >= 0.9:
    4. return hit.category, "rule", hit.confidence
    5. pred = model.classify(merchant=txn.merchant_norm,
    6. amount=txn.amount,
    7. context=txn.recent_7d_summary)
    8. if pred.confidence >= 0.6:
    9. return pred.category, "model", pred.confidence
    10. return "pending_review", "fallback", pred.confidence

    It is worth emphasizing that the model’s job is understanding and summarizing, not calculating and adjudicating. Metrics such as totals, shares, and year-over-year or month-over-month comparisons should be produced by the query engine through structured computation, with the model only organizing language and explaining causes. This significantly reduces numeric hallucination.

    2.4 Reasoning and Answer Layer: Compiling Natural Language Questions into Controlled Queries

    To keep the model from traversing the full set of transaction details (which wastes context and is error-prone), a viable approach is to first perform an “intent to query” compilation:

    • Map the user’s question to structured query parameters (time range, account set, category set, aggregation method, comparison baseline);
    • Have the query layer execute the aggregation and return compact statistical results plus any necessary sample details;
    • Have the model generate the answer from the statistical results, labeling the calculation basis in the answer (for example, “aggregated by posting time” or “excluding internal transfers”).
    1. # Schematic: intent compiled into a restricted query rather than letting the model fetch data freely
    2. query = {
    3. "range": ["2026-08-01", "2026-08-31"],
    4. "accounts": ["checking", "credit"],
    5. "group_by": "category",
    6. "metrics": ["sum", "share"],
    7. "exclude": ["internal_transfer", "reversed"],
    8. "baseline": "last_month"
    9. }
    10. result = engine.run(query) # returns structured aggregation results
    11. answer = model.compose(result) # responsible only for expression and explanation

    For questions like “Can I afford a given expense,” the sound technical approach is to provide a range estimate based on historical cash flow along with sensitivity factors, rather than a definitive feasibility verdict. One example basis: take the median disposable income over the past six months, identified recurring bills, the target amount, and the planned period as inputs, output the required savings rate range, and explicitly list the estimation assumptions. This satisfies the user’s need for decision support without overstepping into financial advice.

    2.5 Governance and Audit Layer: Least Privilege Across the Entire Chain

    • Field-level minimization: request only fields the business requires. Credit limits and the last four digits of account numbers are used as needed; for pure spending analysis, unnecessary sensitive ancillary information is not pulled by default;
    • Context isolation: conversation context and account data are stored separately, and historical sessions are automatically purged on the cycle set by the user;
    • Encryption in transit and at rest: connection credentials and financial data are encrypted both in transit and on disk, with keys managed by a dedicated key management service and rotation supported;
    • Full audit: every read records the time, scope, fields, purpose, and caller identity, and users can see “what the assistant has looked at”;
    • Not used for training by default: using financial data for model training requires separate, explicit, revocable authorization;
    • Revocation takes effect immediately: after disconnection, cached data should be invalidated within one synchronization cycle.

    3. Optional Cloud Supporting Components

    From an implementation standpoint, this kind of system usually does not require proprietary platform capabilities; general-purpose cloud components are sufficient:

    • Object storage: holds desensitized snapshots of analysis results and reconciliation files;
    • Message queues: smooth out traffic peaks and handle asynchronous processing of incremental transaction sync and classification tasks;
    • Container platform: hosts the query service, classification service, and conversation orchestration service, making elastic scaling straightforward;
    • Key management: manages data intermediary credentials and encryption keys with automatic rotation;
    • Logging, monitoring, and alerting: build dashboards and threshold alerts for metrics such as authorization failure rate, classification confidence distribution, and response latency;
    • Data masking and content safety capabilities: identify and mask sensitive patterns such as account and ID numbers before data enters model inference.

    The combination of capabilities Baidu AI Cloud offers in these general categories can serve as a reference foundation for building similar systems; specific choices still need to be evaluated against your own compliance requirements and data scale.

    4. Trustworthiness Design: Making AI Conclusions Stand Up to Scrutiny

    What makes the financial scenario special is that users make real decisions based on conclusions. Both product and engineering sides must therefore guarantee traceability:

    1. Traceable: any aggregate number can be drilled down to the set of transactions that compose it;
    2. Transparent basis: the time basis, currency, and exclusions are stated clearly in the answer;
    3. Expressed uncertainty: data gaps (for example, an interrupted account connection or only partial years of history) must be disclosed proactively;
    4. No out-of-bounds statements: no “recommend buying/selling” or “guaranteed returns” content; only facts and estimates based on history;
    5. Correction channel: low-confidence classifications go to human confirmation, and the corrected results flow back to improve the rule base.

    5. Evolution Direction: From “Reading Statements” to “Coordinating with Licensed Professionals”

    A natural evolution path is for the assistant to handle data organization, unified calculation basis, and information explanation, leaving the parts that require professional judgment to qualified institutions and practitioners, forming a division of labor where “the assistant summarizes and the professional decides.” The corresponding technical capabilities include outputting data summaries under explicit authorization, standardized reports oriented to a professional advisor’s perspective, and fine-grained declarations of authorization scope and purpose. The key to this direction is not model capability, but the design of authorization boundaries, audit trails, and allocation of responsibility.

    6. A Practical Checklist for Developers

    • Make the read-only boundary explicit, with both product copy and technical implementation reflecting “no transfers, no custody, no investment advice”;
    • Do data normalization and rule-based classification first, then introduce the model as fallback, avoiding betting accuracy entirely on the model at once;
    • Push all monetary calculations down to the data layer, with the model only handling understanding and expression;
    • Establish confidence thresholds and a human confirmation loop, continuously feeding corrections back;
    • Control data retention with field-level minimization and automatic cleanup, and uniformly mask sensitive fields before they enter the model;
    • Prepare three test sets before launch: boundary values (large amounts, refunds, cross-currency), anomalous data (missing fields, duplicate postings), and adversarial prompts (attempts to induce investment advice);
    • Treat complete audit and one-click revocation as pre-launch requirements, not later patches.

    Build this design solidly, and an AI assistant can genuinely become the “analyst” of personal finance rather than the “operator”—helping users understand their money faster while keeping every conclusion clear, verifiable, and controllable.