Building a Read-Only Personal Finance Analysis Assistant: Architecture and Implementation Notes

    This article outlines a practical technical approach to building a read-only personal finance analysis assistant powered by large language models. It covers a six-layer system architecture, read-only authorization and privacy boundaries, transaction data modeling, natural language query compilation, anomaly detection rules, and audit mechanisms. The core principle is to keep analysis executable, conclusions traceable, and permissions non-escalatable, ensuring the assistant explains financial data without ever being able to move funds.

    General-purpose large language model assistants can play the role of “natural language interface + analysis orchestration + result explanation” in personal finance analysis scenarios. However, what truly determines system usability is the read-only permission boundary, transaction data modeling, query plan generation, anomaly detection rules, and verifiability mechanisms. Below is a breakdown of a practical solution from a technical implementation perspective.

    I. Overall Architecture: From Q&A Entry to a Verifiable Analysis Pipeline

    A personal finance analysis assistant should not be designed as a black box that directly answers with monetary figures. Instead, it should be split into six layers: the access layer handles user authorization and account binding; the permission layer maintains read-only tokens and access scopes; the data layer normalizes and deduplicates transaction data; the analysis layer compiles natural language questions into executable query plans; the interaction layer outputs explanations, charts, and line-item references; and the audit layer records access behavior and supports user-initiated authorization revocation.

    The core principle of this pipeline is: “analysis must be executable, conclusions must be traceable, and permissions must not be overstepped.” The assistant can only read data from authorized accounts and cannot initiate transfers, debits, investments, or credit operations. Even when the LLM generates explanatory text, all final monetary figures should come from controlled query results rather than free-form model inference.

    II. Read-Only Authorization and Privacy Boundaries

    Account binding should adopt least-privilege authorization: users only grant read access to transaction records, balances, and billing information; the system does not request fund transfer capabilities. Authorization tokens should be stored encrypted, with support for per-account revocation, expiration, and anomalous access alerts. Encryption should be applied during transmission and storage, and logs should avoid recording full account numbers, sensitive merchant information, or transaction remarks.

    Regarding responsibility boundaries, the assistant should explicitly refrain from providing investment advice or making fund management decisions on the user’s behalf. For questions like “Should I buy this product?”, the system should respond with risk notices or term explanations rather than recommendations. Read-only does not mean low risk; the system still needs data minimization, access isolation, and audit trails to prevent analysis results from being accessed beyond authorization.

    III. Transaction Data Modeling and Cleaning

    Transaction data needs to be normalized into an aggregate-friendly model that includes at least: account identifier, transaction timestamp, amount, currency, merchant, category, transfer flag, refund flag, and billing cycle. A sample structure is as follows:

    1. {
    2. "account_id": "acct_***",
    3. "transactions": [
    4. {
    5. "txn_id": "t_***",
    6. "posted_at": "2025-11-01T10:00:00+08:00",
    7. "amount": -12.30,
    8. "currency": "CNY",
    9. "merchant": "***",
    10. "category": "Dining",
    11. "is_transfer": false,
    12. "is_refund": false
    13. }
    14. ]
    15. }

    The cleaning phase must handle timezone normalization, refund reversals, exclusion of inter-account transfers, deduplication of duplicate records, and merchant name normalization. Without these steps, a “monthly spending” query might miscount transfers as consumption or double-count refunds. The category system can adopt a “base categories + user-defined tags” structure while retaining original merchant information for traceability.

    IV. From Natural Language Queries to Analysis Plans

    Natural language questions should first be parsed into structured intent, then compiled into a query plan. For example, “Where did my money go this month?” can be parsed as: time range = this month, metric = expense summary, dimension = category, filter = exclude transfers and refunds. Pseudocode:

    1. intent = parse(query)
    2. plan = compile(intent, authorized_schema)
    3. result = execute(plan, authorized_accounts, read_only=true)
    4. answer = explain(result, evidence_txn_ids)

    Query plans should be restricted to the user’s authorized accounts and force read-only execution. For questions like “Did my spending exceed my income?” or “How much interest did I pay at this annual rate?”, the system first explains the terminology, then performs statistics based on transaction details. The response should include a methodology note, such as whether refunds are included, whether transfers are excluded, and how the time range is defined.

    V. Spending Analysis and Anomalous Bill Tracking

    Spending analysis can provide category summaries, income-expense comparisons, recurring bill recognition, and budget variance alerts. Anomaly detection can combine rules with statistics: duplicate charges can be identified by the same merchant, same amount, appearing multiple times within a short window; unexpected fees can be flagged by sudden spikes in low-frequency categories; bill increases can be detected by periodic amount changes for the same subscription merchant. Output should include the triggered rule and associated transaction details rather than conclusions alone.

    Pattern Detection Logic Example
    Duplicate charge Same merchant + same amount + multiple occurrences in a short period An online service charging twice in one day
    Unexpected fee Sudden spike in a low-frequency category A small monthly category jumping 10x overnight
    Subscription price increase Periodic amount change for the same subscription merchant A streaming service raising its monthly fee

    VI. Visualization, Explainability, and Engineering Practices

    Weekly spending charts, upcoming bill calendars, and custom dashboards should be driven by query results, with user controls for adjusting time ranges and classification criteria. All charts should support drill-down to transaction-level detail. Since analysis results can contain errors, the system needs confidence indicators, methodology notes, and reminders to “cross-check with the original bank statement.” Evaluation metrics may include intent parsing accuracy, aggregation result consistency rate, anomaly rule hit precision, response latency, and user correction rate.

    From an engineering standpoint, it is recommended to implement query rate limiting, cache invalidation controls, log desensitization, monitoring alerts, and canary releases. When deploying on a cloud platform, general-purpose object storage, log services, and monitoring alerting can be used to build the audit and observability foundation, but the same least-privilege and data desensitization principles should apply. The ultimate goal is not to have the assistant “manage money for the user,” but to help users understand their financial situation more clearly and safely.