chapter one

1 What is an AI agent?

 

This chapter covers

  • The landscape of AI agents today
  • LLMs as the decision-making core of agents
  • Workflows vs 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 like LangGraph, CrewAI, AutoGen, or OpenAI Agents. These frameworks make it easy to build agents quickly, but they also hide what's actually 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? Because agent development is fundamentally about debugging failures. When your agent gives a wrong answer or gets stuck in a loop, you need to understand exactly what went wrong. Did the LLM (Large Language Model) 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 needed to troubleshoot any agent system, whether you built it or inherited it.

1.1 The age of AI agents

1.2 Understanding LLM agents

1.2.1 What is an LLM?

1.2.2 What is an LLM Agent?

1.3 Workflow vs agent

1.3.1 Workflow: Developer-defined flow

1.3.2 Agent: LLM-directed flow

1.3.3 Combining workflows and agents in practice

1.4 Tasks that require agents

1.4.1 Tasks that require an LLM

1.4.2 Conditions for using agents

1.4.3 GAIA: An agent gym

1.5 Context engineering

1.5.1 Why agents fail

1.5.2 From prompt engineering to context engineering

1.5.3 Bigger context is not always better

1.5.4 Five context engineering strategies

1.5.5 The journey of this book

1.6 Prerequisites for reading this book

1.7 Summary