What is an AI Agent?
An AI agent is a language model that doesn't just answer — it decides what to do, takes actions with tools, sees the results, and keeps going until a goal is achieved.
Explain like I'm new to AI
A normal LLM chat is one turn: you ask, it answers. An AI agent is different — it's an LLM given a goal, a set of tools, and permission to work in a loop until the goal is done.
Instead of "here's an answer," an agent thinks: "What do I need to do? Let me use this tool… okay, that result changes things… now let me do the next step…" — repeating until finished.
The LLM is the brain; tools are its hands; the loop is what makes it act, not just talk.
Mental model
- Plain LLM = a knowledgeable person answering a question from memory.
- Agent = that same person given a to-do list, a computer, and a phone, told "get this done," who then looks things up, makes calls, and checks their work until the task is complete.
How it works
An agent needs four ingredients:
- A model (the brain) — an LLM that reasons and decides.
- Tools (the hands) — functions it can call: search, code, APIs, databases (see function calling).
- A loop — it acts, observes the result, and decides the next action, over and over.
- A goal + stopping condition — what "done" means, and limits so it doesn't run forever.
Each turn, the model chooses: call a tool, or finish. That autonomy is the defining feature.
Real-world example
You ask an agent: "Find three well-reviewed Italian restaurants near me open tonight and put them in a table." It searches the web, checks hours, filters by rating, and formats a table — several tool calls and decisions, not a single canned reply. A coding agent does the same to fix a bug: read files, run tests, edit code, re-run tests, repeat.
Technical explanation
An agent is an LLM embedded in a control loop where the model's output can be a tool call (structured, via function calling) rather than final text. The loop feeds tool results back into the context as new observations, so the model conditions each decision on accumulated evidence. Key design concerns: tool design, memory/state, stopping conditions (max steps, budget), error handling, and guardrails/permissions (agents take real actions, so a bad decision has real consequences). Autonomy exists on a spectrum — from a single tool-augmented call to fully self-directed multi-step systems.
Common mistakes
Thinking an agent is a smarter model. It's usually the same model plus a loop and tools. The capability jump comes from letting it act and iterate, not from extra intelligence.
- Giving an agent powerful tools without permission checks or step limits.
- Using an agent when a single prompt or a fixed workflow would be cheaper and more reliable.
When to use it
- Open-ended, multi-step tasks where the needed steps aren't known in advance and depend on intermediate results.
When NOT to use it
- Simple, one-shot tasks (just prompt the model) or well-defined pipelines (use a fixed workflow — cheaper and predictable).
Alternatives
- Plain prompting for single answers; fixed workflows for known step sequences; RAG when you just need grounded facts.
Quick quiz
Related concepts
- The Agent Loop — The agent loop is the cycle of observe, reason, plan, and act that repeats — using tools and results — until the agent reaches its goal.
- What is Function Calling (Tool Use)? — Function calling lets an LLM request that your code run a real tool by emitting a structured call, then use the result to answer.
- Multimodal Agents — A multimodal agent uses the same observe-reason-act loop — screenshots and mics are observations, with extra injection risk.
- Design a Customer-Support Agent — Support is identity, policy RAG, a structured action preview, and a human or policy gate — task success is a correctly resolved ticket, not a thumbs-up.
- Design a Coding Agent — A coding agent explores with repo tools, patches, and verifies in a sandbox — tests are the judge, the PR is HITL, and the repository is not a paste into the window.
Last reviewed: 2026-09-04 · Written by ByHeart AI · Reviewed by ByHeart AI