> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# What is an Agent

> Explains what AI agents are, their perceive reason act loop, how they differ from single LLM calls, and the capabilities and limits using Zippy and OpenClaw examples.

# What is an Agent?

Lesson 13

Meet Zippy — a personal assistant agent and the example agent we’ll build across these lessons.

An AI agent is an LLM that operates in a decision loop: it observes the environment, reasons about next steps, and invokes tools or actions to accomplish a goal. Unlike a single prompt/response interaction, an agent pursues multi-step objectives autonomously and adapts to feedback.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/z7NmHsFQN9LCEiD0/images/AI-Agents-for-Beginners-OpenClaw-Case-Study/Building-AI-Agents/What-is-an-Agent/retro-ai-agent-llm-tools-zippy.jpg?fit=max&auto=format&n=z7NmHsFQN9LCEiD0&q=85&s=0587dd45de72e488301ca4751e2c9472" alt="A retro-style graphic reading &#x22;AN AI AGENT IS AN LLM THAT...&#x22; with four colored button boxes labeled &#x22;RUNS IN A LOOP,&#x22; &#x22;USES TOOLS,&#x22; &#x22;PURSUES A GOAL,&#x22; and &#x22;DECIDES ITS OWN STEPS.&#x22; A small yellow robot icon labeled &#x22;ZIPPY&#x22; appears in the top-right corner." width="1920" height="1080" data-path="images/AI-Agents-for-Beginners-OpenClaw-Case-Study/Building-AI-Agents/What-is-an-Agent/retro-ai-agent-llm-tools-zippy.jpg" />
</Frame>

Anthropic summarizes this clearly: agents are LLMs that use tools and act based on environmental feedback in a loop. This loop is the core pattern powering flexible, goal-directed behavior.

How agents work — the loop

* The user gives a goal or task.
* The agent (LLM) observes the current context and available data.
* It reasons about the next action.
* It calls a tool or performs an action.
* It observes the result and decides whether the task is complete.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/z7NmHsFQN9LCEiD0/images/AI-Agents-for-Beginners-OpenClaw-Case-Study/Building-AI-Agents/What-is-an-Agent/agent-loop-user-task-llm-result.jpg?fit=max&auto=format&n=z7NmHsFQN9LCEiD0&q=85&s=ec1377b8666c2f56fa83a39cbbdfae1b" alt="A neon-style diagram titled &#x22;THE AGENT LOOP.&#x22; It shows a flow from &#x22;USER TASK (gives a goal)&#x22; to &#x22;LLM THINKS (decide next step)&#x22; to &#x22;CALL TOOL (execute action)&#x22; and &#x22;GET RESULT (observe outcome)&#x22; forming a loop." width="1920" height="1080" data-path="images/AI-Agents-for-Beginners-OpenClaw-Case-Study/Building-AI-Agents/What-is-an-Agent/agent-loop-user-task-llm-result.jpg" />
</Frame>

Callout: core cycle

<Callout icon="lightbulb" color="#1CB2FE">
  Agents operate on a continuous perceive → reason → act cycle: they gather inputs, decide which tool or step to take, act, then re-evaluate based on results.
</Callout>

Perceive → Reason → Act

* Perceive: collect user input, tool outputs, and conversation history.
* Reason: choose which tool or pathway best advances the goal.
* Act: call the chosen tool or emit a response.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/z7NmHsFQN9LCEiD0/images/AI-Agents-for-Beginners-OpenClaw-Case-Study/Building-AI-Agents/What-is-an-Agent/perceive-reason-act-loop-infographic.jpg?fit=max&auto=format&n=z7NmHsFQN9LCEiD0&q=85&s=c6fca53145e0a05c29d7f0999b9c668e" alt="An infographic showing a loop labeled &#x22;Perceive → Reason → Act,&#x22; with two highlighted boxes: &#x22;Perceive&#x22; (user input, tool results, conversation history) and &#x22;Reason&#x22; (which tool to call, what parameters to use, whether the goal is complete)." width="1920" height="1080" data-path="images/AI-Agents-for-Beginners-OpenClaw-Case-Study/Building-AI-Agents/What-is-an-Agent/perceive-reason-act-loop-infographic.jpg" />
</Frame>

