What are AI agents? How they work, and when you need one
Mosaddik Billah 4 min read

On this page
A chatbot answers questions. An AI agent gets things done: it can look up an order, check stock, draft a reply and update a record, deciding the steps itself. That difference is why “agents” are everywhere in AI news. This guide explains what an agent actually is, how it works under the hood, and when a business really needs one.
The short definition#
An AI agent is a large language model that can use tools and works in a loop until a task is done.
- Tools are actions your code makes available: search the product catalogue, read a customer’s orders, send an email, create a calendar event.
- The loop means the model can take a step, look at the result, and decide the next step, instead of giving one answer and stopping.
The model never runs anything itself. It asks for a tool, your code runs it and sends back the result, and the model continues.
How the loop works#
Imagine a customer writes: “Where is my order, and can I change the delivery address?”
- The model reads the request and the list of tools it’s allowed to use, for example
find_order,get_trackingandupdate_address. - It asks for a tool:
find_orderwith the customer’s email. - Your code runs it and returns the order: number 1042, shipped yesterday.
- The model asks for the next tool:
get_trackingfor order 1042. - Your code returns the tracking status: out for delivery today.
- The model decides that the address can’t be changed once an order is out for delivery, so it doesn’t call
update_address. - It writes the final answer: where the parcel is, and why the address can’t be changed now.
Nobody wrote a rule for “order already out for delivery”. The model worked it out from the tool results and the instructions it was given.
What a tool looks like#
You describe each tool to the model with a name, a description and the inputs it takes. With the Claude API, for example, a tool definition looks like this:
{
"name": "get_tracking",
"description": "Get the current delivery status for an order. Use after finding the order number.",
"input_schema": {
"type": "object",
"properties": {
"order_number": { "type": "string" }
},
"required": ["order_number"]
}
}The description matters more than it looks. It is how the model decides when to use the tool, so write it like an instruction to a new colleague, as in how to write prompts that get better AI answers.
Chatbot, workflow or agent?#
| What it does | Good for | |
|---|---|---|
| Chatbot | Answers from what it knows or what you give it | FAQs, explaining policies, drafting text |
| Workflow | Runs fixed steps you designed, with AI in some of them | Tagging every new enquiry, summarising every form submission |
| Agent | Chooses its own steps and tools until the task is done | Tasks where the steps depend on what it finds |
Many problems that sound like they need an agent are better solved with a workflow. If the steps are always the same, such as “summarise each new message and save it to the CRM”, fixed code is cheaper, faster and easier to test. Use an agent when the path really changes from case to case.
Real examples for a small business#
- Customer support: look up orders, bookings or tickets and answer with real data, handing over to a person when needed.
- Sales enquiries: read a quote request, check prices and availability, and draft a reply for you to approve.
- Internal assistant: answer staff questions from your documents, using RAG, and fill in reports.
- Coding: tools like Claude Code are agents that read files, run commands and fix their own mistakes while building software.
The risks, and how to handle them#
Agents act, so mistakes cost more than a wrong sentence. Plan for these from the start:
- Give the fewest tools possible. A support agent may need to read orders; it probably doesn’t need to issue refunds.
- Check in your code, not only in the prompt. If the agent may only see the current customer’s orders, the tool itself must enforce that. A visitor can try to talk the model into ignoring its instructions.
- Ask a person before anything that can’t be undone, such as sending money, deleting data or emailing customers.
- Limit the loop. Set a maximum number of steps and a spending limit, so a confused agent stops instead of running up costs.
- Log every step. Save which tools were called with what inputs. When something goes wrong, the log tells you why.
Should you build one?#
Start small: one task, two or three tools, and a person approving the actions. Measure whether it saves time, then add more. Often the first version is an AI assistant on your website that answers from your content, and tools come later.
If you’d like an AI assistant or agent built into your Wix site or your systems, I do AI integration.
Comments