Building a Read-Only AI Assistant for Personal Finance: A Technical Practice
This article walks through a technical blueprint for connecting an AI assistant to personal financial data in read-only mode. It covers a four-layer architecture that physically separates reading from writing, least-privilege authorization with short-lived revocable tokens, expense analysis built on normalization and deterministic aggregation, rule-based detection of duplicate charges and subscription price hikes, and visualization that stays tied to the underlying query. It also explains how to handle term definitions before calculations, and how to govern hallucinations through evidence chains, drill-down to transaction details, and bank-record verification. Readers will learn how to keep compliance and user experience in balance while avoiding any executable path to fund transfers.
1. Introduction: From “Being Able to Chat” to “Being Able to Read Data”
Once large language models entered the personal finance space, the core user demand shifted from “explain a financial concept” to “give me a conclusion based on my actual data.” The source material describes a product form in which an intelligent assistant gradually rolled out personal finance capabilities to a subset of subscription users: users ask questions in natural language, link a bank card account to check balances and transaction records, get explanations for unfamiliar terms, and generate spending charts, a bill-due calendar, and custom dashboards. Once the specific product attributes are stripped away, this is in fact a general technical pattern of “read-only data access + natural language querying + structured analysis output.”
The key constraints of this pattern are clear: the assistant holds read-only permissions and cannot move funds, manage accounts, or invest on the user’s behalf; the finance section shows no ads and pushes no sponsored content; model output may be wrong, users can request a list of transaction details, and important amounts must be verified against the bank. The discussion below covers five layers: architecture, permissions, analysis, explainability, and engineering governance.
2. Overall Architecture: Four Decoupled Layers That Physically Separate Reading from Writing
A sound implementation is usually divided into four layers:
- Access layer: handles account linking and authorization, and issues short-lived read-only access credentials.
- Data layer: standardizes raw data such as balances, transaction records, bills, and interest rates into a unified model.
- Analysis layer: performs classification and statistics, anomaly detection, metric calculation, and chart data generation.
- Interaction layer: handles intent recognition, term explanation, result presentation, and drill-down into details.
The core design principle is “separation of reading and writing.” Credentials are scoped to read-only at issuance, the analysis layer always receives a copy of the data or an aggregated result, and the interaction layer has no ability to call any write interface. As a result, even if a prompt is manipulated, no executable path for fund operations exists in the system.
User question↓Intent recognition (query / explanation / visualization / anomaly triage)↓Read-only data service (balance, transactions, bills, rates)↓Analysis engine (classification, aggregation, rule detection)↓Result orchestration (conclusion + supporting details + confidence notice)
3. Permissions and Authorization: Least Privilege Is the First Gate of the Security Boundary
Read-only is not a slogan; it has to be implemented with concrete mechanisms:
- Minimize credential scope: authorization covers query operations only, and no transfer, payment, auto-debit, or investment order permissions are issued.
- Expiration and revocation: credentials expire on a short cycle, users can unlink at any time, and cached data is invalidated in sync after unlinking.
- Transparent linking: clearly state which data will be read, what it is used for, and how long it is retained.
- No ads and no referral fees: analysis conclusions carry no commercial ranking, avoiding conflicts of interest such as “recommend this card / this loan.”
A sample permission declaration (pseudocode):
scope = ["balance:read", "transactions:read", "bills:read"]assert "transfer:write" not in scopetoken = issue_token(scope=scope, ttl_minutes=30, revocable=True)
Engineering practice should also include a capability allowlist: even if the model generates an intent to make an unauthorized call, the gateway rejects it directly and returns a readable rejection reason, rather than leaving the risk to prompt constraints.
4. Expense Analysis: From Transaction Records to Structured Statistics
The most typical user question is “where did my money go this month.” The implementation path has three steps:
Step one, normalization. Field naming, time formats, amount signs, and currency precision differ widely across institutions, so data must be unified into standard fields such as account, time, amount, merchant, channel, and raw description. Storing amounts as integers in the smallest currency unit is recommended to avoid floating-point errors.
Step two, classification. Start with rules (merchant keywords, channel type) as a baseline, then use the model as a fallback for categorization, outputting categories such as “dining / transport / housing / subscriptions / fees” while retaining the raw description for review.
Step three, aggregation and comparison. Summarize by month and by category, compare with the previous period, and point out the categories with the largest changes.
SELECT category, SUM(amount) AS totalFROM transactions_normalizedWHERE account_id = :idAND occurred_at >= :month_startGROUP BY categoryORDER BY total DESC;
5. Anomalous Bill Detection: Using a Rule Engine to Cover for Model Unreliability
Questions like “are there duplicate charges, unexplained fees, or subscriptions that quietly went up in price” are essentially rule-based detection rather than a generation task. Practical rules include: the same merchant and the same amount appearing repeatedly within a short window; fee-type entries appearing on their own with no corresponding transaction; a recurring subscription amount rising by a certain percentage above its historical baseline; and a small charge suddenly appearing on a long-inactive account.
Every alert should carry an evidence chain: the matched transaction ID, time, amount, and historical baseline. This lets users drill down and verify with one click instead of passively accepting a conclusion. Rule hits take priority over model judgment, and the model is only responsible for explanation and wording.
6. Term Explanation and Macro Judgment: Define First, Then Calculate
For a question like “what is the annual percentage rate (APR), and how much interest was generated this year,” the correct order is to first explain the conceptual boundary (APR reflects the annualized cost or return of funds and is not the same as the amount actually incurred), and then sum interest-type entries based on transaction statistics. Macro questions such as “did spending exceed income” require a clear statistical scope: whether income includes refunds, whether spending includes outstanding credit card balances, and which period cross-month transactions belong to. Once the scope is written clearly, the conclusion is reproducible.
7. Visualization and Dashboards: Generated Artifacts Must Be Adjustable and Recomputable
Weekly spending charts, a bill-due calendar, and custom dashboards are all essentially “query result + view description.” It is advisable to explicitly expose chart parameters (time window, grouping dimension, aggregation method) for users to modify, and any adjustment should go through the query pipeline again, ensuring the chart and the numbers come from the same source and avoiding a situation where “the chart says one thing and the details say another.”
8. Hallucination Governance and Human Verification: Explainability Over Confidence
It must be acknowledged that the model will miscalculate and misclassify. Practical guardrails include: forcing conclusions to bind to data sources and statistical ranges; attaching an entry point to the detail list for amount-related answers; giving a “please refer to your bank records” notice for key figures; marking low-confidence classifications as pending confirmation; and retaining complete audit logs that record the data scope and rule version used in each question-and-answer session.
9. Conclusion
The difficulty of putting AI into practice in the personal finance scenario lies not in “whether it can chat” but in “whether you dare to let it read data.” Only by limiting permissions to read-only, completely removing the path to fund operations, handing statistics to deterministic computation, placing the model in the role of explanation and orchestration, and using detail drill-down and bank verification as the final fallback can a balance be struck between compliance and user experience. This approach also applies to read-only data intelligence scenarios such as internal expense analysis and bill auditing, and data retention and pipeline observability can be built on general cloud capabilities such as object storage, message queues, logging services, and monitoring alerts.
