Contents
Map

10 · Introduction to AI Agents

Overview

View as:

10 - Introduction to AI Agents

An AI agent is a model that directs its own process: it reads its context, decides on an action (usually a tool call), observes the result, and repeats until the goal is met. This module builds that idea from first principles - the definition, the components, the loop, where agents work and how to evaluate one. The next modules add the building blocks (tools, memory, planning), protocols and agentic workflows.

Learning objectives 5-6 hours (notes + lab)
By the end of this module you will be able to:
  • Decide whether a task needs a single call, a workflow or an agent, and at what autonomy level
  • Name the parts of an agent - model, instructions, tools, memory, orchestration, guardrails, environment - and what each is responsible for
  • Write a correct tool-use loop against the Claude and OpenAI APIs and against any OpenAI-compatible server, with bounds and error handling
  • Evaluate an agent on environment state with pass^k over repeated trials
Prerequisites

Where This Module Fits

flowchart LR
    W["01 What agents are"] --> AN["02 Anatomy"]
    AN --> L["03 The loop"]
    L --> PR["04 In practice"]
    PR --> E["05 Evaluation"]
    L -.-> LAB["🧪 Lab: loop from scratch"]
    E -.-> LAB
    E --> BB["🔧 Next: Agent Building Blocks"]

    style W fill:#e8e2d9,stroke:#ccc4b8
    style L fill:#e8e0d4,stroke:#c8b89a
    style E fill:#dde4dc,stroke:#b0c4b0
    style LAB fill:#d8dfe8,stroke:#b0bac8

Chapter Map

#ChapterYou will learnTime
1What Are AI AgentsAgents vs workflows, the autonomy spectrum, why now, the decision test40 min
2Anatomy of an AI AgentModel + harness: instructions, tools, memory, orchestration, guardrails, environment35 min
3The Agent LoopCorrect loops for Claude and OpenAI APIs, invariants, stop reasons, bounds, failures60 min
4Agents in PracticeGood use cases, personal vs enterprise, human-in-the-loop, build or buy40 min
5Agent Evaluation BasicsState-based grading, pass@k vs pass^k, first test sets, failure taxonomies45 min

Tool use, memory and planning - the parts every agent is assembled from - are covered in depth in Agent Building Blocks.

Code Lab

LabWhat you buildRuns on
Agent Loop from ScratchA tool-use loop with validation and bounds over a small retail environment, graded on database state with pass^k across prompt and tool-description variantsAny OpenAI-compatible endpoint: a local Qwen3 on a laptop (mlx-lm, Ollama, vLLM) or a hosted API

Mini-Project

Build and evaluate a single agent for a domain you know (an internal help desk, a lab-inventory assistant, a personal finance helper). Start it here and finish it after Agent Building Blocks:

  1. An environment with 4-8 tools, at least two of them write tools with preconditions enforced in code, and a reset function.
  2. A test set of 40 tasks across the six categories in Agent Evaluation Basics, each with an expected end state.
  3. The loop from the lab (or a framework), with bounds, argument validation and informative errors.
  4. Results: pass@1 with a confidence interval, pass^4, per-task counts, tokens and seconds per episode.
  5. A failure taxonomy from the traces, one targeted fix, and before/after numbers.

Review

  • Q&A Review Bank - interview-style questions for this module
  • Module quiz - every Check Yourself question in this module, in course order

Summary & Key Terms

Summary & Key Terms - a quick recap of this module and its essential vocabulary.


Next Topic

Previous: 09 - Post-Training & Fine-Tuning · Next: 11 - Agent Building Blocks

⚡AI-assisted content - always verify, always explore multiple perspectives·