Purchases open soon. Explore the books and read a free sample.
← All books

A practical guide with Python

Building AI Agents
from Scratch

A Hands-On Guide with Python

Turn an idea into an agent that can act. Learn the tools, memory, coordination, and evaluation behind useful AI systems — one chapter at a time.

Read a sample

One purchase in USD. PDF + Python code. 7-day full refunds.
Purchases are not open yet.

Your full purchase email and order reference will appear in the PDF watermarks.

READ. BUILD. EXPERIMENT.
Building AI Agents from Scratch by Yanfei Li — ebook cover
YOUR NEXT BUILD
STARTS HERE.
22Chapters
4Appendices
PythonCompanion examples
Yours to keepRead & build offline

TAKE A LOOK INSIDE

Understand the pieces.
Then put them to work.

For Python developers who want to move from talking to a model to building systems around one.

01 / Foundations

Build your first agent

Understand the agent loop, set up your environment, and connect models to tools they can use.

Agent loops · Tool design · MCP
02 / Coordination

Give agents context

Work with memory and retrieval, plan a sequence of actions, and coordinate multiple agents.

Memory · Planning · Multi-agent systems
03 / Reliability

Make behavior measurable

Explore evaluation, testing, safety, and the engineering decisions that support reliable systems.

Evaluation · Recovery · Deployment
04 / Exploration

Take the next step

Explore streaming, multimodal inputs, database tools, voice interfaces, and fine-tuning.

SQL · Voice · Multimodal agents

YOUR DIGITAL EDITION

Everything in
your download.

A single ZIP with your purchased files. Save it, unpack it, and start reading.

Read a sample
PDF

The complete ebook

Selectable text, a linked table of contents, and clear code typography.

.PY

Companion Python code

Examples and supporting files organized by chapter.

BEFORE YOU BEGIN

A few good
questions.

Is this book right for me?

The book is written in English for readers with basic Python knowledge. It introduces the building blocks of AI agents and progresses to more advanced systems. Read the sample to see whether the approach fits you.

Do I need paid AI tools to follow along?

Some examples run locally. Others require optional software, provider accounts, or paid API usage. Those services are not included in the ebook price. The code includes both runnable projects and teaching snippets.

How do I get the book after paying?

After your payment is confirmed, a download button appears on the purchase confirmation page. We also email your download link. You do not need to create an account.

Is this a subscription?

No. Each book is a one-time purchase. Download your files and keep them for offline use.

Can I get a refund?

Yes. Email benky.tide@gmail.com within 7 calendar days of purchase for a full refund, including if you have downloaded the files. See the refund policy for the request process.

How may I use the files?

The ebook is for personal use; the companion source code has its own MIT license.

Who publishes these books, and how can I get help?

AI Craft Mastery is an educational publishing website by Yanfei Li, an independent author based in Knoxville, Tennessee, United States. For book questions, purchase help or refunds, email benky.tide@gmail.com. Read our purchase and privacy information.

YOUR NEXT CHAPTER

Start building.

Building AI Agents from Scratch · By Yanfei Li

PDF + Python code · One-time purchase
Watermarked with your full purchase email and order reference.