# What is an AI agent? How it differs from a chatbot and a workflow

> An AI agent is a language model running in a loop with tools. It decides the next step itself, acts through those tools, reads what comes back and repeats until the task is done or a limit stops it. A plain chatbot answers each message, and a workflow follows steps your code fixed in advance.

Mindket editors · Published 2026-11-04 · Updated 2026-11-05 · https://mindket.com/learn/prompt-engineering/what-is-an-ai-agent

## In short

- An agent is a model in a loop with tools, and the model, not your code, picks the next step.
- A workflow follows code paths fixed in advance, and a plain chatbot does not run a workflow at all.
- Start with the simplest thing that works, because agents cost more and can compound errors.
- Set a stop condition, and bring a person in for risky actions.

## Before you start

Nothing to install. Two ideas from earlier lessons carry over: a [system prompt](https://mindket.com/learn/prompt-engineering/system-prompt) tells an agent how to behave, and the [context window](https://mindket.com/learn/prompt-engineering/context-window) is the room it works in. If you have Claude Code you can watch a real agent loop, but reading is enough.

## Tell an agent from a chatbot with three questions

Product names will not settle it, so ask these questions in order. The sketch below is ours. It follows OpenAI's [description](https://cdn.openai.com/business-guides-and-resources/a-practical-guide-to-building-agents.pdf) of the Agents SDK loop, which runs until a final-output tool is called or the model answers without a tool call.

````text
messages = [instructions, user_request]
while True:
    reply = ask_model(messages, tools)
    if reply has no tool call:
        return reply              # a plain answer ends the run
    result = run_tool(reply.tool_call)
    messages += [reply, result]   # the result feeds the next step
    # also stop when a step limit is reached
````

1. **Who picks the next step?** In a workflow, your code does. Anthropic's [article](https://www.anthropic.com/engineering/building-effective-agents) defines workflows as systems where models and tools are orchestrated through predefined code paths, and agents as systems where the model dynamically directs its own process and tool use.
2. **What can it touch outside the chat?** OpenAI says an agent has tools to interact with external systems, both to gather context and to take actions. A system that only returns text is not doing that.
3. **How does it know it is done?** At each step it checks what came back from the environment, which Anthropic calls "ground truth", such as a tool result. The run ends when the task is complete or a limit is hit.

## Chatbot, workflow or agent

Judge a product by the three questions, not by its label, since many chat products now add tools and drift toward the agent column. The table uses Anthropic's split between workflows and agents, plus OpenAI's remark that simple chatbots, single-turn models and sentiment classifiers are not agents.

**A plain chatbot, a workflow and an agent compared**

| | Plain chatbot | Workflow | Agent |
| --- | --- | --- | --- |
| A language model writes text | ✓ Yes | ✓ Yes | ✓ Yes |
| The model chooses the next step | ✗ No | ✗ No | ✓ Yes |
| Calls tools or APIs that act outside the chat | ✗ No | ✓ Yes | ✓ Yes |
| Checks the result of each action and tries again | ✗ No | ◐ Partly | ✓ Yes |

Sources: [Anthropic Engineering: Building effective agents](https://www.anthropic.com/engineering/building-effective-agents) (read 2026-11-04), [OpenAI: A practical guide to building agents](https://cdn.openai.com/business-guides-and-resources/a-practical-guide-to-building-agents.pdf) (read 2026-11-04)

## Model, tools and instructions

OpenAI's [guide](https://cdn.openai.com/business-guides-and-resources/a-practical-guide-to-building-agents.pdf) says an agent has three core components. The model does the reasoning and decision-making, the tools are functions or APIs it can call to act, and the instructions are the explicit guidelines and guardrails for its behavior. The instructions are a system prompt.

The guide sorts tools into three types. Data tools retrieve context. Action tools change something, such as sending an email or updating a record. In orchestration tools, one agent serves as a tool for another. Tools can come from function calling or from [MCP](https://mindket.com/blog/what-is-mcp), and OpenAI's [agents guide](https://developers.openai.com/api/docs/guides/agents) lists both. The guide's own example is an agent with instructions and two tools.

````python
from agents import Agent, WebSearchTool, function_tool

@function_tool
def save_results(output):
    db.insert({"output": output, "timestamp": datetime.time()})
    return "File saved"

search_agent = Agent(
    name="Search agent",
    instructions="Help the user search the internet and save results if asked.",
    tools=[WebSearchTool(), save_results],
)
````

## A run in Claude Code

Claude Code's [docs](https://code.claude.com/docs/en/how-claude-code-works) describe the loop as three phases that blend together: gather context, take action and verify results, with tools throughout. Without tools Claude can only respond with text, and with them it can act. For a request to fix the failing tests, the docs list what Claude might do. You can interrupt at any point to steer it.

**What Claude Code might do when told to fix failing tests**

1. Run the test suite. Gather context: see what is failing.
2. Read the error output. Gather context: see why.
3. Search for the relevant source files. Gather context: find where to look.
4. Read those files. Gather context: understand the code.
5. Edit the files. Take action: fix the issue.
6. Run the tests again. Verify the result.

## When an agent is worth building

Anthropic's advice is to find the simplest solution possible and add complexity only when needed. Agents suit open-ended problems where you cannot predict the steps, but their autonomy means higher costs and the potential for compounding errors.

OpenAI gives three signs that a job has resisted ordinary automation. If none of them fits, its guide says a deterministic solution may be enough.

| Sign | What it looks like | OpenAI's example |
| --- | --- | --- |
| Complex decision-making | Nuanced judgment, exceptions or context-sensitive decisions | Refund approval in customer service |
| Rules that are hard to maintain | A rule set so large and tangled that updates are costly or error-prone | Vendor security reviews |
| Heavy use of unstructured data | Reading natural language, pulling meaning from documents or talking with users | Processing a home insurance claim |

## Limits and a person in the loop

- Set a stop condition. Anthropic suggests a maximum number of iterations, and OpenAI lists exits such as a final-output tool, an error or a maximum number of turns.
- Rate each tool by risk. OpenAI suggests low, medium or high, based on read-only versus write access, reversibility, account permissions and financial impact, then pausing for checks or a human on the high ones.
- Hand control to a person on two triggers. OpenAI names exceeding failure thresholds and high-risk actions, such as canceling orders or making payments.

## Ethan Mollick on why running agents is a management job

Ethan Mollick, a Wharton professor who studies AI, [wrote on X on 3 January 2026](https://x.com/emollick/status/2007249835465072857) that watching people use coding agents such as Claude Code and Codex makes one thing clear. Managing agents is a management problem. His four questions are whether you can specify goals, provide context, divide up tasks and give feedback, and he calls them teachable skills.

Each one maps onto a lesson in this course. Goals and limits go in the system prompt, and context is what you choose to put in the window. Dividing up tasks is the workflow-or-agent choice above, and feedback is the person in the loop on risky steps. Before you hand a job to an agent, write one line for each of his four questions.

> Can you specify goals? Can you provide context? Can you divide up tasks? Can you give feedback? These are teachable skills.
>
> Ethan Mollick, Professor at Wharton who studies AI, [X](https://x.com/emollick/status/2007249835465072857) (read 2026-11-05)

[![Ethan Mollick (@emollick) on X, 3 January 2026, on how people use Claude Code and Codex. Can you specify goals? Can you provide context? Can you divide up tasks? Can you give feedback?](https://mindket.com/blog/shots/x-emollick-managing-agents.webp?v=598527cf63d3)](https://x.com/emollick/status/2007249835465072857)

Ethan Mollick on X, 3 January 2026

[Tips for building AI agents](https://www.youtube.com/watch?v=LP5OCa20Zpg)

Tips for building AI agents, a video from Anthropic on its own YouTube channel.

> A screenshot of X's own embed of the post, taken on 5 November 2026, with the time in UTC. Select it to open the post on X.

## Common mistakes

- Reaching for an agent when a fixed workflow would do. Anthropic notes that optimizing a single call with retrieval and examples is often enough.
- Starting with several agents. OpenAI says to maximize one agent's capabilities first, because more agents add complexity and overhead.
- Giving an agent many overlapping tools. OpenAI says the problem is not only the count, since some setups handle more than 15 distinct tools while others struggle with fewer than 10 overlapping ones.
- Skimping on tool descriptions. Anthropic says tool definitions deserve as much prompt engineering effort as the main prompts.

## Try it yourself

- Pick a job you do by hand and write down its steps. Mark each one as something a fixed rule could handle or something that needs judgment.
- Run the three questions on an AI product you use, and decide whether it is a chatbot, a workflow or an agent.
- If you use Claude Code, ask it a question about your project and watch which tools it calls. Name the phase of each step.

## Where to go next

That ends this course. Next is [which AI tool to use](https://mindket.com/learn/ai-tools). Its first lesson, [how to choose an AI image generator](https://mindket.com/learn/ai-tools/best-ai-image-generator), compares the apps that make pictures and says how to pick one for a job. The course then does the same for video, voice, music, research and AI agents.

The [Learn hub](https://mindket.com/learn) lists every course. Mindket also lists ready-made [agents](https://mindket.com/agents), so you can see one before you build your own.

## Check yourself

1. Who picks the next step in an agent, and who picks it in a workflow?

   A. Your code picks it in both
   B. The model in an agent, your code in a workflow
   C. Your code in an agent, the model in a workflow
   D. The user picks it in both

   Answer: B. Anthropic defines workflows as orchestrated through predefined code paths, and agents as systems where the model directs its own process and tool use.

2. Which action should an agent hand to a person first?

   A. Reading a public web page
   B. Searching your own notes
   C. Canceling orders or making payments
   D. Summarizing a short text

   Answer: C. OpenAI names high-risk actions, such as canceling orders or making payments, as one of two triggers for handing control to a person.

3. Your agent loops on tool calls. What does the lesson say to set so it cannot run forever?

   A. A stop condition, such as a maximum number of iterations
   B. A longer system prompt
   C. More tools with overlapping jobs
   D. A second agent to watch the first

   Answer: A. Anthropic suggests a maximum number of iterations, and OpenAI lists exits such as a final-output tool, an error or a maximum number of turns.

4. A job is simple and its steps never change. What does the lesson advise?

   A. Build several agents to be safe
   B. Give one agent as many tools as you can
   C. Use an agent, because agents cost less
   D. Start with the simplest solution, such as a fixed workflow

   Answer: D. Anthropic says to find the simplest solution possible, because an agent's autonomy means higher costs and the potential for compounding errors.

## Frequently asked questions

### What is the difference between an AI agent and a chatbot?

A chatbot answers what you ask, and an agent decides and acts toward a goal. A chat product that has tools can sit in between, so check whether it picks its own next step.

### Is an AI agent the same as an automation workflow?

No. In a workflow your code sets the order of the steps, and in an agent the model does. Workflow tools can still contain an agent as one of their steps.

### Can I build an AI agent without coding?

Yes. In n8n an agent is one node with a chat model and tools plugged in underneath, as our post on [what n8n is](https://mindket.com/blog/what-is-n8n) explains.

### Do agents remember anything between runs?

Only if you give them a way. Claude Code's [docs](https://code.claude.com/docs/en/how-claude-code-works) say each new session starts with a fresh context window, and that learnings can carry over through auto memory and a CLAUDE.md file.

### What is a multi-agent system?

Several agents sharing one workflow. OpenAI's [agents guide](https://developers.openai.com/api/docs/guides/agents) mentions handoffs between agents, and its practical guide describes a manager agent that calls specialist agents as tools and a decentralized pattern where agents hand tasks to one another.

### Which workflow patterns does Anthropic describe?

Prompt chaining, routing, parallelization, orchestrator-workers and evaluator-optimizer. In Anthropic's terms they are workflows, where code sets the paths, and a full agent is something you add only when they fall short.

## Sources

- [Anthropic Engineering: Building effective agents](https://www.anthropic.com/engineering/building-effective-agents) (read 2026-11-04)
- [OpenAI: A practical guide to building agents](https://cdn.openai.com/business-guides-and-resources/a-practical-guide-to-building-agents.pdf) (read 2026-11-04)
- [OpenAI: Agents guide](https://developers.openai.com/api/docs/guides/agents) (read 2026-11-05)
- [Claude Code docs: How Claude Code works](https://code.claude.com/docs/en/how-claude-code-works) (read 2026-11-05)
- [Ethan Mollick on X, 3 January 2026](https://x.com/emollick/status/2007249835465072857) (read 2026-11-05)
- [YouTube: Anthropic, Tips for building AI agents](https://www.youtube.com/watch?v=LP5OCa20Zpg) (read 2026-11-05)

[Start with emails](https://mindket.com/learn/ai-for-work/write-emails-with-ai)
