What Is an Agent: An LLM Running Tools in a Loop
Starting from the Confusion
Section titled “Starting from the Confusion”“Agent” is one of the most overloaded words in AI. In some contexts it means a simple chatbot; in others it means a fully autonomous system that writes and deploys its own code. Clearing up that confusion requires decomposing the definition into the smallest possible units.
Anthropic’s production guide puts it this way: “An agent is just an LLM using tools in a loop based on environmental feedback.” Solomon Hykes frames it similarly: “An AI agent is an LLM using its environment in a loop.” Simon Willison compresses it to: “An LLM agent runs tools in a loop to achieve a goal.”
Three keywords appear in all three definitions: tool, loop, and environmental feedback. Without all three, the system is not an agent. With all three, it is. A simple criterion — but a powerful one.
The Augmented LLM: Building Block of Agentic Systems
Section titled “The Augmented LLM: Building Block of Agentic Systems”Lilian Weng’s June 2023 survey “LLM Powered Autonomous Agents” introduced the concept of a three-capability-augmented LLM as the core unit of agentic architectures.
┌─────────────────────────────────────────────────────────┐│ Augmented LLM ││ ││ ┌───────────────┐ ┌───────────────┐ ┌───────────┐ ││ │ Retrieval │ │ Tool Use │ │ Memory │ ││ │ (RAG) │ │ │ │ Store │ ││ │ │ │ │ │ │ ││ │ External │ │ External │ │ Persistent│ ││ │ knowledge │ │ actions │ │ state │ ││ └──────┬────────┘ └──────┬────────┘ └─────┬─────┘ ││ │ │ │ ││ └──────────────────┴──────────────────┘ ││ │ ││ ┌─────▼─────┐ ││ │ LLM │ ← reason, plan, ││ └───────────┘ generate │└─────────────────────────────────────────────────────────┘-
Retrieval — The ability to pull in up-to-date information or large corpora that do not fit in the model’s parameters, using vector search or keyword lookup at runtime.
-
Tool Use — The ability to execute code, read and write files, call external APIs, and do anything beyond text generation. This is what transforms the loop from a text conversation into real action.
-
Memory — Short-term: the scratchpad of the current context window. Long-term: persistent state written to files or external databases so that progress is not lost across iterations.
Anthropic calls the Augmented LLM the “building block” of agentic systems. It is useful on its own; combined with other augmented LLMs, it becomes the foundation for far more complex architectures.
Is It an Agent? A Decision Checklist
Section titled “Is It an Agent? A Decision Checklist”| Question | Yes | No |
|---|---|---|
| Does the model call tools? | Agent candidate | Plain LLM call |
| Do tool results feed back into the next model call? | Loop exists | More like a pipeline |
| Does the model itself decide when to stop? | Has autonomy | Rule-based workflow |
| All three? | Agent | A different category |
A few edge cases worth examining:
- RAG-only call: retrieve → generate → done. No loop. Not an agent.
- Single tool call with no follow-up: the tool fires once, the loop ends. Still not an agent.
- Code execution whose output is added back to context for a new model call: a loop exists. That is an agent.
Why “Loop” Is the Central Word
Section titled “Why “Loop” Is the Central Word”Without a loop there is no feedback, and without feedback there is no correction. Single-shot reasoning commits to one answer. The loop cycles through “act → observe → reason” repeatedly, converging on the goal incrementally. The code below shows the structural difference.
This is illustrative pseudocode; actual API signatures differ.
# Plain LLM call — no loopdef single_shot(prompt: str) -> str: response = model.generate(prompt) return response.text
# Minimal agent — loop presentdef minimal_agent(task: str, tools: list) -> str: messages = [{"role": "user", "content": task}]
while True: response = model.generate(messages, tools=tools)
# Model declares completion — exit the loop if response.stop_reason == "end_turn": return response.text
# Execute tools and feed results back (the feedback loop) for tool_call in response.tool_calls: result = execute_tool(tool_call) messages.append({"role": "tool", "content": result})The while True block in minimal_agent is the loop. It runs until the model returns end_turn, feeding tool results back on each iteration. That single pattern is the line that separates an agent from a plain LLM call.
Locking in the Definition
Section titled “Locking in the Definition”From this point forward, “agent” on this site always means: an LLM-based system that executes tools inside a loop and uses the results as new context for continued reasoning. Retrieval, memory, code execution, and file manipulation all fit within that definition. Toolless conversation or a one-shot function call do not.
The next chapter examines the difference between a workflow — where control flow is fixed in code — and an agent — where the model decides the control flow at runtime.
References
- Anthropic — Building Effective AI Agents — accessed 2026-06-30
- Simon Willison — An LLM agent runs tools in a loop to achieve a goal — accessed 2026-06-30
- Lilian Weng — LLM Powered Autonomous Agents — accessed 2026-06-30