What Are AI Agents?
An AI agent is a system that uses a language model to decide what actions to take in pursuit of a goal. Unlike a simple chatbot that generates text, an agent can observe its environment, make decisions, and take actions through tools.
The Agent Loop
Every agent follows the same core loop:
while not done:
observation = perceive(environment)
plan = reason(observation, goal)
result = act(plan, tools)
done = evaluate(result, goal)
- Perceive — gather context (files, APIs, user input)
- Reason — decide what to do next
- Act — execute a tool or function call
- Evaluate — check if the goal is met
Levels of Agency
Not all agents are the same. There's a spectrum:
| Level | Description | Example |
|---|---|---|
| L0 | No tools, text only | Basic chatbot |
| L1 | Single tool use | Code formatter |
| L2 | Multi-step tool use | Code reviewer that reads, analyzes, comments |
| L3 | Autonomous planning | Debugging agent that reproduces, diagnoses, fixes |
| L4 | Multi-agent orchestration | Team of agents coordinating on a project |
Key Properties
- Tool access — agents need functions they can call (file I/O, APIs, shell commands)
- Memory — persistent state across turns lets agents build context
- Autonomy — the degree to which an agent acts without human confirmation
- Grounding — agents work best when they can verify their outputs against real data
When to Use Agents
Agents shine when tasks are iterative and verifiable. A task like "find and fix the bug causing test failures" is perfect — the agent can run tests, read errors, make changes, and verify the fix. Tasks that are purely creative or ambiguous are harder to delegate.