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 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.

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 isn’t always better

1.5.4 Five context-engineering strategies

1.5.5 From context engineering to harness engineering

Summary