Agent vs single LLM call vs fixed workflow

* Single LLM call: one-shot prompt → response. No ongoing decision-making.
* Fixed workflow: a developer-defined sequence of steps; deterministic and rigid.
* Agent: runs in a loop with the LLM deciding which tools to call and when, enabling dynamic, goal-directed behavior.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/z7NmHsFQN9LCEiD0/images/AI-Agents-for-Beginners-OpenClaw-Case-Study/Building-AI-Agents/What-is-an-Agent/single-llm-fixed-workflow-agent-loop.jpg?fit=max&auto=format&n=z7NmHsFQN9LCEiD0&q=85&s=c84e397e638d6e77481c7652432ef76c" alt="An infographic titled &#x22;What makes an agent different?&#x22; comparing three setups: a single LLM call (prompt → response), a fixed multi-step workflow, and an agent that runs in a loop with the LLM making decisions and controlling actions." width="1920" height="1080" data-path="images/AI-Agents-for-Beginners-OpenClaw-Case-Study/Building-AI-Agents/What-is-an-Agent/single-llm-fixed-workflow-agent-loop.jpg" />
</Frame>

Quick comparison table

| Approach | Behavior | Example |
| - | -: | - |
| Single LLM call | One-step prompt/response | `Prompt: "Summarize this article."` |
| Fixed workflow | Predefined developer steps | `Step 1 → Step 2 → Step 3` |
| Agent (LLM-driven) | Dynamic, feedback-driven loop | `Search → Evaluate → Retry if needed → Act` |

Adaptability — what makes agents powerful

* If a tool call fails, an agent can switch strategies.
* If additional information is required, the agent can search or ask clarifying questions.
* This adaptability is essential for open-ended or failure-prone tasks.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/z7NmHsFQN9LCEiD0/images/AI-Agents-for-Beginners-OpenClaw-Case-Study/Building-AI-Agents/What-is-an-Agent/agent-adaptability-retro-infographic-goal-pursuit.jpg?fit=max&auto=format&n=z7NmHsFQN9LCEiD0&q=85&s=1a1364df649d6e1b0ea8da8c82ffe9f4" alt="A retro-styled infographic that reads &#x22;The agent doesn't just follow instructions. It pursues a goal.&#x22; It shows problem boxes like &#x22;Tool call fails&#x22; and &#x22;Needs more information&#x22; with corresponding agent adaptations (&#x22;Try a different approach,&#x22; &#x22;Decides to search for it&#x22;) and a highlighted &#x22;ADAPTABILITY&#x22; section." width="1920" height="1080" data-path="images/AI-Agents-for-Beginners-OpenClaw-Case-Study/Building-AI-Agents/What-is-an-Agent/agent-adaptability-retro-infographic-goal-pursuit.jpg" />
</Frame>

Concrete example: booking a restaurant

User request:
"Find me a good Italian restaurant nearby and book a table for two on Thursday evening."

A competent agent (Zippy) can autonomously:

* Search for nearby Italian restaurants.
* Evaluate results and check availability at top options.
* If the first choice is booked, try the next-best.
* Check the user’s calendar for conflicts.
* Make the reservation once conditions are satisfied.

Example agent log:

```text theme={null}
A CONCRETE EXAMPLE

YOU ASK ZIPPY:

"Find me a good Italian restaurant nearby and book
a table for two on Thursday evening."

AGENT LOG:

🔍 Searching Italian restaurants nearby...
📋 5 results found
⭐ Checking #1: Trattoria Roma ★★★★★
❌ Trattoria Roma - FULLY BOOKED
❓ ADAPTS — TRIES NEXT OPTION
⭐ Checking #2: Bella Cucina ★★★★
✅ Bella Cucina - 7:30 PM AVAILABLE
🗓 Checking your calendar for Thursday...
✅ Calendar clear — RESERVATION CONFIRMED
```

