27 Jul 2026 · 7 min · english
How much AI does your application really need?
Four ways to build an application on top of AI, and why the most contained one usually wins.
Over the past months I've been working on several dev projects, personal and for small businesses, all touching AI in some way. But not in the same way.
AI is the hot topic of this historical moment: every freelancer and every business, small or large, wants it in their processes. And although I think in most cases the benefits are greater than the downsides, there are critical differences in how AI can and should be used. Almost every use case can be implemented with each of the four approaches I'm going to describe, but usually only one of them is the optimal choice. Spoiler: keeping AI usage somewhat under control is often the best one.
Deterministic vs probabilistic
Before digging into the four approaches, it's important to have clear in mind what a deterministic and a probabilistic system are.
- Deterministic: given a certain input, the output is always the same. Think about find and replace in a text editor: search "client", replace with "customer", and it will catch every single "client" in the document, never one more, never one less. Run it a hundred times, you get the same document a hundred times. This is true for every traditional software we use on our phones and laptops, and it was pretty much the only option until LLMs became available at scale.
- Probabilistic: given a certain input, the output is the most probable one. Most probable given the data the system was trained on, which is worth remembering. The autocomplete on your phone's keyboard is a probabilistic system: type "how are" and it suggests "you", because that is what usually comes next. Usually. Sometimes it guesses wrong, and we have all sent that message. An LLM is the same mechanism pushed to the extreme, predicting the next word so well that it can hold a conversation or write working code. The principle doesn't change though: for simple predictions it is right nearly 100% of the time, but the more complex the task, the lower the probability of a correct output.
With that in mind, we can start thinking about how deterministic software (traditional code) can be combined with probabilistic systems (LLMs), and what the optimal mix between the two looks like.
Traditional software (100% deterministic)
Traditional software is the most common approach and the most reliable one for most applications. You give it an input and you always know the output is correct. Correct in the sense that it never deviates from the code: if the code is written poorly, so will be the output.
You don't want a spreadsheet that gives you false vlookups, or a calculator that sometimes messes with decimals. For these use cases you need consistency, and deterministic systems are the only choice when a wrong result is not acceptable. They are also the cheapest to run: there is a development cost upfront, but after that they are virtually free.
Plot twist: writing traditional software with probabilistic tools (LLMs)
We said most applications need reliability and consistency over time. But what about writing their code? Funny enough, LLMs are pretty good at that, for two simple reasons.
The first is that they are strong when given a clear goal to reach. "Build a Python script that sums 2 numbers": you can rest assured that every modern LLM will get there, even if the code it writes can be slightly different each time you run it.
The second is that code can be tested. This means the LLM can check its own output and fix itself until the goal is reached. This is where agentic coding tools are shining these days: Claude Code, Codex and Cursor.
AI agents (100% probabilistic)
The second way to build an application today is to use an LLM directly, instructed to achieve a specific task. This is what I mean by "AI agent": an AI model plus a set of predefined instructions that define its job, whether you interact with it by chatting or through skills and agent files. The most common tasks are content writing and editing, image generation and image reading.
To be fair, calling these systems 100% probabilistic is not entirely accurate: modern LLMs also use deterministic modules to get to the result. But for the sake of this article I will pretend they don't.
The benefit of a fully probabilistic system is that it adapts to the input: it can derive new rules from its knowledge, add layers of reasoning, make connections between concepts and learn over time.
The cons are inconsistent responses, failures in understanding context, hallucinations: in general, lower reliability for tasks that need a clear and stable output.
Traditional software + AI agents
Here things start to get interesting. We combine the reliability of a deterministic system with reasoning abilities that traditional code cannot capture, or at least not without a large amount of time and developers.
Think about an accounting software that scans your receipts (probabilistic) and processes them into a database to create reports (deterministic). Or a tool that generates images for your business profile (probabilistic) while a script writes your logo and captions on top of them (deterministic).
In both cases, the task that requires some degree of creativity and intuition is delegated to an LLM, while the repetitive and mechanical one is handled by code. The key detail is who is in charge: the deterministic workflow leads, and calls the LLM only at fixed steps. A common example is an n8n workflow chaining different modules, some deterministic and some probabilistic.
AI agents with deterministic modules
This type of application looks similar to the previous one, but the control is flipped: here the agent orchestrates, and decides when to call deterministic software.
Think about a tool that creates quotations for your business: it reads an email, creates a plan, reads your offer, drafts a proposal, finalises the PDF and sends it to the client. In some steps an LLM is making decisions and producing output; in others a piece of code runs the repetitive operations, like generating the PDF or sending the email.
Conceptually, this system is closer to a small team of employees using a combination of judgment and tools to reach their goals. That is what an agentic system is: usually an LLM (launched from Claude Code or Codex) with different agents, each instructed for one job, and a set of code modules they can call when needed.
Which solution to choose
The possible combinations are many and they all have pros and cons. In general, traditional software is more expensive to build but cheaper to run, while fully agentic approaches are cheaper and faster to build but come with higher operational costs.
That said, you can define the optimal setup for your project with these rules:
- Classic software (deterministic): when you need a system that is predictable, stable over time and cheap to run. Development is expensive, and so is maintaining, improving or refactoring it.
- Simple AI agents: for repetitive tasks that need basic interpretation or creativity. The cost of implementation is basically a base subscription to Claude or ChatGPT, and maintenance is done iteratively by chatting with the agent.
- Classic software with AI agents: when you need a predictable system that also has to handle simple "human type" tasks, like writing a text or extracting information from an image. Development is costly, and so is running it, depending on the type and volume of LLM usage attached.
- AI agents with deterministic modules: when you need a dynamic system that interacts with several external tools and covers more than one capability. Implementation is cheaper than classic software, but requires a mix of technical and domain knowledge.
So going back to my initial statement: in most projects, the winning setup is the one where AI does only what code cannot do, and nothing more.
If you have something in mind and are not sure which of the four it should be, get in touch. Picking the right one upfront costs a conversation, finding out halfway through costs a rebuild.
#ai #agents #llm