Skip to content
Sarvesh's AI Newsletter

I Built a Financial AI That Refuses to Guess

Why I Gave an LLM 76 Deterministic Financial Calculators Instead of Letting It Do Math

Sarvesh Talele

· 6 min read

Share:

Artificial intelligence is changing how people interact with information. Today, anyone can open a chat window and ask questions that once required hours of research, professional consultation, or specialised software.

Yet there is one area where I believe we are moving too quickly: personal finance.

Ask an AI assistant how much money you need to retire, whether you can afford a home loan, how large your emergency fund should be, or whether your investment portfolio is properly diversified. In many cases, it will confidently produce an answer. The language will be polished. The reasoning will sound convincing. The explanation may even appear sophisticated.

The difficulty is that confidence does not imply accuracy.

Large language models are extraordinary at understanding context, explaining concepts, and translating complexity into human language. They are not deterministic calculators. They do not inherently understand financial mathematics. They generate the next most probable token in a sequence of text.

That is an important distinction. Retirement projections are not creative writing. An EMI schedule isn’t narrative. Portfolio risk calculations are not communicative jobs. These are mathematical issues that need strict repeatability, auditability, and accuracy.

The realisation led me to a simple question:

What if AI handled the conversation, but mathematics handled the calculations?

That question eventually became Personal Finance MCP — Click here

Website page

Website page

The Problem with Modern Financial AI

These days, the majority of AI-powered financial assistants run on a single engine. A user poses a query. The request is understood by the language model. Calculations are done by the language model. Suggestions are produced by the language model. Both arithmetic and logic are handled by the same mechanism. This seemed effective at first. In reality, however, it poses a considerable risk.

Consider a simple question:

“I’m 30 years old, earn ₹1 lakh per month, spend ₹55,000, have a ₹20,000 EMI, and want to retire at 60. Am I on track?”

To answer correctly, a system must perform multiple independent analyses:

  • Cash flow assessment
  • Debt evaluation
  • Emergency fund calculation
  • Retirement corpus projection
  • Inflation-adjusted future expenses
  • SIP requirements
  • Risk profiling

These aren’t language issues. These are mathematical workflows. A linguistic model may approximate them, but that is insufficient when someone’s financial future is on the line. The answer didn’t involve removing AI from the process. The solution was to redefine its function.

Separating Stories from Spreadsheets

Morgan Housel’s The Psychology of Money is one of the most significant financial books I’ve ever read. A constant theme throughout the book is that money is ultimately a human problem rather than a quantitative one. People do not base their financial decisions exclusively on spreadsheets. They make decisions based on:

  • Fear
  • Ambition
  • Experience
  • Family history
  • Risk tolerance
  • Personal goals

The figures are important. However, the story behind the figures is also important. This discovery helped determine the system’s architecture. The AI should be able to understand the story. Calculators should do the math. The language model should be used to determine intent, context, and objectives. The deterministic financial engine should produce all numerical outputs. This distinction became the project’s core design principle.

Introducing Personal Finance MCP

Illustration

Personal Finance MCP is an open-source financial intelligence platform built around a simple idea:

Every financial calculation should be deterministic.

The system exposes 76 financial calculators through the Model Context Protocol (MCP), allowing AI assistants to access them as tools.

Instead of asking users to select calculators manually, the platform allows them to communicate naturally.

A user might say:

“I want to retire at 60.”

The AI interprets the request. The MCP layer sends the request to the proper tools. Calculators perform the computations. The AI then describes the findings in clear words. The user engages in a conversation. A deterministic financial engine lies beneath such discourse.

Designing a Financial Operating System

From the beginning, I wanted the project to feel less like a collection of calculators and more like a financial operating system.

The platform currently includes 76 tools across 13 major domains.

These include:

Time Value of Money

  • Future Value
  • Present Value
  • Annuities
  • Inflation-adjusted returns
  • Rule of 72
  • Effective annual rate

Loans and Debt

  • EMI calculations
  • Amortization schedules
  • Loan comparisons
  • Debt consolidation analysis
  • Prepayment impact

Investment Planning

  • SIP calculations
  • Lumpsum projections
  • Step-up SIPs
  • SWP planning
  • Goal-based investing

Portfolio Analytics

  • Sharpe Ratio
  • Sortino Ratio
  • CAPM
  • Beta
  • Alpha
  • Asset allocation analysis

Retirement Planning

  • Retirement corpus estimation
  • Retirement gap analysis
  • SIP requirements
  • Withdrawal planning

Indian Savings Instruments

  • PPF
  • EPF
  • NSC
  • SSY
  • SCSS
  • KVP

