AI glossary

AI agent

In one sentence An AI agent is a language model that can pick and run tools in a loop until a goal is finished, instead of replying once and stopping.

By Updated

An AI agent is a language model wrapped in a loop, given tools, and left to work toward a goal until it decides the goal is met.

Picture sending someone to the market. A plain chatbot is the friend who answers "tomatoes are around forty rupees a kilo" and goes back to their phone. An agent is the friend you hand a shopping list and some money to — they walk to the shop, check what is available, swap an item that is out of stock, pay, and come home with a bag. The difference is not intelligence. The difference is being allowed to take actions and see the results.

The mechanism is a loop. The model receives the goal, writes out which tool it wants to use and with what arguments, your code actually runs that tool, and the result is appended to the conversation. Then the model looks again. Nothing mystical happens — the "thinking" is text, and the "acting" is ordinary function calls in your program.

The loop

Goal  →  Model picks a tool  →  Your code runs it  →  Result goes back in
              ↑                                              |
              └──────────────  repeat until done  ────────────┘
                                     ↓
                                  Answer

A support agent asked "why was invoice 4471 rejected?" might call search_invoices, then get_customer, then read_policy, then write one paragraph. Four tool calls, one answer.

Two things bite people in production. Every trip round the loop re-sends the whole conversation, so cost grows quickly and the context window fills up. And a wrong tool call early on sends the whole run down a bad path, so real agents need a step limit, a timeout, and a human check before anything irreversible.

Where to go next