Architecture
How WealthCues produces an answer
The whole design follows from one rule: the language model is never the source of truth. It sits at the end of the pipeline, explaining figures that deterministic code has already computed.
The pipeline
- 1
Financial data
Accounts, holdings, transactions, assets and liabilities.
- 2
Normalisation
One shape for every source, connected or manual.
- 3
Calculation
Named deterministic functions. The database is the source of truth.
- 4
Retrieval
Only the figures a question actually needs.
- 5
Explanation
Plain language over computed results, with evidence attached.
- 6
Decisions
Goals, scenarios and the things worth reviewing this month.
The layers, in order
Application database
Accounts, institutions, securities, holdings, transactions, assets, liabilities, goals, plans, scenarios and documents — normalised tables, not a bag of JSON. This is the only source of truth.
Calculation layer
Named deterministic functions: calculate_net_worth, calculate_asset_allocation, calculate_savings_rate, calculate_goal_progress, calculate_portfolio_change, calculate_cash_flow, calculate_expense_change. Same semantics in the browser and on the server.
Retrieval layer
Given a question, assemble only the computed figures that question needs. Nothing broader is ever put in front of a model.
Orchestration layer
A fixed registry of typed tools. The model chooses which to call and with what arguments; it cannot reach past them, and it never writes a query.
Language model
Provider-agnostic — OpenAI, Anthropic, Google or a local Ollama model. It explains computed results in plain language. It is not permitted to introduce a figure.
Validated response
The answer is returned with its tool calls and evidence attached, so any number on screen can be traced back to the calculation that produced it.
The 16 tools the assistant may call
This list is the complete surface. There is no general query tool and no escape hatch.
get_net_worth
Current net worth with the asset and liability breakdown.
get_recent_changes
Net-worth change over a window, attributed to its causes.
get_accounts
All accounts with type, balance, source and freshness.
get_holdings
Portfolio positions with value, cost and gain.
get_portfolio_allocation
Allocation by asset class, sector or region.
get_portfolio_summary
Portfolio value, cost, gain, day change and concentration.
get_transactions
Transactions filtered by month, category or search text.
get_spending_by_category
Spending grouped by category for a month.
get_cash_flow
Income, spending, investing and savings rate for a period.
get_goals
Goals with progress, projection and status.
calculate_scenario
Re-projects the plan with changed assumptions.
get_recurring
Detected recurring charges and subscriptions.
get_anomalies
Unusually large charges and possible duplicates.
get_insights
The generated insight set with evidence.
get_emergency_fund
Liquid cash expressed as months of spending.
get_allocation_history
A stored monthly allocation snapshot.
See it working
In the demo, every assistant reply carries a “data lookups” control. Open it to see exactly which tools were called, with which arguments, to produce that answer.
Open WealthCues AI