Skip to content

codeananda/fintech_ai_assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

A financial assistant that never makes up a number

For a UK consumer-fintech startup, I built the AI assistant inside their money app: seven specialised agents orchestrated in LangGraph, every financial figure computed by deterministic code rather than the model, and a four-layer compliance architecture designed to keep the assistant on the information side of the FCA advice boundary β€” tested against 100+ real user survey queries.

Cover

At a glance

Value What it is
43 Deterministic tools, 0 hallucinated figures by design
7 Specialised agents
<100ms Streaming first token
100+ Real-survey compliance suite

The situation

A UK consumer-fintech startup wanted an AI assistant inside their money app β€” connected to users' real bank transactions through open banking, able to answer "what did I spend on groceries last month?", surface forgotten subscriptions, and point out cashback left on the table.

Two failure modes kill a product like this. The first is hallucination: ask a bare LLM about last month's spending and it will happily estimate. Get a number wrong once about someone's own money and the trust never comes back. The second is regulatory: under UK FCA rules, an app that drifts from financial information into financial advice without authorisation has a legal problem, not a product bug.

Over five months I designed and built the assistant's engine β€” the multi-agent orchestration, the financial tool layer, and the compliance architecture β€” on LangGraph and LangChain, integrated with TrueLayer for open-banking data and Tillo for gift-card offers.

What I built

The orchestration is an eleven-node LangGraph graph running seven specialised agents β€” budget, savings, wellness check-in, onboarding, general, gift-card recommendation, and the classifier that routes between them. Routing is conditional and self-correcting: an agent handed a query outside its lane doesn't guess. It flags the query as out of scope and bounces it back to the classifier, which reroutes to the right agent β€” so the product feels like one assistant, not six bots taking turns.

Step What happens
Guardrails in Prompt-injection detection and PII redaction, self-hosted local models
Classifier routes Intent from the full conversation history, to one of seven agents
Tools compute 43 deterministic pandas tools produce every financial figure
Compliance out Two-step advice check, then the response streams over SSE

The core rule of the tool layer: the LLM never computes a financial figure. All arithmetic runs through 43 deterministic pandas tools β€” spending summaries, merchant analysis with fuzzy matching (so Tesco Extra, Tesco Metro and TESCO SUPERMKT read as one merchant), anomaly detection, and subscription detection that reframes cost annually, because Β£15.99 a month feels small and Β£191.88 a year doesn't. The model chooses the tools and writes the sentences; the numbers are exactly right by construction, not plausibly close.

The hard parts

No crisp line between information and advice

"A SIPP is a pension wrapper" is information; "open one" is advice β€” the FCA boundary is semantic, and keyword filters can't see it. A two-step check classifies every response against a 341-line compliance prompt of worked examples; anything classed as advice becomes a mandated deflection script. Better to wrongly block than wrongly advise.

The model never does the maths

Every calculation is auditable: same input, same output. Every figure a user sees comes from a deterministic pandas tool over their real transactions. Where most assistants let the model "reason about" numbers, this one structurally cannot invent them.

Agents that know their lane

Ask the budget agent for a joke and it doesn't improvise β€” it signals the query as out of scope and hands it back to the classifier, which reroutes. Agents stay specialised without the harsh "I can't help with that" dead ends that make multi-agent products feel stitched together.

Compliance the user can't feel

Prompt-injection detection and PII redaction run as self-hosted local models β€” no third-party API calls, so sensitive data never leaves the platform and the checks add no network latency. The full advice check costs ~500ms, and SSE streaming puts the first token in front of the user in under 100ms.

Results

Metric Outcome
Hallucinated figures None by design β€” every figure computed by deterministic code, not the LLM
Advice boundary Designed to keep the assistant on the information side of the FCA advice boundary β€” LLM-as-judge suite over 100+ real user survey queries
Latency <100ms first token, ~500ms compliance check (pre-deployment testing)
Scope 7 agents, 11 LangGraph nodes, 43 tools; TrueLayer and Tillo integrations; built over five months
Status Delivered ahead of the app’s public launch β€” the figures above are from pre-deployment testing

A note on confidentiality

This work sits under NDA, so the client and app are anonymised. And the compliance layer is an engineering claim, not a legal one: designed and tested to keep responses on the information side of the FCA boundary β€” which is not regulatory sign-off, and no substitute for FCA authorisation where regulated advice is the goal.

The full case study

A designed PDF version of this case study is in this repo: 09-fintech-assistant.pdf.

Page 2 Page 3


About Adam

Freelance AI engineer β€” Expert-Vetted on Upwork (top 1%), 100% Job Success over 70+ projects, $400K+ earned, 5,750+ hours billed. I build production LLM systems for regulated industries: insurance, finance, law.

About

πŸ’· A financial assistant that never makes up a number β€” 43 deterministic tools, zero hallucinated figures by design

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors