Module 21

AI Agents: Tool Use, Planning & Reasoning

Part VI: Agents & Applications

Chapter Overview

AI agents represent a fundamental shift in how we use large language models. Rather than generating a single response to a single prompt, agents operate in loops: they perceive their environment, reason about what to do next, take actions using tools, and observe the results before deciding on their next step. This perception-reasoning-action cycle transforms LLMs from passive text generators into active problem solvers that can browse the web, write and execute code, query databases, and orchestrate complex multi-step workflows.

This module covers the complete landscape of AI agents. It begins with the foundational concepts that distinguish agents from simple chains and workflows, introducing the four core agentic patterns: reflection, tool use, planning, and multi-agent collaboration. It then dives deep into tool use and function calling across major providers, covering everything from basic schema definitions to the Model Context Protocol (MCP) and Agent-to-Agent (A2A) communication standards. The module explores planning and reasoning strategies, from simple ReAct loops to sophisticated tree search algorithms. Finally, it addresses code generation and execution agents that can write, run, debug, and iterate on code autonomously.

By the end of this module, you will be able to build agents that use tools effectively, plan multi-step solutions, generate and execute code safely, and handle the practical challenges of token budgets, error recovery, and human oversight.

Learning Objectives

Prerequisites

Sections