
What people actually mean by an AI agent
What you will learn
- What an AI agent actually is, stripped of the marketing: three plain parts
- Why the model is not the risky bit, and what is
- How I gave one too much permission, and what it taught me the same afternoon
Everyone selling you an AI agent is selling you a monthly bill for something you could set up yourself in an afternoon. The word sounds like a product. It is not. It is a shape you can build.
Strip the marketing off and an agent is three plain parts: a model that can read and write, a way for you to talk to it, and a short list of jobs it is allowed to do on your behalf. That is the whole animal.
Think of it like hiring somebody. A chat program is a person who can only answer questions. An agent is a person you can actually hand a task to, because you gave them the keys to two specific rooms and nothing else.
The intelligence was always in the model. The useful part is the keys, and the keys are yours to hand out.
Why bother when you can pay for one
Because the paid one runs on somebody else's computer, reads whatever you give it, and can change its price or its rules on a Tuesday.
When you own the arrangement, the model is a part you can swap out, the jobs are yours, and the whole thing keeps working whether or not a company still feels like offering it. You wire it to your things, not to their catalogue.
I built mine as a chat bot first, because a chat window is the fastest way to prove the thing is alive. You type, it answers, you watch it happen. That took an evening. Everything after that was just handing it more keys.
The part that trips people up
People think the hard part is the model. It is not. Running a capable model is now a one-line installation.
The hard part, the part that makes it an agent rather than a parrot, is the loop: the model asks to use one of its tools, your own code runs that tool, you hand the result back, and it decides what to do next.
That back and forth is the entire trick, and once you have watched it happen once it stops being magic and starts being plumbing.
Start with a model that fits your machine. A smaller one running on hardware you own beats a giant one you rent, because you can let it run all day for nothing and it never phones home. The guide on running your own assistant covers choosing one in detail. This one is what you build on top of it.
Now the part where I gave it too many keys
The first time I let a bot run a real command for me, I let it run any command.
That felt powerful for about a day. Then it confidently misread a request and did the literal thing I typed instead of the thing I meant, which is exactly what a very fast, very literal new employee would do.
Nothing burned down, but it taught me the actual lesson: the model is not the risk. The keys are. Something that can only do three specific things can only ever surprise you in three specific ways.
So I put it on a leash. Every job it can do is a piece of code I wrote, with the input checked before anything happens, and the genuinely destructive actions ask me first. It got less exciting and far more useful the same afternoon.
The model is not the danger. The keys you hand it are. So hand out few keys, and check them at the door.
A working agent from nothing, on a machine you already own. Replace anything in angle brackets with your own value.
1. Get a model talking
What these do: download a model that fits your memory, then send it a test question directly.
What should happen: the second command returns a greeting. That proves the model is running and reachable on your own machine.
Why this shape matters: it answers in the same format the big paid services use, so anything you build here also works against a paid one later if you ever want to swap.
ollama pull <small-model>
curl http://localhost:11434/api/generate \
-d '{"model":"<small-model>","prompt":"say hello"}'
Find it at ollama.com, or if you would rather build it yourself, llama.cpp
2. Give it a mouth
What to do: pick a chat app you already use, so you never have to build a screen for this. Register a bot, get its key, and your code now has somewhere to receive messages and send replies.
This is the proof-of-life step: get it repeating your messages back before it is clever. Save your work here before adding anything else.
# the smallest possible loop, in any language:
# 1) receive a message from the chat app
# 2) send that text to the model from step 1
# 3) send the model's reply back to the chat
A clean free place to start: the Telegram Bot API, though any chat app with a way in will do
3. Give it hands
What a tool actually is: a piece of code you wrote, described to the model in plain words. What it does, and what it needs.
Start safe: make the first one read-only, such as looking something up. That way a misfire cannot hurt anything.
# describe each one to the model: name, what it does, its inputs
tool: get_weather(city) # returns text, changes nothing
4. Close the loop
What this does: this is the step that turns a chat program into an agent.
How it goes: the model asks to use a tool, your code runs it, hands the result back, and asks what to do next. Repeat until it has a final answer.
One safeguard: put a limit on the number of times round, so it cannot spin forever.
# model -> "call get_weather('<your-city>')"
# your code -> runs it, feeds the result back
# model -> final answer, or asks for the next tool
# loop until done, with a cap on the number of turns
5. Keep it on a leash
When to do this: now, not later.
The three rules: each tool does one narrow thing, every input is checked before it is acted on, and anything destructive has to ask you first.
Why it is worth the dull afternoon: these are what make an agent safe to leave running.
# 1) each tool does ONE narrow thing
# 2) check the inputs before you act on them
# 3) destructive actions require an explicit yes from you
You now own an agent. Swap the model for a bigger one when you need more, add a tool when you have a new job for it, and it costs you nothing to leave running.
This page in the original Kyber Cypher voice: Build your own AI agent