No single developer-scripted sequence enumerated these exact steps — Zippy decided them at runtime based on observations. That autonomy is the meaningful distinction from a simple chatbot.

Current capabilities and limits

Zippy today is a capable general assistant: he can check calendars, search the web, send emails, and complete many everyday tasks. However, Zippy is intentionally bounded in some areas:

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/z7NmHsFQN9LCEiD0/images/AI-Agents-for-Beginners-OpenClaw-Case-Study/Building-AI-Agents/What-is-an-Agent/zippy-right-now-capabilities-limits.jpg?fit=max&auto=format&n=z7NmHsFQN9LCEiD0&q=85&s=d7b811afb941640900f6a6c773500c91" alt="An infographic titled &#x22;Zippy Right Now&#x22; showing green boxes of what Zippy can do (check your calendar, search the web, send emails) and red boxes listing limits (no deep knowledge, no code execution, no memory). A teal banner at the bottom reads &#x22;Design Boundaries.&#x22;" width="1920" height="1080" data-path="images/AI-Agents-for-Beginners-OpenClaw-Case-Study/Building-AI-Agents/What-is-an-Agent/zippy-right-now-capabilities-limits.jpg" />
</Frame>

Table: Zippy — capabilities vs design boundaries

| Category | Details |
| - | - |
| Capabilities | Check calendar, search web, send email, book reservations (when integrated with services) |
| Design boundaries | Limited depth for long-form research, no code execution without a sandbox/tool, no persistent memory between sessions unless integrated |

<Callout icon="warning" color="#FF6B6B">
  These limits are intentional safeguards and design choices. You can extend capabilities later by integrating specialist tools, execution environments, or persistent memory systems.
</Callout>

OpenClaw case study

OpenClaw is a production personal-assistant agent used as our running case study. It runs on user devices and integrates with messaging channels like [WhatsApp](https://www.whatsapp.com), [Telegram](https://telegram.org), and [Slack](https://slack.com). OpenClaw implements the perceive → reason → act loop: it ingests messages, reasons about which tools to call, executes them, and replies with results.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/z7NmHsFQN9LCEiD0/images/AI-Agents-for-Beginners-OpenClaw-Case-Study/Building-AI-Agents/What-is-an-Agent/openclaw-ai-messaging-perceive-reason-act.jpg?fit=max&auto=format&n=z7NmHsFQN9LCEiD0&q=85&s=4845879f823aa9ccda9c8e252af589c7" alt="A retro-style infographic for &#x22;OPENCLAW,&#x22; a production AI agent that runs on devices and connects to messaging channels like WhatsApp, Telegram, and Slack. It shows a perceive → reason → act workflow: perceive reads messages, reason picks the tool, and act executes and replies." width="1920" height="1080" data-path="images/AI-Agents-for-Beginners-OpenClaw-Case-Study/Building-AI-Agents/What-is-an-Agent/openclaw-ai-messaging-perceive-reason-act.jpg" />
</Frame>

Summary (key takeaways)

* An agent is an LLM running continuously in a loop to pursue goals.
* It perceives inputs, reasons about the next action, and acts by calling tools or generating responses.
* The agent’s ability to adapt and choose its own steps — rather than following a pre-scripted workflow — is the defining characteristic.
* Design boundaries are intentional and can be extended by integrating tools, execution environments, or memory systems.

Further reading and references

* [Anthropic — Agents](https://www.anthropic.com)
* [WhatsApp](https://www.whatsapp.com)
* [Telegram](https://telegram.org)
* [Slack](https://slack.com)

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/ai-agents-for-beginner-openclaw-case-study/module/d77598d4-d1d3-4768-97da-03ead60bf984/lesson/86afb6aa-92a0-4c1a-b358-b0e2c7058061" />

  <Card title="Practice Lab" icon="flask-conical" cta="Learn more" href="https://learn.kodekloud.com/user/courses/ai-agents-for-beginner-openclaw-case-study/module/d77598d4-d1d3-4768-97da-03ead60bf984/lesson/7cf331e3-70cc-42f8-88c7-c32f60c6bb4d" />
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.