We asked an n8n agent one question about an unpaid invoice. n8n called the model three times before answering.
We know because the model was a fake we wrote, and it logged every request.
That loop is the plain answer to what is an AI agent: a language model that calls tools, reads the results and picks its next step until a stop rule ends the run.
Below, we take ours apart, then sort real AI agent examples from chatbots wearing the label.
What is an AI agent?
An AI agent is software that uses a language model to choose its next step toward a goal. It takes that step through a tool, checks the result and repeats until the job is done or a limit stops it.
The model is the same kind you chat with in ChatGPT. Only the setup around it changes.
Every working agent has four parts:
- A model that reads the situation and decides what to do next.
- Tools it may call, like an API, a database, a calculator, a browser or a phone line.
- Memory that carries earlier turns and results into the next decision.
- A stop condition: the job is done, the step budget runs out or a human must approve.
Textbooks go wider. Russell and Norvig’s Artificial Intelligence: A Modern Approach calls anything that senses its surroundings and acts on them an agent, so a thermostat counts.
On a product page in 2026, “agent” means the LLM kind. What does choosing a next step look like from the inside? We watched.
We took an n8n agent apart, one model call at a time
We ran n8n 2.46.6 on our test server and rebuilt the agent from our n8n agent tutorial: a chat trigger, the AI Agent node, an OpenAI-style chat model and Simple Memory.
It had two tools. One was a Calculator. The other, invoice_lookup, queried a fake billing API where invoice INV-2207 belongs to Kestrel Studio, costs $240 and was due on 10 November.
The model was the twist. We wanted to read every message, so we wrote a small OpenAI-compatible server that logs each request and answers from a script.
Read this first: every model reply below was scripted by us so we could watch the loop. A real LLM makes these choices itself, sometimes badly. What we’re showing is n8n’s side: what it sends, when it runs tools and when it stops.
Our question: “Is invoice INV-2207 paid, and how many days overdue is it?”
| Call | What n8n sent the model | What came back |
|---|---|---|
| 1 | System message, your question and two tool definitions (1,180 bytes) | Call invoice_lookup with INV-2207 |
| Tool | n8n queried the invoice API | Unpaid, $240, due 10 November, client Kestrel Studio |
| 2 | All of the above, plus the tool call and the invoice data (1,558 bytes) | Call Calculator with 23 – 10 |
| Tool | n8n ran the calculator | 13 |
| 3 | All of the above, plus the calculator step (1,818 bytes) | INV-2207 is unpaid and 13 days overdue |
Three model calls for one question. Now look at what grew.
Each call resent the system message, the question, the full tool list and every step so far. Requests grew from 1,180 bytes to 1,558, then 1,818. Together, one question sent 3.9 times the text of its first call.

Most of that weight was the tool list. In the first request, two tool definitions filled 862 of the 1,180 bytes, or 73%. Here’s the one n8n built for our lookup tool:
{
"type": "function",
"function": {
"name": "invoice_lookup",
"description": "Look up one invoice by its ID (for example INV-2207). Returns client, status, amount and due date.",
"parameters": {
"type": "object",
"properties": {
"invoice_id": {
"type": "string",
"description": "The invoice ID, e.g. INV-2207"
}
},
"required": [
"invoice_id"
]
}
}
}
That’s all the model sees of a tool: a name, a sentence and a schema. It never touches the API. n8n runs the request and pastes the result back as a message.
So vague tool descriptions get you vague choices.
Memory and the stop rule: the parts most guides skip
In our test, the surprises came from the two parts nobody demos.
Memory kept less than we expected
We sent a follow-up in the same chat: “Who is the client on it?”
Simple Memory added only part of the earlier turn: the question, the calculator step and the final answer. The invoice lookup, the only step naming Kestrel Studio, was missing.
Our script told the model to answer from memory if the client’s name was there, and to look it up if not. It had to look it up: two more model calls and a second API hit. Raising Simple Memory’s window from 5 to 20 changed nothing.
We saw this on n8n 2.46.6, so test your version. The lesson travels: agent memory is a summary someone else chose, not a recording.
What happens when an agent never finishes
Next, we scripted the model to request a tool every time, so it never answers. n8n’s AI Agent node allows 10 iterations by default. Ours made 10 model calls and 10 API requests, then failed with this:
Max iterations (10) reached. The agent could not complete the task within the allowed number of iterations.
The person in the chat saw “Error in workflow”. No partial answer.
Each lap added 374 bytes, so the tenth call sent 4,536. The run sent 28,530 bytes in all, about 24 times its first call. With the cap at 3, it stopped after 3 calls.
That’s the catch with a stop rule. It protects your bill but fails loudly, so decide what the user sees when it trips.
Agent vs chatbot vs workflow: who picks the next step?
A chatbot answers one message at a time. A workflow follows a path you drew. An agent picks its own path through the tools you gave it.
Anthropic’s guide to building agents draws the same line. In a workflow, your code decides the steps. In an agent, the model directs its own process and tool use.
| Chatbot | Workflow | AI agent | |
|---|---|---|---|
| Who picks the next step | You, one message at a time | Your flowchart | The model, inside limits you set |
| Can it act in other apps | No, it replies | Yes, in a fixed order | Yes, in the order it chooses |
| Typical example | A support bot that answers FAQs | New lead, add to CRM, send email | Triage a ticket, look up the order, draft the refund |
| How it usually fails | A wrong answer | A broken step, loudly | A wrong action, quietly |
Isn’t a chatbot that searches your docs an agent? Usually not.
Most RAG chatbots run one search per question and reply from what comes back. It becomes an agent when the model decides whether to search, what for and whether to search again.

