AI Agent
What is it?
An AI agent is a system that uses a language model to plan and take actions toward a goal, calling tools and reacting to results rather than just replying once.
Explain like I'm 5
Why was it created?
A single model response can't complete multi-step tasks. Agents were created to let models plan, use tools, and act over several steps to accomplish real goals.
Where is it used?
- Coding assistants that run and fix code
- Research and data-gathering tasks
- Workflow automation
- Customer support that takes actions
Why should developers care?
Agents are a fast-growing way to build AI features that do work, not just chat — increasingly relevant for developers building products.
How does it work?
The agent loops: the model decides on an action (often calling a tool), the action runs, and the result is fed back. It repeats this observe-decide-act cycle until the goal is met or it stops.
Real-world example
Given 'fix this failing test', a coding agent reads the code, runs the test, sees the error, edits the file, and reruns until the test passes.
Common use cases
- Multi-step task automation
- Tool-using assistants
- Coding and debugging help
- Information gathering and synthesis
Advantages
- Completes multi-step tasks
- Can use external tools and data
- Adapts based on results
- Automates real workflows
Disadvantages
- Can take wrong or costly actions
- Harder to predict and debug
- Errors can compound over steps
- Needs guardrails and oversight
When should you use it?
When a task needs planning, tool use, and several steps rather than a single answer.
When should you avoid it?
For simple one-shot questions where a direct model response is enough and safer.
Alternatives
Related terms
Interview questions
Beginner
- What makes an AI agent different from a chatbot?
- What is a tool in this context?
Intermediate
- What is the observe-decide-act loop?
- Why do agents need guardrails?
Senior
- How would you limit the blast radius of an agent's actions?
- How do you evaluate an agent's reliability?
Common misconceptions
- "An agent is just a chatbot" — it takes actions and uses tools over multiple steps, not just one reply.
- "Agents are fully autonomous and safe" — they can make mistakes and usually need limits and oversight.
Fun facts
- Agents often connect to tools through standardized interfaces so they can act in the real world.
- Letting an agent call functions is what turns a chat model into a doer.
Timeline
- 2020s — Tool-using LLM agents emerge as a major pattern
Learning resources
Quick summary
An AI agent uses a language model to plan, call tools, and act over multiple steps toward a goal — doing work, not just chatting.
Cheat sheet
- LLM that plans and acts
- Uses tools in a loop
- Observe → decide → act
- Needs guardrails and oversight