MEAP Edition
Manning Early Access Program
Build an AI Agent (From Scratch)
Agents that reason, plan, and act autonomously
Version 5
Copyright 2026 Manning Publications
For more information on this and other Manning titles go to manning.com.
welcome
Thank you for purchasing the MEAP edition of Build an AI Agent (From Scratch).
To get the most out of this book, you don’t need to be an expert in AI or machine learning. If you are comfortable with the basics of Python—things like writing simple functions and classes—know how to call and use APIs, and have some familiarity with Git and GitHub, you’ll be more than ready to follow along. That’s all the background you need.
When I first started exploring the world of AI agents, I found myself overwhelmed. Every week, it seemed like a new agent framework, research paper, or tool was being released. Even as an engineer, I struggled to make sense of the rapid changes. I realized that if I only stayed a user of these frameworks, I would never truly understand how they worked or how to evaluate which ones to trust. That’s when I decided to dig deeper—and ultimately, that path led me to writing this book.
At the heart of this book is a hands-on project: together, we’ll build a simple but educational agent framework called scratch_agents and use it to create agents that solve problems step by step. As we build this framework, you’ll also discover that the essence of an agent lies in delivering the right context to an LLM so that its intelligence can be fully utilized. We call this process Context Engineering. Agent frameworks are essentially designed to manage this challenge effectively, and through this book you’ll learn how to design, implement, and experiment with this idea in practice.
This book is not about giving you yet another tool to memorize. It’s about empowering you to understand the inner workings of agent frameworks so you can go beyond surface-level usage. By the end of this journey, you won’t just be using existing frameworks—you’ll know how to open them up, understand their trade-offs, and even build your own when needed. That’s the kind of confidence and clarity this book aims to give you.
I hope this book helps you cut through the noise in this fast-moving field and gives you both confidence and clarity in working with AI agents. Please share your thoughts and questions in the liveBook discussion forum—your feedback will be invaluable in making this book the best it can be.
—Younghee Song & Jungjun Hur
正文 3
正文 4
This chapter covers
This chapter covers
This chapter covers
This chapter covers
正文 9
This chapter covers
This chapter covers
This chapter covers
This chapter covers
This chapter covers
This chapter covers
正文 16