An agent is an LLM in a loop with tools: it observes, reasons, acts, reads results, and repeats until it produces a final answer or a stopping condition fires.
Imagine giving a very fast intern a goal, a phone, a calculator, and a notepad. The intern reads the goal, decides one next step, picks up a tool to do that step, writes down what they learned, and then looks at the notepad again to decide what to do next. They keep going until they have an answer or they run out of time. An AI agent works the same way. The language model is the intern doing the thinking. The runtime is the office around the intern: it actually picks up the phone, runs the calculator, writes things down on the notepad, and watches the clock. The two together, taking turns over and over, are what people mean when they say agent.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
The word agent has been stretched so far in 2025 and 2026 marketing that it can mean almost anything. The technical core, though, is small and worth pinning down precisely. An AI agent is an LLM running inside a loop with tools, where the model itself decides what to do next on every turn.
This deep dive takes the one-sentence definition apart, names the parts that have to be present, and contrasts an agent against the two things people most often confuse it with: a one-shot chatbot completion and a hard-coded chain. By the end, the line between agent and not-agent should be crisp enough that you can apply it to any real system someone hands you.
The one-sentence definition, unpacked
An agent is an LLM-driven loop that observes the current state, reasons about the next step, takes an action by calling a tool or returning a final answer, reads the action's result back as a new observation, and repeats until a stopping condition fires.
Three ideas have to be present at the same time for the word agent to apply. First, there is a language model doing the deciding. The model is the part that picks the next move based on whatever has been accumulated so far. Second, there is a tool layer the model can reach. Tools let the agent act on the world beyond text generation: search the web, query a database, run code, send a message, click a button. Without tools, the model can think but cannot do anything outside its own response.
Third, there is a runtime that drives the loop. The runtime sits between the model and the tools. It receives the model's output, decides whether the model asked for a tool, executes that tool if so, packages the result as an observation, and feeds the observation back into the next model call. It also owns the stopping conditions and the budgets.
The whole point of the loop is that each turn is shaped by what happened on the previous turn. The agent is not following a fixed script. It is reacting to live information that did not exist when the task started.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- Anthropic's computer use feature: Claude Opus 4.7 decides the next click or keystroke, the harness takes the screenshot and executes the action, then loops the new screen back in.
- Cursor and Cline coding agents: the model proposes an edit, the editor runtime applies the diff and runs tests, and the test output becomes the next observation.
What an interviewer would ask next. Try answering before peeking at the approach.
QIf the model only emits text, what actually invokes a tool and how does that result get back into the prompt?
Walk through the runtime parsing a structured tool-use block, executing the matching function with the given arguments, capturing the return value as an observation, and appending it to the conversation state before the next model call.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Calling a single LLM completion an agent. A chatbot answer is not an agent; an agent requires a loop, tools, and a runtime that drives the loop until a stopping condition fires.
60 second bullets to scan on the way to the call.
Define an agent in one sentence using the observe, reason, act, repeat shape.
Name the three required pieces: model, tools, runtime.
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.