What is an AI agent and how to build one that works in a company
An AI agent is a program built on a language model that gets a goal rather than step-by-step instructions and decides for itself which tools to use: search, email, a database or the company's own system. It differs from a chatbot because it acts rather than just answers, and from a plain automation because the order of steps isn't written down in advance. In a company an agent only works well once its limits are clear: what it may do, where it records its decisions and when it has to ask a person.
In short
- An AI agent is a program that gets a goal rather than a list of steps and chooses which tools to use until the job is done or it hits a limit a person has set.
- A chatbot answers, an automation runs a fixed script and an agent works out the order of actions itself. If you can write the steps down in advance, a plain automation is cheaper and more reliable.
- An agent that runs in a company for months has five parts: a goal with a stop condition, tools with permissions, rules enforced in code, a decision log and a person at the risky steps.
- Build your first agent for one narrow task with many similar cases and run it in “the agent proposes, a person approves” mode.
- Money, anything sent to customers and changes to data stay behind human approval or behind a server-side gate the agent cannot get around.
Contents
- What is an AI agent?
- AI agent, chatbot and automation: what's the difference?
- What does an AI agent that works in a company consist of?
- An example from Reefa: the purchasing agent step by step
- How do you build an AI agent step by step?
- How do you keep an agent that works on its own in check?
- How much does an AI agent cost a company?
- When doesn't an AI agent pay off?
- Where do you start with an AI agent in your company?
- Frequently asked questions
What is an AI agent?
An AI agent is a language model connected to tools and a decision loop: after each step it checks whether the goal has been reached and picks the next action. Without the loop you have a model that answers one question and waits for the next.
Anthropic, the company behind the Claude models, draws a useful line in Building effective agents, published in December 2024. A workflow is a system where the model and tools follow a path set in code. An agent is a system where the model directs its own process and picks its own tools. The same piece advises starting with the simplest thing that works and using agents where you can't predict the number of steps.
In practice, most “agents” sold to businesses are workflows with AI in one or two steps. That isn't a criticism. Quite often it's exactly the right choice.
AI agent, chatbot and automation: what's the difference?
The difference is who decides the order of steps and whether the program can do anything in your systems. A chatbot talks, an automation runs a fixed script, and an agent plans on its own.
| Option | Who sets the steps | Acts in company systems | Good enough when |
|---|---|---|---|
| Chatbot | The user, question by question | Usually not, it only answers | Answers from a knowledge base, first line of contact |
| Automation | You, once, in a script | Yes, the same way every time | Steps can be written down, data is tidy |
| Workflow with AI | You, AI handles one step | Yes, AI reads or writes text | A fixed process where one step needs reading text |
| AI agent | The model, within your limits | Yes, it picks tools itself | Every case looks a bit different |
A good test: try writing the process steps on a sheet of paper. If you can, and they come out the same every time, build an automation. If half the steps start with “it depends”, that's where an agent fits. I show how to write the steps down in the article on process mapping in a company.
What does an AI agent that works in a company consist of?
An agent that runs for months, not just in a demo, has five parts: a goal, tools, rules, a log and a person. Without any one of them the agent usually ends up doing nothing or doing too much.
- A goal with a stop condition. Not “sort out purchasing” but “for each request, suggest a product and an alternative or ask one question”. The stop condition keeps the agent out of an endless search loop.
- Tools with permissions. Each tool is one action with a clear input and output: read the catalogue, search, send a message. The agent gets only the permissions a new employee in that role would get.
- Rules in code, not in a request. I keep limits, filters and bans in code and in the database. A model can interpret an instruction in its own way, but it can't get past a check on the server.
- A decision log. Every decision is recorded: what the agent received, what it chose and why. Without a log, a week later nobody knows where an odd result came from.
- A person at the risky steps. Money, anything sent to customers and changes to data go for approval. The agent prepares, a person clicks.
It takes this much because a language model sometimes gets things wrong, and in a confident tone. The five parts don't remove mistakes, but they keep them small, visible and reversible.
An example from Reefa: the purchasing agent step by step
At Reefa, my cleaning company, staff on site report what's running out: cleaning products, bags, equipment. They do it in text or with a photo, in Polish, Russian or Ukrainian. In September 2026 I built an AI agent that handles these requests, while the purchasing decision stays with a person.
| Who | What happens |
|---|---|
| Agent | Splits the request into items and maps them to a 52-item catalogue |
| Agent | If something is unclear, asks the worker with buttons in Telegram |
| Agent | Runs one Allegro search per request |
| Code | Drops used items and sellers rated below a threshold set in code |
| Agent | Picks the best offer and an alternative, with reasons |
| Person | The site's supervisor gets the proposal in Telegram and confirms the order, then the delivery, with buttons |
Look at where the limits sit. The offer filter is in code, not in a request to the model, so the agent can't talk itself into a cheap seller with a poor rating. There's one search per request, so the cost is predictable: about USD 0.20 per request. And the agent buys nothing. The order is placed by a person who knows the site and the budget.
In tests the agent recognised specific products from photos. Where confidence is too low, it's better for it to ask. Another Reefa bot works the same way: it reads a door number from a photo on its own only at a confidence of 0.85 or more, and below that it asks the team in the chat. More examples are in the case study on AI agents that run part of the company.
How do you build an AI agent step by step?
Build an agent around one narrow task: write down the goal and the limits, give it read-only tools, test it on real cases and only then let it act. This order matters more than the choice of platform.
- Pick the task. Many similar cases, each a little different, and errors that are easy to spot. Requests, enquiries and incoming documents are a good start. I explain how to work out whether a task is worth it in the guide on where to start with business automation.
- Write the goal and the stop condition in one sentence, together with what the agent must not do.
- Start with read-only tools. The first version reads and proposes. Writing to systems comes later.
- Move the rules into code. The server checks limits, filters and exclusion lists. At Reefa, the agent that makes first contact with companies sends an offer only after the recipient agrees. A server-side gate with an exclusion list and a daily cap enforces that, not a sentence in the instructions.
- Build a test set. A few dozen real cases with the correct result. Every change to the instructions goes through this set before it goes live.
- Run in “proposes, I approve” mode. Measure how many proposals go through without corrections. Grant autonomy only where you already know the typical mistakes.
- Add a log and a rollback. Since 16 October 2026 five of my routines record every decision: date, question, options, choice, reasons and how to roll it back. The log is append-only. A website change that fails the post-deploy test reverts automatically. I measured that rollback at 3 seconds.
The platform matters less than people think. No-code tools such as the AI Agent node in n8n let you assemble an agent from a model and tools; that node needs at least one tool connected. When an agent touches money, customers or personal data, I write it in code, because then the gates, tests and log are fully under my control.
How do you keep an agent that works on its own in check?
You supervise an agent the way you would a new employee: clear rules, limited permissions, a second pair of eyes on important matters and regular reviews. There's one difference: an agent doesn't get tired or take offence, so the checks can be tighter.
- Rules under lock. The rules for these routines sit in locked files with a SHA-256 checksum. Changing them needs my re-approval, so an agent can't loosen its own rules.
- A second opinion. In content moderation on KtoSprząta.pl, editing or rejecting a post needs a second agent's agreement, and one run is capped at 30 decisions and 10 rejections.
- The last step stays human. The tender agent reads notices and drafts the documents, but the package ends with filing instructions for a person.
- Few questions for the owner. The routines decide for themselves and log their decisions, leaving me mainly what they physically can't do (logging in, paying and signing) and legally disputed cases.
I cover where AI helps a company and where it hurts in more detail in AI in small and mid-sized firms: what works, what fails.
How much does an AI agent cost a company?
The cost of an agent has three parts: building it, model and tool fees each time it runs, and upkeep. The first part varies most, because it depends on how many systems the agent can reach.
| Cost | What drives it | Example |
|---|---|---|
| Build | Number of tools and systems, tests, approvals | My AI implementation costs from PLN 15,000 excl. VAT |
| Usage | Number of tasks, length of texts, paid services | Allegro search at Reefa: about USD 0.20 per request |
| Upkeep | Changes in systems, new cases, reviewing the log | Hours of the person who reads the log and adjusts the rules |
Model fees for a single task are usually small. What tends to cost more is what isn't on any price list: the hours someone spends fixing the agent's mistakes when there were no tests and no log. The exact scope and price are on the AI implementation page.
When doesn't an AI agent pay off?
An agent doesn't pay off when the steps can be written down in advance, when there are few cases, or when the company has no data for the agent to read. Then a plain automation or tidying up the data is cheaper and more reliable.
- A fixed process. My morning brief on money, sales and people doesn't use a language model at all. It runs on a fixed template, because what matters there is consistency, not creativity.
- Small volume. A few cases a week are handled faster by a person than by an agent that has to be built, tested and watched.
- No data. If prices live in a salesperson's head and orders in a notebook, the agent has nothing to read. First comes a system or an automation that gathers the data in one place.
- Decisions without a source. An agent shouldn't calculate money unless it has a hard source to check against.
To be straight about it: I haven't measured the effect of my agents on the number of customer enquiries yet, so I don't quote one. I measure what can be measured: how many proposals went through without corrections, how many decisions were logged and how long a rollback took.
Where do you start with an AI agent in your company?
Start by listing three tasks where someone reads similar messages or documents every day and types in or sends something based on them. Pick the one where mistakes are easiest to spot and build an agent that only proposes at first.
For a quick picture of how ready your company is, try the free AI readiness assessment. If you'd rather I went through the processes with your team and showed where an agent makes sense and where an automation is enough, the AI and process audit costs from PLN 6,000 excl. VAT. Or book a 30-minute call now and tell me which task you'd like to hand to an agent.