AI Assistant Connected to Bank Accounts: Technical Architecture and Privacy Design for a Read-Only Financial Assistant

    This article explains how to build an AI assistant that connects to bank accounts as a read-only financial analysis layer. It covers the five-layer system architecture, account linking and data permissions, how natural language questions become verifiable calculations, privacy and model-training boundaries, security and compliance controls, product interaction design, evaluation metrics, and common implementation pitfalls. Readers will learn why deterministic computation must be separated from language generation, how least-privilege access and revocable authorization work in practice, and how clear boundaries help reduce users' comprehension and analysis costs within a compliance framework.

    1. Background: From Switching Between Apps to Conversational Financial Queries

    Users managing personal finances typically face three sources of friction. First, information is scattered: bank accounts, credit card statements, savings, and investment records live in separate applications. Second, there is a terminology barrier: financial statements are full of terms such as APR, available balance, and recurring charges. Third, analysis is costly: answering questions like “where did my money go this month” or “how much will I have left before payday” requires manually exporting transactions and building classification and summary tables.

    The value of connecting a large language model assistant to bank accounts is that it collapses the whole “retrieve - clean - compute - explain” chain into a single natural language interaction.

    One point deserves emphasis: the reasonable positioning of this scenario is “read the numbers, not move the money.” The assistant handles cross-account aggregation, category breakdowns, anomaly detection, charts and calendars, and term explanations. It does not initiate transfers, perform asset management, or execute investment operations. The read-only boundary is both a product positioning decision and the cornerstone of risk control.

    2. Overall System Architecture: Division of Labor Across Five Layers

    The system can be abstracted into five layers:

    1. Access layer: the user actively authorizes a read-only connection to bank and credit card accounts.
    2. Data layer: synchronization and standardization of structured data such as account metadata, balances and credit limits, and transaction records.
    3. Semantic layer: mapping natural language questions to executable query and computation intents (intent recognition, slot extraction, time range parsing).
    4. Computation layer: executing aggregation, classification, ratio, and trend calculations inside a controlled sandbox, producing verifiable intermediate results.
    5. Interaction layer: generating answers, charts, statement calendars, and dashboards, plus term explanations and result traceability.

    3. Account Linking and Data Permissions: Authorization, Scope, and Revocation

    1) Authorization flow. A third-party financial data aggregation service is commonly used to complete “user login - identity verification - read-only authorization.” The assistant side never touches the bank password, which keeps sensitive credentials from lingering on the model side. In engineering terms, this usually appears as a one-time authorization token followed by subsequent read-only data pulls.

    2) Least-necessary principle. Read only the fields required to complete the Q&A, for example institution name, account name and type, the last four digits of the account number, balance and credit limit, and up to two years of transaction records. Do not collect additional information unrelated to the question.

    3) Visibility and revocation. Clearly show users which accounts are connected, what data can be seen, and how long data is retained, and provide one-click unlinking. After unlinking, access must stop immediately and cached data must be deleted or anonymized.

    4) Transmission and storage. Encrypt data in transit across the entire chain; encrypt static data at rest; mask or tokenize sensitive fields such as account numbers; apply least privilege to access behavior, avoiding a situation where “one token unlocks every account.”

    4. Answer Generation Under Read-Only Permissions: Turning Questions into Verifiable Computation

    1) Intent and slots. “Where did my money go this month” is parsed as {time range = current month, metric = spending aggregated by category}. “How much will I have left before payday” is parsed as {time = until payday, metric = available balance = current balance - planned spending}.

    2) Separate querying from computation. First run deterministic retrieval and aggregation (category sums, time window filtering, month-over-month and year-over-year comparisons), then let the model organize the language and explanation. This significantly reduces the probability of “computing the wrong number” and makes results reviewable.

    3) Classification system. Establish a stable set of spending categories (housing and utilities, dining, transportation, subscriptions, medical, other) and support hybrid rule-plus-model classification. Flag transactions that cannot be classified as “needs confirmation” so users can participate in correction.

    4) Anomaly detection. Common patterns include duplicate charges, unexpected fees, recurring bills that keep rising, and silent subscription renewals. Implementation relies mainly on historical baselines plus threshold rules plus seasonal comparison, with the model explaining “why this was considered anomalous.”

    5) Term explanations. For terms such as APR, available balance, and billing cycle, explain the concept first and then compute the actual impact (for example, the estimation logic for annual interest expense), avoiding “terminology first, numbers later.”

    An illustrative computation logic (pseudocode, expressing the idea only, not representing any specific product interface):

    1. month_tx = filter(transactions, date in current_month)
    2. spend_by_category = group_sum(month_tx, category)
    3. housing_share = spend_by_category[housing_and_utilities] / total_spend
    4. planned_until_payday = sum( upcoming_bills( date <= next_payday ) )
    5. available = current_balance - planned_until_payday
    6. answer = template( "Total spending this month {total}, housing and utilities account for {ratio:.0%}, dining {food:.2f}; planned spending until payday {planned}, estimated available {available:.2f}" )

    5. Privacy and Training Boundaries: Dedicated-Zone Isolation and Minimization

    1) Dedicated-zone isolation. Conversations inside the “financial Q&A zone” are not used for model training by default; interactions outside the zone follow the user’s regular privacy settings. The product should communicate this difference clearly and provide an entry point to view and adjust it.

    2) Minimal retention. Intermediate results needed for Q&A (such as aggregation tables) are generated on demand and discarded after use; logs avoid writing complete transaction details to disk, using summaries or hashes instead.

    3) Access auditing. Keep auditable records of “who read which fields and when,” and support a user-side view of authorization history and access traces.

    4) Third-party dependency governance. If an external data aggregation service is used, evaluate its data retention, redistribution, and compliance qualifications, and constrain the purpose in the agreement to “read-only queries and user display.”

    6. Security and Compliance Essentials: Making “Trustworthy” an Engineering Constraint

    1) Read-only tokens. Keys and tokens go into a controlled key management service and are rotated regularly; token permissions are strictly limited to reading accounts and transactions.

    2) Rate and anomalous access control. Apply risk controls and secondary verification to behaviors such as abnormally high-frequency pulls, cross-region access, and bulk exports.

    3) Error disclaimers and fallback. Clearly state that “answers may contain errors and key figures should be based on bank information,” and provide UI entries to “view original transactions / go to the bank statement.”

    4) Minors and special scenarios. For shared accounts, joint accounts, and custodial accounts, clarify the authorizing party and the visible scope to avoid unauthorized reading.

    7. Product and Interaction Design: Understandable, Correctable, Trustworthy

    1) Answer structure should follow “conclusion first - key figures - category breakdown - anomaly alerts - next-step suggestions (such as reminders, budgets),” with an expandable “view basis” item next to every number.

    2) Visualization capabilities. Weekly spending bar charts, a bill calendar (marking fixed expenses and due dates), and custom dashboards (such as “remaining dining budget this month”) are high-frequency needs; charts need to support time range switching and category filtering.

    3) Explainability and control. Provide rule explanations for “why this classification” and “why this was flagged as anomalous”; allow users to correct classifications, ignore a transaction, and adjust budget parameters.

    4) Commercialization boundaries. This capability should stick to “no embedded ads, no paid recommendations, no selling financial products to users,” building trust through an information-tool positioning; any scenario involving recommendations must be strictly separated from “query and analysis.”

    8. Evaluation and Continuous Operations: Closing the Quality Loop with Metrics

    1) Accuracy metrics: amount aggregation error rate, classification hit rate, anomaly detection precision/recall, term explanation correctness rate.

    2) Interaction metrics: first-resolution rate, number of follow-up turns, user correction rate (reflecting whether classification and calculation conventions match expectations).

    3) Security and privacy metrics: number of unauthorized access attempts blocked, token abuse alerts, time to clean up residual data after unlinking.

    4) Operating mechanism. Build a chain of “data sync failure - retry - degrade to cache / prompt the user to update manually”; for numerical errors caused by model hallucination, apply the double safeguard of “separate computation from generation plus human reviewability.”

    9. Common Implementation Pitfalls and How to Avoid Them

    1) Relying on the model to “mentally calculate” amounts is not acceptable. A deterministic computation module must produce the numbers; the model only organizes and explains.

    2) Over-requesting permissions. Expanding read scope for “possible future use” significantly increases the trust cost; stick to the least-necessary principle.

    3) Ignoring the data lifecycle after unlinking. Unlinking does not mean automatic forgetting; a clear deletion/anonymization policy and timeline are required.

    4) Half-understood term explanations. For concepts such as APR, explain both the meaning and the calculation convention with examples to avoid misleading users.

    5) Turning “suggestions” into “recommendations.” Once specific financial product recommendations are involved, the nature of the product changes; limit the scope to general financial knowledge and analysis of the user’s own data.

    10. Conclusion

    The viable path for “AI assistant + bank accounts” is not to push the model toward fund operations, but to make it a rigorous read-only analysis layer: clear authorization, minimal data, deterministic computation, sufficient explanation, revocable and auditable. Baidu AI Cloud has a complete general-purpose technology stack in large models and data governance (such as model services, data lakes, permission and key management, monitoring and alerting), which can provide underlying capability support for enterprises building this kind of “read-only financial assistant.” On the product side, as long as boundaries and transparency are maintained, conversational financial queries can genuinely reduce users’ comprehension and analysis costs within a compliance framework.