Home

NormaEngineering

Answering a spend question

The question at the center of Norma is “If I spend this now, can I still cover what comes next?” Worked out properly, it asks whether, between now and the next time money comes in, what’s left covers the bills, the usual essentials, and this purchase.

The harness exposes each step as its own function. The model can call them, but code does the work, so none of the numbers come from the model.

  • Available money. What’s left over from last month, plus what’s come in this month, minus what’s already been spent. A running total of spending, updated each time a transaction comes in, keeps this fast, and it can always be rebuilt from the transactions if it ever drifts.
  • Bills due. Everything still to pay before the next income, including bills that went unpaid last month.
  • Essentials. What groceries, gas, and other necessities usually cost for the rest of that window, based on past transactions.
  • The verdict. Take the available money, subtract the bills and the essentials, then subtract the purchase, and say how safe it is, with the reason.

The window runs to the next income, not just to the purchase. A dinner on Friday can still be unsafe if rent is due on Saturday.

Norma request flow for a $90 dinner Friday from question to structured request to calculated answer
Proposed request flow. Example figures, not account data.

How a question becomes an answer

Following “Can I do a $90 dinner Friday?” from start to finish:

  1. Receive. The app sends the question to a server endpoint it can reach, either an edge function or a Railway endpoint, with a bearer token in the header. The server checks that token before it accepts the request. The phone never holds model keys.
  2. Parse. If the token is good, the server sends the question to Anthropic’s API, and that request includes the function definitions in the same order as the answer. The model turns the sentence into getAvailableMoney(), then getBillsDue() before the next income, then estimateEssentials() for the rest of that window, then checkPurchase() for the $90 dinner on Friday. If anything is unclear, Norma asks instead of guessing.
  3. Route. Each function from the parse hits the database with its own query. The query is deterministic, written ahead of time, so the same call always runs the same way. The model isn’t figuring out what SQL to generate on the spot.
  4. Compute. The model then pieces those results together into the verdict for the $90 dinner. The queries supply the numbers, and the model only assembles them, but that assembly still needs thorough testing.
  5. Reply. The language model puts the result into plain words. Code checks that every number matches the calculation, and if one doesn’t, a safe template answer is sent instead.
  6. Show the math. The answer is saved to the timeline with a trace of each step, so people can check it themselves. A no always comes with the reason, like “No. After Internet on Thursday and your usual groceries, you’d be short until payday.”

Known questions follow fixed recipes. Common requests like spend checks run through steps I’ve written in code, which makes them fast, predictable, and cheaper, which matters more with an expensive model. Only questions with no known recipe let the model plan its own steps, and even then it can only choose from tools I allow. When the same kind of new question keeps coming up, I turn it into a recipe. Analytics will show me what people are asking the model to do, without storing who they are or anything about their money.