In our product article we've already covered what AI Budget Assistant can do: photograph a receipt, dictate an expense by voice, ask the chat for budgeting advice — all without a single spreadsheet. That was the user's-eye view. Now let's come at it from the implementation side and see exactly how artificial intelligence is used here — and, just as importantly, what keeps it from doing anything silly.

Personal finances and AI are, above all, a question of trust. A generic chatbot on this topic easily says too much: it will confidently name a figure that doesn't exist, «recall» a transaction that never happened, or advise on something that has nothing to do with your budget. We built the system so the model doesn't work in a vacuum but on top of your real data, and so there is enough discipline around it: the AI key is kept on the server (not in the app), your data is fed to the model in isolation from the instructions, and wherever the model isn't needed, ordinary rules and mathematics do the work — faster, cheaper, and more predictable.

One idea runs through the whole text: AI here is a tool under control, not an oracle. Let's go in order: where it's used, how it's built, and where we deliberately did without it. Along the way — diagrams tidied up for a reader rather than an engineer.

Where the AI is

The app is a mobile client (built on Expo), while all the «smart» logic lives on the server. The client never calls OpenAI directly: it goes to our server, which then adds the key and the right context and calls the model. That way the key never leaves the server, and we can count quotas, sanitize data, and inject context all in one place.

The overall picture: the app and the bots talk to the server; the server-proxy adds the key and context and calls OpenAI; some logic runs with no AI at all.

Note two things. First, there's a single provider — OpenAI; no «zoo» of models is needed here. Second, right next to the AI on the server lives logic without AI — anomaly detection and the personal inflation index are computed by ordinary code. We'll come back to them separately.

One key, three model «speeds»

Unlike systems where you bring your own key, here the key belongs to the service. The user chooses not a provider but a model «speed» — in Settings, with a single switch that applies to all text and «vision» features at once.

An AI request's path: the quota is checked and deducted with the plan's multiplier, then the model is picked by «speed», and the server calls OpenAI with its own key.

There are three speeds: fast (the gpt-4o-mini model, cheaper), balanced (gpt-4o, the default), and quality (gpt-4.1, pricier and more detailed). Each has its own cost multiplier that affects how much AI quota a single request spends: on the Free plan that's 5 AI requests per month, and a «fast» request costs 0.75 of a unit while a «quality» one costs 1.5. So the user controls the «cheaper / smarter» balance themselves, and costs stay in check. Voice recognition stands apart: it always goes through the fixed whisper-1 model and is not part of the «speed» choice.

The chat assistant as a function-calling agent

The chat isn't just «talking to a bot». Under the hood it's an agent with 11 functions (create an expense, add income, and so on): the model itself decides whether to answer with text or propose a concrete action, and vetted server code then carries it out.

The chat as an agent: the model either replies with text or proposes an action; a write always goes through confirmation and is blocked for the «viewer» role.

An important detail — any change to your data goes through a confirmation. The model doesn't create an expense silently: it proposes an action, and the user confirms it (or cancels). And if a member of the account has the «viewer» role, the write is blocked before the action is even queued — both in the app and in the bots. In other words, the AI here helps you fill things in, but doesn't dispose of your data behind your back.

What the AI knows about you — and injection defence

To make its advice relevant, the assistant receives a slice of your finances: how much you've spent this month, your category limits, your top categories, and recent expenses. But this is exactly where a subtle risk hides — an attack through your own data (prompt injection): if a command for the model is hidden in an expense description, it could «hijack» the instructions. We close this off on two levels.

Protecting the context: all user strings are sanitized, and the data is fed to the model in an isolated block, separate from the instructions — so the model treats it as data, not commands.

First, all user strings (expense descriptions, project, tag, category, and goal names) are sanitized before being placed into the prompt. Second, the context is passed to the model as an isolated data block, wrapped in service markers (something like «--- USER DATA ---» … «--- END OF DATA ---»), so the model treats it as data, not as instructions. Even a free-form caption on a scanned receipt is length-limited and passed as a passive note rather than a command.

A receipt from a photo: vision

The fastest way to log an expense is to photograph the receipt. Recognition is handled by a «vision» model (the same one you picked by «speed»): it pulls the line items, amounts, date, and even the store address out of the photo.

Receipt recognition: a vision model turns the photo into line items and an address; an expense draft is assembled from them, and the address becomes a point on the map — already without AI.

Then comes the careful work with details. Each line item is given a canonical product name — needed so that prices can later be compared honestly over time (more on that below). And the store address becomes a point on the map via an open geocoding service (OpenStreetMap/Nominatim) — with no AI at all, cached and «quiet» on failure. A good example that not every task should be handed to a model.

