User goal
"book me a flight"
Model thinks
plans next action
Tool call
search_flights(...)
Tool result
fed back as text
Repeat or answer
loop until done
A base LLM only does one thing: given some text, predict more text. An agent is a base LLM wrapped in a loop that lets it also *act* on the world — search the web, run code, query a database, send an email — by emitting a structured request for a tool call, having that tool actually executed outside the model, and reading the result back in as new context before deciding what to do next.
- Tool / function calling — the model outputs a structured request (e.g. JSON naming a function and its arguments) instead of, or alongside, a normal reply.
- Agent loop — the repeated cycle of the model observing state, deciding an action, and receiving the outcome, until it decides the task is finished.
- ReAct — a prompting pattern that interleaves *reasoning* traces ('I should search for X') with *actions* (the actual tool call), which noticeably improves reliability over acting silently.
- Orchestration / agentic framework — libraries (LangChain, LlamaIndex agents, OpenAI's Assistants/Responses API) that manage the loop, tool schemas, and memory for you.
The reason this exploded in popularity around 2023–2024 is that models got reliable enough at *following a schema* (emit exactly this JSON shape) to make automated execution safe-ish, and providers started training models specifically to know *when* to call a tool versus just answering directly.
- Agents let LLMs answer questions requiring fresh or private information (search, internal APIs) they were never trained on.
- They let LLMs perform multi-step tasks — booking, coding, data analysis — where the answer only emerges after several actions.
- The failure modes are new too: calling the wrong tool, hallucinating arguments, looping forever, or taking an irreversible action (sending a real email) based on a wrong plan.
Think of an agent as three separable pieces: (1) a way for the model to *express* an action (the tool schema/interface), (2) a harness that executes actions and reports results, (3) a stopping condition so the loop knows when to hand control back to the user. Later layers unpack how each piece actually works.