Our AI agents vs traditional automation guide covers when a fixed path wins. Short version: if you can draw the path on a whiteboard, build the workflow.
Types of AI agents: the textbook five and the ones you’ll meet
Computer science sorts agents by how they decide. Product teams sort them by the job. Both lists get called types of AI agents, and they barely overlap.
The textbook types
These five come from the classic AI textbooks, and IBM’s explainer uses the same list.
| Type | How it decides | Everyday example |
|---|---|---|
| Simple reflex | Fixed if-this-then-that rules on what it senses now | A thermostat |
| Model-based reflex | Rules plus a running picture of the world | A robot vacuum that maps the room |
| Goal-based | Plans steps that reach a goal | A route planner |
| Utility-based | Weighs options and picks the best trade-off | A dynamic pricing engine |
| Learning | Improves its own rules from feedback | A recommendation feed |
Most LLM agents sit between goal-based and utility-based. They chase a goal and weigh options, but nothing inside them learns between runs unless someone retrains the model.
The types you’ll actually buy or build
- Coding agents read a codebase, run commands and edit files.
- Browser agents click through websites and apps the way you would.
- Voice agents answer a phone line, think and talk back.
- Workflow agents sit inside an automation tool and handle the steps that need judgment.
- Research agents search, read and write up what they found.
- Multi-agent systems split a job between a planner and several workers.
Real AI agent examples, and the loop inside each
The quickest test: find the loop. If the software can’t call a tool, read the result and change course, it’s a chatbot.
Coding agents: Claude Code and Codex
Ask Anthropic’s Claude Code or OpenAI’s Codex to fix a failing test. You’ll watch the loop: read the files, run the tests, edit a function, test again.
The tools are your terminal and files. The stop condition is “tests pass” or “the human says stop”. That’s why coding agents took off first: a test suite tells the model the truth after every step.
Browser agents: ChatGPT’s cloud browser
OpenAI’s help center now says ChatGPT agent “is no longer available” and points to ChatGPT Work, with a cloud browser for website jobs.
The loop survived the rename: open a page, read it, click, check, repeat. Every screen is a fresh observation to read, which is why browser agents are slow to watch. They also stop to ask before payments and other actions you can’t undo.
Voice agents: Vapi and Retell
A voice agent runs the loop mid-conversation. It hears a sentence, decides whether to reply or check a tool like a calendar, then speaks.
Platforms like Vapi and Retell handle the phone line and speech. You bring the prompt and tools. Our AI voice agents guide shows how the pieces connect and what a minute costs.
Weighing up one platform? Our Vapi review covers its features and catches.
AI receptionists
A receptionist is a voice agent with a narrow job: answer, qualify, book, hand off. Its tools are a calendar and a CRM, and its stop rule is a transfer to a human.
That narrow scope is why they work. Our AI receptionist breakdown covers where callers get stuck, and our Retell review covers one platform you can build them on.
Workflow agents in n8n
This is the kind we built. An agent node sits inside an n8n workflow, and everything around it stays fixed: the trigger, the clean-up, the final email.
For most small teams, that’s the right size. The model takes the one step that needs judgment. The workflow does the rest.
Where AI agents break
Agents fail in ways a chatbot can’t, because they act on what they believe.
Agent washing. Gartner counts roughly 130 genuine agentic AI vendors among the thousands using the label. The rest relabel chatbots, assistants and RPA bots.
Gartner also expects more than 40% of agentic AI projects to be scrapped by the end of 2027. Its reasons: cost, unclear value and weak risk controls.
Confident wrong answers. In our agentic AI vs generative AI test, a small local model nailed every lookup, then missed 11 of 12 multi-step money questions and sounded sure each time.
Tool errors become model input. Our first n8n run used an older HTTP tool node that n8n 2.46.6 couldn’t run. n8n didn’t stop. It passed the error text to the model as the tool’s answer and asked what next.
A real model might retry, give up or invent the invoice.
Every lap costs more. A runaway agent bills you for a growing pile of resent text. Our ten-lap test sent 28,530 bytes before the cap stopped it.
Tools reach real systems. An agent with a “send email” or “issue refund” tool can get it wrong a hundred times before anyone looks. Standards like MCP make tools easy to plug in, as our MCP explainer shows. Easy to plug in also means easy to over-share.
Should you build an agent?
Build one when the steps change from case to case and a wrong step is cheap to catch. Skip it when the path is fixed or one mistake costs real money.
Best for: support triage that needs lookups, research write-ups, coding with tests and call booking with a calendar check.
Not ideal for: flowchart jobs, payments, legal or medical calls without a human, and tasks where you can’t tell right answers from wrong ones.
How to start with AI agents without getting burned
Five rules we'd follow on any first agent, in n8n or anywhere else.
-
Step 1 of 5
Draw the path first
Sketch the job as a flowchart. If every branch is known, build a workflow and stop there. Reach for an agent only for the step where the path changes from case to case.
-
Step 2 of 5
Give it two or three tools
Name each tool plainly and describe it in one sentence. In our test, two tool definitions were 73% of the first request, and that text is all the model knows about them.
-
Step 3 of 5
Set a low iteration cap
Start at 3 to 5, not the default 10. Then decide what the user sees when the cap trips, because n8n’s default is a bare error.
-
Step 4 of 5
Gate anything you can't undo
Payments, deletes and outgoing emails go behind a human approval step. In n8n, that’s human review on the tool connection.
-
Step 5 of 5
Read the logs before you trust it
Turn on intermediate steps and read a dozen real runs. Check which tools it called, what came back and what made it into memory.
Frequently asked questions
Disclosure: the n8n, Vapi and Retell links on this page are affiliate links. Sign up through one and we may get paid. Your price stays the same.
Is ChatGPT an AI agent?
Plain ChatGPT chat isn’t. It answers one message at a time, and you decide the next step. The agent part is ChatGPT Work, whose cloud browser picks tools, reads results and keeps going on its own until the task is done or it needs your approval.
Is Siri or Alexa an AI agent?
Mostly no, at least in the classic form. They match your request to one fixed action, like setting a timer, and stop. That’s closer to a simple reflex agent. They behave like LLM agents only when a request triggers several steps the assistant chooses itself, checks and adjusts.
Is an AI agent the same as agentic AI?
Nearly. Agentic AI is the approach: a model that plans and acts in a loop. An AI agent is one working system built that way. Vendors use both terms loosely, so judge the product by its loop. Can it call tools, read the results and change course?
How much does it cost to run an AI agent?
You pay per model call, and one agent task makes several. Our test question took three calls where a chatbot needs one, and each call resent the whole conversation. Plan for several times the cost of a single chat reply, plus any paid tools or APIs the agent calls.
Can an AI agent run on my own computer?
Yes. Self-hosted n8n with a local model through Ollama runs entirely on your hardware, with no API bill. The trade-off is quality. In our own tests, small local models fumbled multi-step maths. Start with a narrow job and a low iteration cap.
Do AI agents learn from their mistakes?
Not on their own. The model’s weights don’t change between runs, and memory only carries recent conversation, often trimmed. An agent repeats a mistake until you fix the prompt, the tool description or the model. Learning agents in the textbook sense need a training loop most products don’t have.
What should an AI agent never do without a human?
Anything you can’t undo: sending money, deleting records, emailing customers in bulk or signing up for paid services. Put those tools behind an approval step. n8n’s human review for tool calls pauses the run and asks in Slack, Telegram or chat before the action runs.
Do I need to code to build an AI agent?
No. Visual tools like n8n let you connect a model, tools and memory without writing code. Some comfort with APIs and JSON still helps. Debugging an agent means reading what it sent to the model and what each tool sent back.
The bottom line
So, what is an AI agent? A model, a few tools, some memory and a stop rule, running in a loop. The model only writes requests. Your software does the acting.
Judge the loop, not the label. Most products sold as agents are chatbots or workflows, and for many jobs that’s the better buy. Our agent vs chatbot table is the quick check.
Got a job with changing steps and cheap mistakes? Build a small AI agent with two tools and a low iteration cap. Then read its logs before you trust it.



