<!-- description: An AI agent is an autonomous software program that uses LLMs to plan, reason, and execute multi-step tasks by calling tools and making decisions without constant human input. -->

# Agent

An **agent** is an autonomous software program powered by a large language model (LLM) that can plan, reason, and execute multi-step tasks. Unlike a simple chatbot that responds to a single prompt, an agent operates in a loop — observing its environment, deciding what to do next, calling tools, and repeating until the goal is complete.

## How an Agent Works

Agents follow a core perceive-plan-act cycle:

1. **Perceive** — Receive a task description plus any context (files, tool results, prior conversation)
2. **Plan** — Use the LLM to reason about the next action
3. **Act** — Call a tool (read a file, run a command, send a message, call an API)
4. **Observe** — Receive the tool result and loop back to Plan

This loop continues until the agent decides the task is complete or asks a human for input.

## Agents vs. Chatbots

| Dimension | Chatbot | Agent |
|-----------|---------|-------|
| Interaction model | Single turn (Q&A) | Multi-turn autonomous loop |
| Tool access | Typically none | Files, APIs, shell, browsers |
| Memory | Stateless | Can persist state across steps |
| Goal orientation | Respond to prompt | Complete a defined objective |

## Agents in Claude Code

[Claude Code](https://docs.anthropic.com/en/docs/claude-code) is Anthropic's agentic coding assistant. It operates as an agent inside your terminal — reading files, running tests, editing code, and iterating until a task is done. Claude Code agents connect to **[AgentRQ](/)** via [MCP](mcp) to send notifications and wait for human approval before taking risky actions.

## Key Properties of a Well-Designed Agent

- **Goal-directed** — Pursues an objective rather than just responding
- **Tool-using** — Can call external systems to affect the real world
- **Self-correcting** — Detects failures and tries alternative approaches
- **Human-in-the-loop ready** — Knows when to pause and ask for guidance

## Related Terms

- [Agentic Workflow](agentic-workflow)
- [Tool Use](tool-use)
- [Human-in-the-Loop](human-in-the-loop)
- [Claude Code](claude-code)
- [Autonomous Agent](autonomous-agent)
