Glossary · AI Engineering

What is an AI agent?

Short answer

An AI agent is software that uses a large language model to pursue a goal on its own: it decides which steps to take, calls tools such as APIs, search or code, looks at the results, and repeats until the task is done or it needs a person. Unlike a chatbot, it acts rather than only replying.

How an AI agent works

At its core an agent is a loop:

  1. The model reads the goal, the conversation so far and a list of available tools.
  2. It chooses an action, such as calling search_flights with some arguments, or decides it is finished.
  3. Your code runs the tool and returns the result to the model.
  4. The loop repeats until the goal is met, a step limit is reached, or a person must approve something.

Tools are often provided through tool calling or an MCP server; memory and planning are added around this loop.

Agent or workflow?

If you can draw the steps in advance (“extract the invoice, validate it, post it to the ledger”), a workflow that calls a model at fixed points is cheaper, faster and easier to test. Use an agent when the path genuinely depends on what it finds along the way, such as investigating a support case across several systems.

Designing agents that are safe to run

  • Give each agent the narrowest set of tools and permissions it needs.
  • Cap steps, time and cost per run.
  • Require human approval for irreversible actions: payments, emails, deletions.
  • Log every tool call with its inputs and outputs for review.

Frequently asked questions

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

A chatbot answers messages. An agent works towards a goal: it plans steps, calls tools and acts on the results, often across several systems, with a chat window being optional.

Published · Updated · By · All terms

Go deeper