Designing a Read-Only AI Q&A System for Personal Finance: Architecture and Best Practices

    Personal finance data is typically scattered across banks, credit cards, and payment accounts, making it hard for users to get unified answers to questions like "Where did my money go this month?" This article walks through the design of a read-only AI question-answering system for personal finance, covering capability boundaries, a four-layer architecture, least-privilege account access, privacy isolation, anomaly detection, financial concept explanation, accuracy control, and a pre-launch checklist. The core principle: computation belongs to deterministic code, while the language model handles only intent understanding and expression.

    1. Background: Fragmented Account Data and the Need for Unified Querying

    A user’s income and spending information is usually spread across multiple banks, credit cards, and payment accounts. Each institution has its own app interface, statement structure, and categorization conventions. To answer questions like “Where did my money go this month?” or “How much can I safely spend before my next paycheck?”, users typically have to log in to each app, export statements manually, and consolidate the data themselves.

    This scenario creates a new class of requirements: letting users ask questions in natural language while the system aggregates data across accounts and returns structured answers. From an engineering perspective, the real difficulty is not language understanding itself, but three things: whether the data can be reliably retrieved, whether the scope of access is controlled, and whether the numbers in the answers can withstand verification.

    2. Capability Boundaries: Read-Only Queries vs. Write Operations

    The first design decision is defining the capability boundary. The positioning of “read the numbers, never move the money” implies the following characteristics:

    • Read-only access: The system can retrieve account information but cannot initiate transfers, modify account settings, or execute investment transactions.
    • Analysis, not decisions: The system outputs summaries, categorizations, trends, and anomaly alerts. Users decide for themselves whether to take action.
    • No marketing referrals: Answers contain no ads or paid recommendations, avoiding any conflict between system output and commercial interests.

    The clearer the boundary and the smaller the permissions, the lower the cost of security and compliance review. If the system supported write operations, it would require additional mechanisms such as secondary confirmation, transaction limits, and audit logging—significantly increasing complexity.

    3. Overall Architecture

    A typical personal finance Q&A system can be divided into four layers:

    1. Data access layer: Retrieves authorized data through compliant account aggregation services or open banking APIs.
    2. Data normalization layer: Unifies transaction fields from different institutions into an internal model, including amount, currency, timestamp, merchant, raw description, and category labels.
    3. Computation and analysis layer: Deterministic programs perform summation, grouping, period-over-period comparisons, and anomaly detection.
    4. Q&A and presentation layer: The language model understands questions, selects computation tasks, and composes natural-language answers, while attaching data sources and time ranges.

    The key principle is “computation belongs to code, explanation belongs to the model.” Amount totals, interest estimates, and similar results must be produced by testable code. The language model is responsible only for intent recognition and expression, which reduces the risk of numerical errors.

    The workflow looks like this:

    1. User question
    2. → Intent recognition (monthly spending / available balance / anomaly query / concept explanation)
    3. → Query parameter generation (account scope, time window, categorization rules)
    4. → Programmatic computation (deterministic functions)
    5. → Result validation (totals reconciled against line items)
    6. → Natural language generation (with data sources and methodology notes)

    4. Account Access and the Principle of Least Privilege

    Account access is the most sensitive part of the system. The following practices are recommended:

    • Never handle credentials: Users complete login and authentication on the institution’s own page; the application never touches the user’s banking password.
    • Token-based authorization: The application receives scoped, revocable access tokens rather than long-lived account credentials.
    • Field minimization: Request only the data required for the functionality. For example, analyzing spending structure does not require full account numbers—the last four digits are enough to distinguish accounts.
    • Time window limits: Restrict transaction history to the period actually needed. Data outside the window should not be read or retained.
    • Immediate revocation: When a user unlinks an account, the application must stop access immediately and delete or anonymize cached data in line with compliance requirements.

    An example authorization scope configuration:

    1. connection_scope:
    2. accounts:
    3. fields: [institution_name, account_name, account_type, last4, balance, credit_limit]
    4. transactions:
    5. fields: [date, amount, currency, merchant, description, category]
    6. max_history_days: 730
    7. permissions: [read_only]

    5. Privacy Isolation and Data Usage Policies

    Privacy design must answer three questions: what the data is used for, how long it is stored, and who controls it.

    First, define separate data usage domains. Conversations and account data generated within the dedicated financial analysis area should be stored separately from general conversation data, with different retention policies. Second, explicitly state that the data is not used for model training, and write this commitment into a user-readable privacy notice. Third, provide users with entry points to view, export, and delete their data at any time.

    In engineering terms, request tags can distinguish data domains, and isolation policies should be enforced at both the storage and logging layers. Logs must never contain full transaction descriptions, balances, or account numbers—only request identifiers and masked statistical information.

    6. Anomaly Detection Approaches

    Users typically care about three types of anomalies: duplicate charges, unexpected fees, and steadily rising recurring bills.

    6.1 Duplicate Charge Detection

    The detection rule generally combines three conditions: same merchant, same amount, and a time interval within a threshold. The threshold should be tuned by scenario. For example, two identical charges on the same day are far more noteworthy than two charges a month apart.

    1. def detect_duplicates(transactions, window_hours=24):
    2. flagged = []
    3. sorted_tx = sorted(transactions, key=lambda t: t.timestamp)
    4. for i, tx in enumerate(sorted_tx):
    5. for other in sorted_tx[i + 1:]:
    6. if (other.timestamp - tx.timestamp).total_seconds() > window_hours * 3600:
    7. break
    8. if other.merchant == tx.merchant and other.amount == tx.amount:
    9. flagged.append((tx.id, other.id))
    10. return flagged

    6.2 Recurring Bill Increases

    For recurring charges from the same merchant, compare the amount change rate period over period. If the increase exceeds a defined threshold, prompt the user to verify. The threshold can be a fixed percentage or dynamically computed based on the historical standard deviation of that merchant’s charges.

    6.3 How to Phrase Results

    Anomaly alerts should use hedged language such as “possibly” or “recommend verifying,” rather than asserting outright errors or fraud. False positives erode user trust, so the basis for each alert should be shown alongside it—for example, “same merchant, same amount, 12 hours apart.”

    7. Explaining and Computing Financial Concepts

    For non-expert users, the system should explain terminology before presenting calculation results. Take annual percentage rate as an example: interest expense is typically estimated using daily accrual:

    Daily rate = Annual rate / 365
    Interest for the period ≈ Average daily balance × Daily rate × Number of accrual days

    The system should display the assumptions used, such as the number of accrual days, whether compounding is included, and how the balance is derived. If the institution’s interest rules are more complex, the result should be labeled as an estimate, with a recommendation to refer to the official statement.

    8. Accuracy and Error Control

    Q&A built on external data can produce errors from sources including data latency, misclassification, duplicate records, and field differences between institutions. Common controls include:

    1. Timestamp annotation: Every answer notes the data cutoff time so users understand its freshness.
    2. Summary reconciliation: The sum of category line items must equal the total. If they don’t match, the system refuses to output and logs the error.
    3. Source traceability: Key figures can be expanded to the underlying transaction list.
    4. Uncertainty disclosure: For unrecognizable merchants or missing transactions, clearly state the impact on the result.
    5. Manual verification entry point: In scenarios involving important decisions, remind users to rely on bank statements or official bills.

    9. Pre-Launch Checklist

    Before going live, verify each of the following:

    • Are permissions strictly read-only, with no write interfaces exposed?
    • Is only the data necessary to answer questions being collected?
    • Have credentials never entered the application server’s storage or logs?
    • After authorization is revoked, are cached and backup data cleared within the compliance window?
    • Are analytical results produced by deterministic code with unit test coverage?
    • Do answers include the data time range and methodology notes?
    • Is the privacy notice consistent with the actual data flows?

    10. Conclusion

    The value of a personal finance Q&A system lies in reducing the cost of accessing information, while its trustworthiness depends on permission control, data isolation, and verifiable computation. Engineering practice should adhere to three principles: a strict read-only boundary, minimal data collection, and separation of computation from expression—while keeping traceable evidence in every answer. This design satisfies users’ query needs while keeping security and accuracy risks within manageable bounds.