CLOSE
megamenu-tech
CLOSE
service-image

Company

CLOSE
CLOSE
CLOSE
Our Works
The Arithmetic Stays in Code

The Arithmetic Stays in Code

A retirement advisor that answers pension questions across four national systems for a third of a cent. The model plans the question and writes the answer. It never does the maths.

The Arithmetic Stays in Code case study hero
Sector

Financial services — pension & retirement funds

Platform

Databricks Agent Framework

Models

Claude Opus 4.1 · Claude Sonnet 4

Pattern

Agentic advisory with deterministic tools

Background

  • A member turns 58 and wants to know when she can access her pension.
  • The answer depends on her balance, contribution history, retirement age and the tax treatment of each withdrawal option.
  • Today that question takes a week — and leaves no record of what she was told.

Challenges

  • 25 minutes on hold, and a callback three days out.
  • Generic brochure advice, not member-specific.
  • No record of what advice was given, or on which rules.
  • Advisors at $150 an hour answering routine questions.
  • Costs that scale linearly with membership.

Solutions

Reckonsys built an agentic pension advisor on the Databricks Agent Framework that:

  • Plans with Claude Opus 4.1 → interprets the question, selects the tools, writes the answer.
  • Computes in code → 18 Unity Catalog functions carry every tax rule, country by country.
  • Checks with a second model → Claude Sonnet 4 validates every answer before the member sees it.
  • Records everything → traces, citations and cost per query, reconstructable months later.
Two clearly separated zones: on the left a faceted terracotta core with glowing orange wires reading a question card, on the right a row of cream clay calculator blocks, joined by one thin glowing line across the gap.

Chapter 01

Two things happen, and they are kept apart

Claude Opus 4.1 reads the member's question, works out what is being asked and which calculations it needs, then writes the answer.

What it does not do is arithmetic. Every tax calculation, withdrawal limit and benefit projection runs as a governed Unity Catalog function — eighteen of them, country by country. The model orchestrates; the code computes.

  1. Member

    Question natural language
  2. Intelligence layer

    Claude Opus 4.1
    • anonymise PII
    • plan the query
    • select the tools
    • results back
  3. Tool layer — code, not memory

    18 Unity Catalog functions
    • tax calculators
    • limits & projections
  4. Answer

    Synthesis
    • cited
    • personalised
    • PII restored
The model never holds a number it did not receive from a function.
Technical detail

A member turns 58 and wants to know when she can access her pension. It is a simple question with an answer that depends on her balance, her contribution history, her retirement age under the relevant national scheme, and the tax treatment of each withdrawal option available to her.

Today that question goes to a helpline. She waits, gets a callback scheduled days out, and eventually reaches an advisor who reads from a brochure that does not account for her situation. A simple question takes a week. Six months later, if a dispute arises, there is no record of what she was told.

At fifty thousand members and ten to twelve dollars per call interaction, the routine questions alone run past six million dollars a year — and advisors charging a hundred and fifty an hour spend their time on queries a calculator could answer.

The load-bearing decision. A model that remembers roughly what the concessional contribution cap was is useless in a regulated advisory setting. Put the rule in a function and the number is either right or it is a bug someone can find.

“A hallucinated withdrawal limit is not a wrong answer. It is a regulatory event.”

A cream clay member profile card with its name area softly blurred, passing through a glowing orange frame into a terracotta core, then coming back out with the name restored.

Privacy

The model works on an anonymised member

Member names are anonymised before anything reaches the model and restored afterwards for the personalised response. The model reasons about a case; it does not need to know whose case it is.

Four cream clay coins, each embossed with the outline of a country — Australia, the United States, the United Kingdom and India — each linked by glowing orange wire to its own small copper calculator block.

Coverage

Four national systems, real rules

Each geography carries its own functions implementing that country's actual regulatory logic — not a generic calculator with a currency symbol swapped.

  1. Australia

    Superannuation

    ATO tax calculator, Age Pension impact, balance projection

  2. United States

    401(k) & Social Security

    IRS 401(k) tax, Social Security benefits, RMD calculator

  3. United Kingdom

    Workplace & State

    HMRC tax calculator, State Pension check, pension drawdown

  4. India

    EPF & NPS

    EPF tax, NPS benefits, EPS pension, corpus projection

Two terracotta clay cores side by side: the first hands a cream answer card to the second, which holds a small glowing magnifier over it, with a copper check mark waiting beside them.

Chapter 02

A second model, reading the first

Before any answer reaches a member, Claude Sonnet 4 reads it against the retrieved data and the regulatory context, checking accuracy and adherence rather than fluency.

