Skip to main content

AI Agent

Updated 3 min read

Share this page

Send the link, quote the definition with a link back, or show it as a card on your own site.

https://softwaredictionary.org/terms/ai-agent

In short

An AI agent is a system that uses an LLM to plan and carry out multi-step tasks by deciding which tools to call, observing the results, and acting again.

What is an AI agent?

An AI agent is software that doesn't just answer a single question but works toward a goal over several steps. It combines a language model with tools, such as web search, a code runner, a database query, or an internal API, and lets the model decide which tool to use next. For example, a coding agent can read files, edit code, run the tests, and keep fixing errors until the tests pass.

Most agents run a simple loop. The model receives the goal and a list of available tools, then either replies with a final answer or requests a tool call with specific arguments, usually as structured JSON. The application runs the tool, adds the result to the conversation, and calls the model again, repeating until the task is done or a step limit is reached. This ability of a model to request tool calls is often called tool use or function calling.

A useful analogy is the difference between a travel guidebook and a travel assistant. A chatbot tells you how to book a flight, while an agent can search for flights, compare prices, and fill in the booking form for you. Agents are used for coding assistance, customer support, research, data analysis, and automating repetitive workflows.

An AI agent is not the same as a chatbot or a fixed automation script. A chatbot only responds with text, and a script follows steps a developer wrote in advance, while an agent chooses its own steps at run time. That flexibility brings risks, so production systems limit an agent's permissions, cap the number of steps, log every action, and ask a human to approve anything important.

Key takeaways

  • An AI agent uses an LLM to decide on and carry out a sequence of actions.
  • It works in a loop: choose an action, call a tool, observe the result, repeat.
  • Tools give the agent abilities such as searching, running code, or calling APIs.
  • Agents choose their steps at run time, unlike fixed automation scripts.
  • Limit permissions and require human approval for risky actions.

Example

A minimal agent looptypescript
// llm and tools are placeholders for a real model client and your tool functions
async function runAgent(goal: string, maxSteps = 10): Promise<string> {
  const messages = [{ role: "user", content: goal }];

  for (let step = 0; step < maxSteps; step++) {
    const reply = await llm.chat(messages, { tools: Object.keys(tools) });
    if (reply.type === "answer") return reply.text; // the task is done

    // The model asked for a tool call: run it and feed the result back
    const result = await tools[reply.tool](reply.args);
    messages.push({ role: "tool", content: JSON.stringify(result) });
  }
  return "Stopped: step limit reached";
}

Readers ask

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

A chatbot answers messages with text, while an AI agent can take actions by calling tools, such as searching, editing files, or sending requests to APIs. Agents also work through multiple steps on their own until a goal is reached.

What is tool calling?

Tool calling, also called function calling, is when a model responds with a structured request to run a specific function with specific arguments instead of plain text. The application executes the function and returns the result to the model.

Are AI agents safe to use?

They can be, with guardrails. Give agents only the permissions they need, cap how many steps they can take, log their actions, and require human approval for anything destructive or expensive, such as deleting data or making payments.

Often compared

See also

Spotted a mistake or something missing on this page?Suggest an edit

Read a random page
Open today's review
Switch to the dark theme
Read this page in Türkçe

More

Settings