Skip to content

How to Create an AI Agent is published by General Action, the company that makes Emdash. When we recommend Emdash, we are recommending our own product. About this site

What is an AI agent?

An AI agent is a language model that is given tools and run in a loop, where the model itself decides which tool to call next and when the task is finished. Take away the tools and you have a chatbot. Take away the model’s control of the next step and you have a workflow.

That definition is deliberately mechanical. It tells you exactly what you have to build.

The model is a large language model reached through an API. It reads text and writes text. On its own it cannot look anything up or change anything.

Tools are functions that your program offers to the model: search a folder, query a database, send a message. Each has a name, a description and a list of inputs. The model cannot run them. It can only ask, by replying with a structured request that names a tool and its inputs. Tools and MCP covers the mechanics.

The loop is a few lines of ordinary code. It sends the task to the model, runs whichever tool the model asks for, appends the result to the conversation and calls the model again. It ends when the model replies with an answer instead of a request.

Anthropic’s engineering team puts it this way in Building effective agents: agents “are typically just LLMs using tools based on environmental feedback in a loop.”

Suppose the agent has two tools, search_notes and read_note, and is asked: “When is the launch, and why did the date change?”

  1. Your code sends the question and the two tool descriptions to the model.
  2. The model replies with a request: call search_notes with the query “launch”.
  3. Your code runs the search and sends back a file name, standup.txt.
  4. The model replies with a second request: call read_note on standup.txt.
  5. Your code reads the file and sends back its text.
  6. The model now has what it needs and replies with the answer in plain language. The loop ends.

Nobody told the model to search first and read second. It worked that out from the tool descriptions and the result of step 3. That choice is what makes this an agent. The same example, as running code, is in Build an AI agent in Python.

The wording varies. The substance is consistent.

Source Definition, in its own words
Anthropic, Building effective agents Workflows are “systems where LLMs and tools are orchestrated through predefined code paths”. Agents are systems where the model directs its own process and tool use.
Claude Agent SDK documentation “An agent is an application that completes a task by planning its own steps and calling tools that read files, run commands, or edit code.”
OpenAI, Agents guide “Agents can plan and complete tasks using tools, work with other agents, and maintain context across steps.”
Google Cloud, What are AI agents? “AI agents are software systems that use AI to pursue goals and complete tasks on behalf of users.”

Quotes were checked against each page on 13 November 2026. Google’s page adds a useful scale of autonomy: bots follow pre-programmed rules, assistants act with the user directing each step, and agents make decisions on their own to reach a goal.

Question Chatbot Workflow Agent
Who chooses the next step You, with each message Your code The model
Can it act on other systems No, it only writes text Yes, at the points your code allows Yes, through its tools
Number of steps One per message Fixed in advance Unknown until it runs
Predictability High High Lower
Cost per task Lowest Known in advance Varies from run to run
Suits Questions, drafting Repeatable pipelines such as “extract, then translate, then file” Open-ended tasks such as research, investigation or triage

The boundaries blur in practice. A workflow can contain one step that is a small agent, and an agent can call a tool that is a fixed workflow. Anthropic groups both under the label “agentic systems” and treats the split between workflows and agents as the architectural choice that matters.

Agents trade speed and cost for flexibility. Each step is another paid model request, and each is another chance for an error that the following steps build on. Choose something simpler when:

  • The steps are always the same. Write a workflow. It will be faster and you can test each stage alone.
  • A mistake is expensive and hard to reverse. Keep a person or fixed code in charge of the decision, and let the model draft.
  • One good prompt already does it. Anthropic’s guide notes that for many applications a single well-built model call is enough.

Choose an agent when you cannot write the steps down in advance, when the task is valuable enough to justify the extra requests, and when a wrong result can be caught by a test, a review or an undo.

You may already have used one. Coding agents such as Claude Code and Codex are agents in exactly this sense: a model, tools for reading files and running commands, and a loop. The Claude Agent SDK documentation describes itself as giving you the same tools and agent loop that power Claude Code.

This matters for a practical reason. Before building an agent, check whether one already exists for the job. If none fits, the eight steps on the home page take you from a job description to a deployed agent, and Testing and guardrails covers how to keep its autonomy within limits you set.

Frequently asked questions

What is an AI agent in simple terms?

An AI agent is a program in which a language model is given a goal and a set of tools, and is allowed to decide which tool to use next, look at the result, and keep going until the goal is met. The model does the deciding, and ordinary code does the acting.

Is ChatGPT or Claude an AI agent?

The underlying models are not agents on their own. The chat apps built on them behave as agents whenever the model is given tools and left to choose among them, for example when web search is switched on and the model decides what to look up and whether to look again. A plain exchange of text with no tools is a chatbot.

What is the difference between an AI agent and a workflow?

In a workflow, your code fixes the order of the steps and the model fills in each one. In an agent, the model chooses the steps. Workflows are more predictable and cheaper, and agents handle tasks whose steps cannot be known in advance.

Does an AI agent need memory?

Not beyond the conversation it is already holding. Within one run, the agent sees every earlier message and tool result, which is a working short-term memory. Memory that lasts between runs is an optional extra, usually built as a tool that reads and writes a file or database.

Are AI agents autonomous?

Only as far as you allow. The model chooses actions, but your code decides which tools exist, what each can touch, how many steps a run may take and which actions need a person to approve them first.