It is a different model from the one that wrote the answer, which is the point — a model reviewing its own reasoning tends to agree with itself.

  1. Layer 01

    Intelligence

    Claude Opus 4.1 — privacy protection, query planning, tool orchestration, synthesis

  2. Layer 02

    Tools

    18 country-specific Unity Catalog functions for tax, benefits and projections

  3. Layer 03

    Validation

    Claude Sonnet 4 as judge — accuracy, quality and regulatory adherence

  4. Layer 04

    Governance

    MLflow tracing and Unity Catalog — audit trail, cost tracking, citation registry

Eight pipeline phases across four layers, each traced for duration and cost.
Technical detail

In regulated advice, generating the answer is half the job. Being able to show that it was checked, cited and recorded is the other half.

Validation runs in one of three modes: LLM judge, deterministic rule checks, or a hybrid of both. The choice is a configuration decision, so a fund with a stricter compliance posture can dial toward deterministic checking without a rebuild.

The agentic pipeline is not a single call. It is eight phases, and each is instrumented individually for duration and cost, which is what makes a slow or expensive query diagnosable rather than mysterious.

A clay balance scale with the heavy stack of coins and telephone lowered on one side and a single tiny glowing bead raised on the other.

Economics

A third of a cent, itemised

Cost is tracked per query and split between the main model and the judge, in real time — a number attached to each answer, not an estimate at the end of the month.

$10–12
Human advisory, per call interaction
$0.003
Agentic advisory, per query — model plus judge
24/7
Answered instantly, with no added headcount
Why the cost number matters

Human advisory: $10–12 per call interaction, with advisors at $150/hour and a week's turnaround on a simple question. At 50,000 members, over $6M a year on routine queries.

Agentic advisory: $0.003 per query, main model plus judge, answered instantly and available around the clock. Volume spikes cost what volume costs, with no added headcount.

A three-thousand-fold cost difference does not just save money — it changes which questions are worth answering. At ten dollars a call, a fund discourages members from asking. At a third of a cent, a member can ask six follow-up questions at two in the morning and the economics do not care. That is a different service, not a cheaper one.

Audit

Every interaction, reconstructable

MLflow traces the whole pipeline; Unity Catalog governs the functions, the member profiles and the citation registry. Regulatory references are attached to every response automatically.

The dispute six months later now has the question, the data retrieved, the functions called, the rules cited, the validation verdict and the cost.

Every component, in one place

That is the difference between advice you gave and advice you can prove you gave.

Claude Opus 4.1
The main agent. Interprets the member's question, plans which calculations are required, selects and orchestrates tools, and synthesises the final personalised response.
Claude Sonnet 4
The judge. Independently validates every response for accuracy and regulatory adherence before delivery, in LLM, deterministic or hybrid mode.
Databricks Agent Framework
Orchestrates the eight-phase pipeline, binds the Unity Catalog functions as callable tools, and handles the privacy anonymisation step.
Unity Catalog Functions
Eighteen SQL functions carrying the regulated arithmetic — country-specific tax calculators, benefit checkers and projections. Governed, versioned, and the only place a number is computed.
Unity Catalog
Governance across member profile tables, the functions themselves, and the citation registry. One permission model over data, tools and audit.
MLflow
Experiment tracking and trace logging across all eight phases, with per-phase duration and cost metrics, making the pipeline diagnosable and the audit trail complete.
ai_classify
Topic classification on incoming queries, routing the question toward the right country logic and calculation set.
Databricks Apps
Hosts the advisor interface inside the platform, so the UI shares a governance boundary with the models, functions and member data.
A calm clay scene at night: a cream phone showing a single answered speech bubble with a copper check mark, a small moon above, and a thin glowing orange line leading back to a tidy stack of calculator blocks.

What it changes

Nothing here is specific to pensions. Any regulated advisory domain has the same shape — a question that needs understanding, a calculation that must not be improvised, and a regulator who will ask what rule you applied. Wealth management, insurance comparison, loan eligibility and investment research all fit the pattern by changing only the functions in the tool layer.

Cost to serve

$0.003 a query against $10–12 a call, with routine questions deflected from advisors charging $150 an hour.

Personalisation

Answers computed against the member's own balance, age and contribution history under their own national scheme.

Compliance

Every interaction logged with its citations, validation verdict and the functions it called. Reconstructable months later.

Scale

Instant responses around the clock, with volume spikes absorbed at marginal cost rather than through overtime.

This case study documents a reference architecture for agentic advisory in financial services, implemented on Databricks Agent Framework with Claude Opus 4.1 and Claude Sonnet 4. Figures for cost per query, function count and pipeline structure are drawn from the working implementation. Available for walkthrough on request.

Key takeaways

$0.003
Cost per member query, end to end
18
Unity Catalog functions doing the regulated maths
4
National pension systems, each with authentic rules
2
Claude models — one advises, one judges

View other works

All works

Modal_img.max-3000x1500

Discover Next-Generation AI Solutions for Your Business!

Let's collaborate to turn your business challenges into AI-powered success stories.

Get Started