kosh

Ask your money a question: why the numbers should come from code

A language model is good at reading a question and poor at sums you can trust. Let the model pick a typed query and let code compute every number in the answer.

Vinayak Kulkarni ·

When you ask a money question such as "Can we afford Europe in May?", two very different jobs are hiding inside it. One is understanding the words: what "Europe" costs, what "May" means, that "we" is the household. The other is arithmetic: adding balances in two currencies, taking off a card bill, counting what is due before a date. A language model is good at the first job. Code is the right tool for the second. The safest money answers split the work exactly there.

This post explains why, walks through one question from words to answer, and shows why a good answer stops at the gap.

What goes wrong when a model does the sums?

A language model writes the next likely words. Most of the time that produces fluent, sensible text. With numbers, "likely" is not the same as "correct". A model can add two figures and write a total that looks right and is off by a few thousand. It can add dollars to rupees without a rate. It can count a card purchase and the card bill as two separate spends. It can count the PPF as if it were in the bank. And if a number is not in front of it, it may fill the gap with a plausible one.

None of these errors announce themselves. They read as confidently as a correct answer. For money, that is the worst kind of mistake: the one you act on.

What should the model do instead?

Give the model a narrow job: turn the question into a typed query from a fixed list. A typed query is a small, structured request that code understands, with no room for invented numbers.

QuestionTyped query
Can we afford Europe in May?afford: ₹4,20,000 by 1 May
Where did our money go last month?where: money out in October, by Category
How much do we have?have: cash, and net worth
What is due before salary?coming: from today to the month end
Compare October with Septembercompare: money out, October and September

If the model gives back anything outside the list, the query is refused. The model never sees the household's tables and never writes a database query of its own. Code checks the request, runs it against the household's own data, and computes every figure.

The eight kinds of question

Almost every household money question falls into one of eight kinds:

  1. Can we afford this by a date?
  2. Where did our money go?
  3. How much do we have?
  4. What is due?
  5. How did two months compare?
  6. How did a number move over several months?
  7. How close is a Goal?
  8. Did we break one of our own Rules?

Eight is enough to be useful and small enough to check. Each kind has its own exact arithmetic in code.

What does code do with an "afford" query?

For "Can we afford ₹4,20,000 by 1 May?", the code follows the same steps every time:

  1. Add the cash in every account on today's date, each in its own currency.
  2. Convert other currencies at a published rate for a stated date.
  3. Take off what the credit cards owe, billed and unbilled.
  4. Take off every payment due before 1 May: EMIs, fees, SIPs.
  5. Leave out any salary that has not actually arrived in recent months.
  6. Show money that could be sold, such as funds, on its own line, not counted.
  7. Show locked money, such as PPF and EPF, on its own line, not counted.
  8. State what is ready and the gap.

A worked answer

Here is the answer for the illustrative Rao family. Every figure is made up.

LineAmount
Cash on 8 Nov₹6,09,859
Card owed−₹30,000
Due before 1 May−₹3,35,000
Salary, not seen since July₹0
Ready for the trip₹2,44,859
Gap₹1,75,141
Sellable, shown, not counted₹6,50,000
Locked (PPF, EPF), not counted₹9,00,000

Check the arithmetic yourself. $1,010 at ₹93.92 is ₹94,859, so cash is ₹5,15,000 + ₹94,859 = ₹6,09,859. The dues are six EMIs of ₹42,500 (₹2,55,000), one school fee of ₹20,000, and six SIPs of ₹10,000 each, together ₹3,35,000. Then ₹6,09,859 − ₹30,000 − ₹3,35,000 = ₹2,44,859, and ₹4,20,000 − ₹2,44,859 = ₹1,75,141.

Every line can be traced to an account, a payment or a rate. Above the answer sits one short line, "Worked it out in 3 steps", that opens to show what happened: the question was understood, the figures were added up, and every number was computed in code.

Why does the answer stop at the gap?

Because what to do about a gap is a choice only the family can make. They could move the trip to June, spend less, use part of the sellable funds, or decide Europe can wait a year. Each choice has trade-offs that no app can see: job security, a parent's health, how the family feels about the funds.

There is also a rule behind it. In India, telling someone which financial strategy to follow is regulated work that needs a SEBI registration. A money tracker that tells you how to close a gap has crossed that line. So the answer shows the figures, the gap, and one closing line: "Estimate, not advice." Then it stops.

Questions about which fund or stock to pick get one short reply: the app shows your numbers and does not pick funds.

On the phone, or on a server?

Reading a question does not need a large model. On newer iPhones, a small model on the phone can turn a question into a typed query, so the question need not leave the device. Spoken questions can be turned into text on the phone too. On other devices a server model does the same narrow job. Either way, the numbers come from the same code.

How Kosh helps

Ask in Kosh works exactly this way. A model only turns the question into typed queries from Kosh's catalog of eight kinds. Kosh's code runs them on the Household's own data, computes every number, and writes every sentence, so an answer cannot hold a number the data does not have. Each answer shows the steps it took and the figures it used, with their dates and rates, and ends with "Estimate, not advice." On iPhone 15 Pro or later, Apple's on-device model reads the question on the phone, and a spoken question becomes text on the phone; other devices use the Kosh server within a monthly limit.

Kosh is in private testing on iPhone and the web, and free during testing. Visit ourkosh.com.

Questions

Quick answers

Can an AI model work out whether we can afford something?

It can read the question well. It should not do the sums. A model predicts likely text, so a figure it writes can look right and still be wrong. Let code compute the numbers from your own data.

What does "Estimate, not advice." mean in Kosh?

It means the answer is arithmetic on the Household's own numbers: the figures used and the gap. It does not say what to do about the gap, and it never names a fund, a stock or a product.

Does a salary count in an affordability answer?

Not in the main answer. A careful answer uses cash on hand minus what is due before the date. A salary that has not arrived in recent months is shown as not counted.

Where does the question go when I ask it?

In Kosh, on iPhone 15 Pro or later, Apple's on-device model reads the question on the phone. On other devices it goes to the Kosh server model, within a monthly limit.

Put the plan on both phones.