Bookmarks

AI agent

A program in which a language model drives a task step by step on its own: it chooses actions, calls tools and evaluates the results until the goal is achieved.

Also: LLM agent, language model agent, autonomous agent

checked 18 Nov

All terms

An ordinary chat model answers a single message and stops there. An AI agent receives the whole task and decides for itself what to do next: break the work into steps, call the right tool, look at the intermediate result and adjust the plan if needed. This is how multi-step processes are automated — handling requests, triaging incidents, maintaining code.

What it consists of

  • The model — the “brain” that understands the task, plans and decides which action comes next; usually a large language model (LLM).
  • Tools — actions outside the model: search, an SQL query to a database, an API call, running code, reading files.
  • Memory — what the agent has already done and learned: the history of steps, search results, intermediate files.
  • The orchestrator — the code that runs the “model → action → result” loop: developers write this logic, not the model itself.

The action loop

Every agent step looks the same: the model receives the task and the current state, decides on the next action, the orchestrator executes it and returns the real result to the model — tool output, an API response, the log of a code run. Based on this response the model assesses progress and decides what to do next. The loop repeats until the model decides the goal has been reached — or until a stopping condition triggers, such as a step limit.

jsonOne agent step: the model chose the tool and arguments, the orchestrator returned the result
{  "step": 3,  "thought": "order 42 is not in the main database, checking the archive",  "tool": "sql",  "arguments": {"query": "SELECT status FROM orders_archive WHERE id = 42"},  "result": "order found, status = cancelled"}

How much freedom the agent gets

Agency is not a switch but a scale: the more decisions are handed to the model, the more flexible the system — and the more expensive and unpredictable. If the path to the solution is known in advance, a rigid workflow with the steps written in code is more reliable.

LevelWhat the model decidesExample
Single requestnothing: it answers straight away, with no actionsquestion — answer in a chat
Workflownothing along the way: the steps are fixed in code in advanceRAG pipeline: search → reranking → answer
Agentic loopwhich steps to take and when to stopprocess a product return according to the shop’s rules
Multi-agent systemhow to distribute the work between agentsa coordinator assigns tasks to a coder agent and a reviewer agent

Risks

  • Errors accumulate: one wrong step spoils all the steps after it, so agents are tested in an isolated environment and given limited permissions.
  • Every step is a paid model call, and the number of steps is unknown in advance: without a limit the task may never finish.
  • Hallucinations and prompt injection do not disappear: the results of an agent’s actions should be checked, and tools should be given only the data and permissions they need.

Sources

the term is written from these pages

Verified 18 Nov

Not to be confused with

what it is mixed up with and how it differs

  • LLMlarge language model

    An LLM generates text for a single request; an agent wraps it in a loop where the model also chooses tools and the next steps.

  • RAGretrieval-augmented generation

    RAG is a technique within a single step: find documents and answer from them; the agent decides for itself when such a search is needed.