Part 02›
✎

Part 02: Building Agents#

Design and build a single-agent system: the agent loop, tools, planning, memory, pipelines, and an engineer's view of how agent system designs have evolved.

This part is for a software engineer who has finished Part 01 and can write Python but has never built an agent. By the end you can sit down and build a small, well-structured single-agent system and explain every design decision in it.

What you will be able to do#

Chapters#

# Chapter Level Reading Exercise
01 The Anatomy of an Agent Practitioner 30 min 60 min
02 Tool Design and Function Calling Practitioner 30 min 60 min
03 Planning, Search and Decision-Making Practitioner 30 min 60 min
04 Memory and Knowledge for Agents Practitioner 30 min 60 min
05 Compound AI Systems and DSPy Practitioner 30 min 60 min
06 How Agent System Designs Evolve Practitioner 15 min 30 min
07 Coding Agents Practitioner 30 min 90 min
08 Training Models for Agentic Tasks Professional 30 min 60 min

How to read this part#

A project to carry through the part: an agent over a folder of notes.

  1. Build the loop with a scripted model (01).
  2. Add three tools: list, search and read (02).
  3. Compare a reactive policy with a plan-first one (03).
  4. Add a notes file and compaction (04).
  5. Rewrite the question-answering step as a declarative program and optimize it (05).

What this part does not cover#

About the examples#

All examples are plain Python and appear in full inside the chapters. Four run offline with no API key: the agent loop with a scripted model (01), the retrieval example (04), the agent-computer interface (07) and the corridor training loop (08). Where a chapter shows how to connect a real model, the adapter is illustrative and calls a paid API; the chapter says so and gives an estimated cost. Provider APIs change, so check the current documentation before you rely on a code shape.

Sources#

The part is synthesized from six lectures of the UC Berkeley LLM Agents and Agentic AI MOOCs:

Each chapter cites the moments it uses.

Lecture guides for this part#

Each guide maps one lecture from its first minute to its last and says where this book teaches each piece. Where no chapter teaches a part of the lecture, the guide explains it itself; the table counts those parts.

Lecture Lecturer Length Parts no chapter teaches Guide
Evolution of system designs from an AI engineer perspective Yangqing Jia (NVIDIA) 1:20:00 2 of 9 open guide
Compound AI Systems & the DSPy Framework Omar Khattab (Databricks) 1:06:00 5 of 16 open guide
Agents for Software Development Graham Neubig (CMU) 1:02:00 4 of 13 open guide
On Reasoning, Memory, and Planning of Language Agents Yu Su (Ohio State University) 1:34:00 5 of 11 open guide
Some Challenges and Lessons from Training Agentic Models Weizhu Chen (Microsoft) 1:06:00 4 of 18 open guide
Towards a unified framework of Neural and Symbolic Decision Making Yuandong Tian (Meta AI, FAIR) 1:10:00 7 of 16 open guide

Where to go next#

→ Part 03: Evaluation. An agent you cannot measure is an agent you cannot improve.