1 What is an AI agent?
This chapter covers
- The landscape of AI agents today
- LLMs as the decision-making core of agents
- Workflows versus agents and when to use each
- GAIA benchmark for measuring agent performance
- Context engineering for building effective agents
You may have heard of agent-building frameworks such as LangGraph, CrewAI, AutoGen, and OpenAI Agents. These frameworks make it easy to build agents quickly, but they also hide what’s happening inside. This book takes a different approach: we’ll build agents from scratch, understanding every component before relying on any framework.
Why build from scratch? Agent development is fundamentally about debugging failures. When your agent gives a wrong answer or gets stuck in a loop, you have to understand exactly what went wrong. Did the large language model (LLM) misinterpret the context? Did a tool return unexpected results? Was crucial information missing? Without understanding how agents work internally, diagnosing these problems is difficult regardless of which tools you use. By building each component yourself, you’ll develop the mental model you need to troubleshoot any agent system, whether you built or inherited it.