Market Data

  • Mutual fund NAVs
  • Foreign exchange rates
  • Equity prices

Additional areas include bonds, derivatives, risk profiling, and financial planning. Each tool is deterministic. The same inputs consistently produce the same outputs.

The Meta Advisor

Calculators are relatively simple. The bigger challenge was deciding which calculators to use and in what order. People rarely systematically ask financial questions. They share stories. Someone may state their salary, expenses, goals, family circumstances, debt commitments, and retirement plans all in the same paragraph. The system must translate the narrative into a disciplined procedure. To solve this, I created what I call a Meta Advisor. The Meta Advisor serves as an orchestration layer. It assesses the user’s circumstances and determines:

  • Which tools are required
  • Which calculations should occur first
  • How outputs should feed into subsequent calculations
  • What recommendations should be prioritised

For example, retirement planning is not performed in isolation.

Before recommending investments, the system evaluates:

  1. Cash flow
  2. Emergency reserves
  3. Debt burden
  4. Risk capacity
  5. Retirement gap
  6. Investment strategy

The output is a coherent financial plan rather than a collection of disconnected calculations.

Why Determinism Matters

One principle guided every design decision:

Financial systems should be reproducible.

If two users provide identical inputs, they should receive identical results.

If someone asks the same question tomorrow, the answer should not change because the model generated a slightly different sequence of tokens.

Determinism provides:

Auditability: Every number can be traced back to a formula.

Transparency: Users can understand how results were generated.

Trust: Recommendations become explainable.

Testing: Systems can be validated automatically.

Reliability: Outputs remain consistent over time.

These properties are difficult to achieve with pure language-model-based systems.

They become natural when mathematics is treated as a first-class component.

Bringing Live Markets Into the System

Financial planning cannot exist in isolation from market reality.

To make recommendations more relevant, I integrated real-time market intelligence.

The platform retrieves:

  • Mutual fund NAVs
  • Equity market data
  • Foreign exchange rates

These integrations don’t require API keys, in contrast to many financial products. This ensures that the platform is accessible, easy to deploy, and completely open source. The result is a system that integrates deterministic calculations with real-world financial data.

Building for Developers

Another purpose was to increase accessibility. Many financial tools are kept behind proprietary systems. I wanted this system to be modular.

The MCP connector can be used with:

  • Claude Desktop
  • Claude Code
  • Cursor
  • VS Code
  • Any MCP-compatible client

Developers can integrate financial intelligence into their workflows with a single connector URL.

The same backend powers:

  • The MCP server
  • The web application
  • The public API
  • The test suite

A single codebase. There are multiple interfaces. Consistent behaviour.

Engineering for Trust

Trust cannot be added later.

It must be designed into the architecture.

The platform includes:

  • Input validation
  • Security headers
  • Request limits
  • Parameter constraints
  • Automated testing
  • Deterministic outputs

Today, the project includes more than 129 automated tests. Each calculator is checked against known results. All key workflows are tested.

The goal is simple:

A financial advise should be as reliable as the formulas that created it.

What I Learned

Building this project changed how I think about AI and finance. I learned that AI is most powerful when combined with systems that provide guarantees. I discovered that transparency often matters more than complexity. I found out that users trust systems that display their processes. Most importantly, I realised that the future of AI is not likely to be one massive model doing everything. The future is orchestration. Models reasoning over specialised tools. Language models managing context. Deterministic systems ensure precision. Each component does what it does best.

The Bigger Vision

Personal Finance MCP began as an experiment. Could an AI assistant offer financial guidance without using probabilistic math? The answer turned out to be yes. However, the bigger lesson goes beyond finance.

Many domains share the same challenge:

  • Healthcare
  • Law
  • Engineering
  • Science
  • Accounting

In all cases, language models succeed at communicating. In each situation, dedicated systems ensure accuracy. The most reliable AI systems of the future will probably combine both. This project is a small demonstration of that idea in action. The AI understands your story. Mathematics shows the truth. Everything else is coordinated.

GitHub: https://github.com/sarveshtalele/personal-finance-mcp

Live Demo: https://sarveshtalele-personal-finance-mcp.hf.space

MCP Connector: https://sarveshtalele-personal-finance-mcp.hf.space/mcp

PyPI: pip install personal-finance-mcp

Join the Discussion

Do you think financial AI should be allowed to generate financial calculations directly, or should critical calculations always be delegated to deterministic tools?

I’m curious how engineers, architects, fintech builders, and financial professionals think about this trade-off.

Share your perspective below. Every meaningful discussion helps shape the next generation of trustworthy AI systems.


Originally published on Medium.

Share:

More articles

Back to Sarvesh's AI Newsletter
Search everything on the site