---
title: "How a calculator result follows you into the chat"
description: "Finish our retirement calculator, say hi on WhatsApp, and Mama already knows where you stand. This is how that hand-off works, and what she does with your results when you arrive."
url: "https://rayson.me/writing/moneymama-funnels/"
category: "Engineering"
author: "Janarayson"
published: 2026-08-16
---

When you finish the [retirement calculator](https://moneymama.co/calculator) on moneymama.co, you've told us quite a lot about yourself. Your age, what you earn, what's in your EPF, what you've saved and how much you'd like to spend each month once you stop working.

In return, you get a number. At 32, earning RM4,500 a month with RM40,000 in EPF, you'd need about RM1.6 million by 60, which means putting away around RM426 a month from now on.

For most of last year, that's where it ended.

The result page offered a waitlist for a webinar, a waitlist for a financial planner and a report by email. Mama was a separate thing on WhatsApp. If you mentioned retirement in the chat, she'd point you to the calculator, but whatever you worked out there never came back with you.

We wanted you to finish the calculator, tap a button and carry on with Mama, who would already know your numbers and could help you work out what to do about them. That might mean tracking your spending with her, or talking to a licensed financial planner.

We built it in February, and passing the numbers along turned out to be the easy part. The more interesting questions were about what happens when you arrive in the chat.

## Mama doesn't know you until you say hi

The calculator was already saving every result, each with a random id. So the "Chat with MoneyMama" button sends you to our registration page with two things in the URL: which calculator you came from, and the id of your result. Internally, we call this kind of hand-off a funnel.

You register with your name, phone number and email, and we keep the funnel and the id next to your phone number.

The catch is that registering doesn't give you a MoneyMama account. Mama lives in WhatsApp, and your account only exists once you've sent her your first message. Until then, your result sits in our database with nobody attached to it.

So we wait for you to say hi.

When your first message arrives, we match your phone number to your registration, create your account and link the result to it. That happens in the background, so it doesn't hold up Mama's reply.

<figure class="fig">
  <HandOff />
  <figcaption>How a result gets from the website to Mama.</figcaption>
</figure>

From then on, your result is part of what Mama knows about you, but it doesn't go into every prompt.

Mama's prompts are dynamic. Each message goes through a classifier first, which works out what you're trying to do, and we build her prompt for that job. Ask for advice and she gets the most: your recent conversation, summaries of older ones, what she's learnt about you and our knowledge base. A general chat gets a little less. Something simple, like listing your expenses, gets the last few messages and not much else.

Your calculator result goes into almost all of them, even the smallest. The two exceptions are recording an expense and setting a spending cap. When you record an expense, Mama sees only your latest message, because earlier messages full of other expenses could confuse her into recording one of them again. Setting a cap gets the last couple of messages, in case she needs to ask you a follow-up question.

Wherever it goes, the result comes with one instruction: don't repeat all the numbers back unless you ask, and use them naturally in the conversation.

## Saying hello doesn't need an AI

The first version worked, but it felt generic.

You'd get Mama's standard welcome, with a picture, a list of everything she can do and a "Visit MoneyMama" button, followed by your results, followed by a reply from the AI to the "Hi Mama!" you'd just sent. Three messages landed together, and only one of them had anything to do with why you were there.

In March, we took the AI out of the first hello.

We already knew why you were there and what your numbers were, so there was nothing for a model to work out, and skipping it made the welcome faster. Not everything needs an LLM.

Now the first few messages are a script. A short welcome says Mama has your results, the results arrive a second and a half later, and a second after that comes a message that depends on your numbers.

<Screens
  screens={[
    { src: welcomeShortfall, alt: "Mockup: Mama's retirement results for a 32-year-old with a shortfall of RM255,301, then a message saying they need to save RM426 a month, with Save more, Better returns and Talk to a planner buttons" },
    { src: welcomeOnTrack, alt: "Mockup: the results for a 29-year-old who is on track, then a message saying they're on track to retire at 60, with Talk to a planner and Track expenses buttons" },
  ]}
  caption="The scripted welcome, for a shortfall and for someone on track. Mockups with made-up numbers."
/>

If you have a shortfall, Mama tells you how much you'd need to save each month and gives you three options: save more, look for better returns, or talk to a planner. If you're already on track, she says so and offers a planner or help tracking your expenses. Apart from a "Maybe later", every button leads to one of those two places.

The planner was the goal all along. Tapping "Talk to a planner" creates a lead in our back office and gives you a link to book a session with a licensed financial planner. A model also writes a few talking points from your results, so the planner knows where you stand before getting in touch.

Not everyone taps the buttons, of course. If you type a reply instead, the script steps aside and Mama takes over, with a note about what she'd just offered you so her answer still makes sense.

The script itself is a small config file of messages, buttons and branches. When the next calculator came along, it got a script of its own without us having to build the logic again.

## Bringing the calculator into WhatsApp

A lot of people talk to Mama without ever visiting the website. Until March, if one of them typed /retirement, Mama sent them off to the website to fill in the calculator there.

Now it opens right in the chat, as a WhatsApp Flow.

Flows are a pretty cool feature. A Flow is a proper form that opens inside WhatsApp, as a sheet over the chat, with text fields, radio buttons and a button at the bottom to move on. You describe the screens in JSON, and WhatsApp draws them natively.

I think they make a chatbot more intuitive in some ways. Some things are easier to fill in than to say, and a form shows you exactly what Mama needs. We'd already used one for feedback. Typing /feedback opens a short form about your experience, the reminders, what we could do better and whether you'd recommend Mama, and the answers go straight to the team.

The calculator needs nine answers, and the Flow collects them over two screens.

<Screens
  screens={[
    { src: flowAboutYou, alt: "Mockup: the first Flow screen, Tell us about yourself, with gender, current age, retirement age and expected lifespan, and a Next button" },
    { src: flowFinances, alt: "Mockup: the second Flow screen, Understanding your finance, with gross income, EPF balance, non-EPF savings, return rate and retirement expenses, and a Submit button" },
  ]}
  caption="The retirement calculator as a WhatsApp Flow. A mockup built from the Flow's own definition."
/>

When you submit, Mama works out your result, saves it next to the ones from the website, shows it to you and starts the same script. Whichever way you come in, you end up in the same place.

## More calculators, one table

First Million was the next calculator to follow you into the chat, and it raised a question about storage.

The retirement calculator had its own table, with a column for every input and every result. Doing that again for each new calculator would mean a migration every time, plus code to fetch and format each one. So First Million went into a new, general table instead, where each calculator's inputs and results sit together in a single JSON column. All a new calculator needs now is a formatter that turns its JSON into something Mama can read.

It's faster to add funnels that way. The trade-off is that the database no longer checks the shape of the data, so a misspelt key just comes back empty.

## Where it's ended up

The retirement calculator was the first funnel, and it isn't the only one any more. There are seven now, most of them for the GOOD Plan, our RM399 plan for getting out of credit card debt.

For most of last year, a calculator result stayed on the website. Now it's where the conversation starts. You tap a button, say hi, and Mama already knows where you stand.
