Build an AI Agent (From Scratch)
Agents that reason, plan, and act autonomously
Synopsis
Jungjun Hur and Younghee Song walk Python developers through building an autonomous research agent without relying on agent frameworks. The running project targets GAIA, a benchmark of multi-step assistant tasks, so each chapter adds a capability the agent needs to perform better. Early chapters separate developer-scripted workflows from loops in which the language model decides the next step, then cover stateless API calls, structured outputs with Pydantic and tool calling. The book then adds web search, local file exploration and vector-based retrieval, long-term memory, the Model Context Protocol, planning and reflection, and sandboxed code execution.
Later chapters coordinate several agents through the A2A protocol and evaluate them with LLM-as-a-judge pipelines traced through OpenTelemetry. A recurring theme is context engineering: deciding what information enters the model's window so that long tasks do not degrade. Because every component is written by hand, readers see why agents loop, hallucinate or lose track, which makes later work with commercial frameworks easier to debug. The examples use the OpenAI API, and the book assumes working Python and some machine learning background. Reviewer Nicolas Fränkel judged the evaluation chapter the one area that needs more depth.
Scorecard
Editorial score
How it scored
Editorial score: 66.5 / 1005 weighted criteria
- 13.5/30
Influence30%
- 15.0/25
Authority25%
- 17.0/20
Practical value20%
- 13.5/15
Currency15%
- 7.5/10
Readability10%
- 66.5/100
Editorial score
How the rank was computed
Rank No. 410 of 500 comes from a composite of 49.6: observable signals 19.5 of 55 points plus editorial review 30.1 of 45 points.
All 11 inputs
| Input | Points |
|---|---|
| Observable signals | 19.5/55 |
| Reach (Amazon ratings volume) | 5.9/16.5 |
| Consensus across best-of lists | 2.8/13.8 |
| Awards and bestseller evidence | 0.0/8.3 |
| Reader rating, sample-adjusted | 6.3/8.3 |
| Amazon sales rank | 1.7/5.5 |
| Recency | 2.8/2.8 |
| Editorial review | 30.1/45 |
| Author authority | 6.8/11.3 |
| Influence | 6.1/13.5 |
| Practical value | 7.7/9.0 |
| Readability | 3.4/4.5 |
| Currency | 6.1/6.8 |
Each criterion is scored from 1 to 10 and weighted, and the points add up to the editorial score. The rank combines observable signals (55 percent) with this score (45 percent). Read the methodology.
Verdict
A methodical, framework-free tutorial that teaches how agent loops, tools, memory and evaluation work by building one in Python.
Strengths
- Builds every component without framework abstractions
- Covers MCP, A2A and agent evaluation
- Clear diagrams and a coherent running project
Keep in mind
Assumes comfort with Python and some machine learning; examples use the OpenAI API, and the evaluation chapter is thinner than the rest.
Key takeaways
- Distinguish fixed, developer-defined workflows from true agents, in which the language model chooses actions inside a loop; the choice affects reliability, cost and debugging.
- Context engineering, structuring what enters the model's window, prevents the context rot and lost-in-the-middle failures that degrade long, multi-step tasks.
- Memory, planning with reflection and sandboxed code execution each address specific agent failures, such as repeating past mistakes, looping and hallucinated results.
- Agents need systematic evaluation: benchmark tasks like GAIA and LLM-as-a-judge pipelines with tracing reveal where an agent fails before it reaches users.
Notable facts
- Lead author Jungjun Hur's earlier book, Practical AI Application Development Using LLMs (Onlybook, 2024), was a bestseller in Korea. Source (opens in a new tab)
- Developer advocate Nicolas Fränkel wrote that the book belongs in any engineer's library for understanding what happens inside AI agents. Source (opens in a new tab)
About the author
Questions
What is Build an AI Agent (From Scratch) about?
Who should read Build an AI Agent (From Scratch)?
Is Build an AI Agent (From Scratch) current in 2026?
Related books
- Generative AI with LangChain Ben Auffarth and Leonid Kuligin
- The Developer's Playbook for Large Language Model Security Steve Wilson
- Generative AI For Dummies Pam Baker
- Designing Large Language Model Applications Suhas Pai
- ChatGPT and the Future of AI Terrence J. Sejnowski
- Super Study Guide Afshine Amidi and Shervine Amidi
Sources
As an Amazon Associate, Best AI Books earns from qualifying purchases. Best AI Books is sponsored by Iternal.ai, whose founder and CEO, John Byron Hanby IV, wrote The AI Strategy Blueprint, our #1 ranked book. How we rank books.






