A→Z
A2ZAI
Back to AI 101
Lesson 12 of 15
intermediateapplications

AI Agents Explained

Autonomous AI systems that take action

5 min read
Share:

AI Agents Explained

AI agents are the next frontier—systems that don't just respond to queries but autonomously plan and execute multi-step tasks.

What Is an AI Agent?

An AI agent is:

  • An LLM that can use tools
  • That can plan sequences of actions
  • That operates in a loop until a goal is achieved
  • With varying degrees of autonomy

Chatbot: Answer questions Agent: Complete tasks

The Agent Loop

Goal: "Book a flight to Tokyo next week"
         ↓
    [Plan]: Search flights → Compare options → Book best one
         ↓
    [Act]: Call flight search API
         ↓
    [Observe]: Got 5 options
         ↓
    [Think]: Option 3 looks best - good time, reasonable price
         ↓
    [Act]: Call booking API
         ↓
    [Observe]: Booking confirmed
         ↓
    [Done]: Return confirmation to user

This loop—Plan → Act → Observe → Repeat—is the core of agentic AI.

Tool Use: The Foundation

Agents need tools to interact with the world:

Common tools:

  • Web search
  • Code execution
  • File read/write
  • API calls
  • Database queries
  • Browser control

How it works:

  1. LLM decides which tool to use
  2. Formats the tool call correctly
  3. System executes the tool
  4. Result fed back to LLM
  5. LLM decides next action

Types of Agents

1. Single-Action Agents

One tool call, one response.

  • "What's the weather in Tokyo?" → [Weather API] → "It's 72°F"

2. ReAct Agents

Reason and Act in alternating steps.

  • Think → Act → Observe → Think → Act...

3. Plan-and-Execute Agents

Create a full plan upfront, then execute.

  • Good for complex, multi-step tasks

4. Multi-Agent Systems

Multiple specialized agents collaborating.

  • Researcher agent + Writer agent + Editor agent

Real-World Examples

Coding Agents

  • GitHub Copilot Workspace — Plans and implements features
  • Cursor — Edits code across multiple files
  • Devin — Full autonomous software engineer (sort of)

Computer Use Agents

  • Claude Computer Use — Controls mouse and keyboard
  • OpenAI Operator — Browses web autonomously

Business Agents

  • AutoGPT — General purpose task completion
  • BabyAGI — Self-managing task lists

Building Agents

Frameworks

LangChain/LangGraph:

  • Most flexible
  • Graph-based workflows
  • Lots of built-in tools

CrewAI:

  • Multi-agent focus
  • Role-based design
  • Easy to set up

AutoGen (Microsoft):

  • Multi-agent conversations
  • Good for research tasks

Anthropic Claude:

  • Native tool use
  • Computer use capability
  • MCP protocol for tools

A Simple Agent Pattern

# Pseudo-code for a basic agent

tools = [search_web, read_file, send_email]

def run_agent(goal):
    messages = [{"role": "user", "content": goal}]

    while True:
        response = llm.generate(messages, tools=tools)

        if response.has_tool_call:
            result = execute_tool(response.tool_call)
            messages.append({"role": "tool", "content": result})
        else:
            return response.content  # Done!

Challenges

Reliability

Agents can:

  • Get stuck in loops
  • Make wrong decisions
  • Misuse tools

Mitigation: Guardrails, human approval for risky actions

Cost

Agentic loops can mean many LLM calls.

10-step task × $0.05/call = $0.50 per task (adds up fast)

Safety

Autonomous systems with real-world actions need careful design:

  • Sandboxed execution
  • Limited permissions
  • Audit trails
  • Kill switches

Evaluation

How do you test something that can take variable paths?

  • Define success criteria
  • Track intermediate states
  • Compare to human performance

The State of Agents (2024)

What works:

  • Narrow, well-defined tasks
  • Controlled tool sets
  • Human-in-the-loop for critical decisions

Still challenging:

  • Open-ended goals
  • Long-running tasks
  • Complex real-world interactions

The honest truth: Most production agents today have limited autonomy. Full autonomous agents are impressive demos but not yet reliable for serious work.

The Bottom Line

Agents represent AI's evolution from answering to doing:

  • Start with simple tool use
  • Add planning and memory
  • Build toward increasing autonomy

The technology is rapidly improving. What's a demo today is production-ready tomorrow.


Next up: Multimodal AI — AI that sees, hears, and more

Enjoying the course?

Get notified when we add new lessons and AI updates.

Free daily digest. No spam, unsubscribe anytime.

Discussion