Voice: dictate an expense

You don't have to type an expense — you can say it out loud. A voice message is transcribed by the whisper-1 model, after which the text is handled like an ordinary phrase — by the same expense parsing as keyboard input. This works both in the app and in the messengers.

AI in Telegram and WhatsApp

AI Budget Assistant doesn't live only in the app. It has full-featured bots in Telegram and WhatsApp, and — importantly for the architecture — they reuse the very same AI services: the same chat agent, the same voice transcription, the same receipt recognition. Not three different «brains», but one, reachable from different channels.

A single set of AI services on the server serves the app, Telegram, and WhatsApp alike — chat, voice, and receipts work the same everywhere.

A nice touch: in a conversation the bot can recognise an account name in the text and answer specifically about it, without switching your main account. Just write something like «show expenses in Family» and the bot will understand which account you mean.

Smart suggestions: categories, tags, projects

A good helper doesn't make you fill everything in by hand. So when you enter an expense, the system suggests a category, tags, a matching project, and even a split of the amount across several categories. But here too the model isn't always involved.

«History first, then AI» suggestions: if something similar has been seen before, the suggestion is instant and model-free; AI and embeddings kick in only for unfamiliar cases.

The logic is simple and thrifty: history first. If a similar expense has been seen before, the suggestion is served instantly, with no call to the model. And only for unfamiliar cases does the AI kick in, while for matching «by meaning» (for instance, which project an expense belongs to) embeddings — vector representations of text — are used. That way frequent operations spend neither AI quota nor time.

Insights, stories, and the portfolio

On top of your data, the AI can not only answer questions but also spot patterns on its own. It assembles insight cards (where money leaks away, what has changed) and even narrative «spending stories» — a coherent account instead of dry figures.

AI-powered analytics: insight cards and «spending stories» are assembled from your data, and for the investment portfolio there are separate portfolio insights with a risk assessment.

The investment portfolio is a story of its own. Here the AI analyses the composition of your holdings and produces portfolio insights: concentration risk in a single asset, a skew by type, lagging behind a benchmark, the impact of fees, and other signals — with clear «warning / critical» thresholds. This capability belongs to the paid tier (Pro+), costs a bit more than an ordinary request, and is cached for a day so the same thing isn't recomputed.

Where the AI is deliberately NOT used

This is perhaps the most underrated section. Not everything that looks «smart» should go to a model — sometimes ordinary code is more honest, faster, and cheaper. We've done two notable things this way.

Anomaly detection — rule-based, no AI: four detectors fire the moment an expense is saved, pile into a deduplicated feed, and send no more than three pushes a day.

Anomaly detection runs on four simple rules that fire right when an expense is saved: a category spike (a rise of 30%+ over the average), a subscription that got pricier (a price rise of more than 10%), a duplicate charge (the same payee and amount within a day), and «looks like a recurring payment». Each signal lands in a deduplicated feed, and to avoid nagging, no more than three pushes are sent per day. No model — only deterministic rules that always fire the same way.

The personal inflation index is more honest still. It shows how the cost of your very own «shopping basket» changes, and is computed with ordinary mathematics (a Laspeyres index) over the line items from your receipts — without a single call to AI. The model plays only an indirect part here: it once recognised a receipt, and arithmetic does the rest. Cheap, transparent, and reproducible.

Conclusion

Put it all together and the same simple thought emerges as in our other products: value comes not from «a bigger model» but from careful engineering around it. AI that works on top of your real data rather than inventing it. A key that stays on the server rather than leaking into the app. Data isolated from instructions. A confirmation before any write. And the sober decision not to summon a model where rules and mathematics will do.

It's exactly this discipline that turns a talkative model into an assistant you can trust with your budget — without fear that it will paint in an extra expense for you. You can try AI Budget Assistant at ai-budget.pl, on Google Play, or build it yourself from the sources on GitHub. And if you need a similar AI helper embedded into your own product and data, write to us: [email protected].

Which model does what

Finally — a summary of which model handles which task. One thing to underline separately: anomaly detection and the personal inflation index work without a model — on rules and mathematics, so they're not in the table.

TaskModel
Text tasks: chat agent, expense parsing, categories, tags, projects, splits, insights, stories, portfoliogpt-4o-mini · gpt-4o · gpt-4.1
Receipt recognition (vision)gpt-4o-mini · gpt-4o · gpt-4.1
Voice → text (transcription)whisper-1
Semantic suggestions (projects, tags)OpenAI embeddings