Part VI: Agentic AI

Chapter 22: AI Agent Foundations

"An agent is anything that can be viewed as perceiving its environment through sensors and acting upon that environment through actuators."

Attn Agent X, Textbook-Quoting AI Agent

Chapter Overview

AI agents extend LLMs beyond single-turn question answering into autonomous problem solving. An agent perceives its environment, reasons about what to do next, takes actions through tools, and learns from the results. This perception-reasoning-action loop, formalized by the ReAct pattern, is the foundation of every agentic system.

This chapter covers the full agent foundation stack. It begins with the core agent paradigm, contrasting agents with chains and static workflows and introducing the four agentic design patterns (reflection, tool use, planning, and multi-agent collaboration). It then explores agent memory systems, including episodic, semantic, and procedural memory architectures like MemGPT/Letta and Mem0 (building on the vector database infrastructure from Chapter 19). The chapter covers planning strategies from simple plan-and-execute to tree search methods like LATS, examines reasoning models as agent backbones, and concludes with agent evaluation using benchmarks such as SWE-bench, GAIA, and WebArena.

Big Picture

AI agents represent a paradigm shift from reactive question-answering to proactive problem-solving. This chapter introduces the core agent loop: perceive, reason, plan, and act. The architectural patterns here form the foundation for tool use (Chapter 23), multi-agent systems (Chapter 24), and production agent deployment (Chapter 26).

Learning Objectives

Prerequisites

Sections

What's Next?

In the next chapter, Chapter 23: Tool Use and Protocols, we dive into tool use and protocols like function calling and MCP that enable agents to take actions.