The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms...
Don't Let Tokens Eat Up Your Budget
Build AI agents that reason when necessary, preserve what they learn, and stop paying the intelligence premium for work they already know how to perform. Smart AI Agents combines architecture, working implementations, public source code, and measured experiments to show how agents can learn once and execute many.
Minimum price
$39.99
$49.99
About the Book
Most AI agents are designed to reason first—and pay for that reasoning again every time they encounter the same problem.
Smart AI Agents presents a different architecture: use intelligence when the system encounters novelty, ambiguity, or failure, then preserve what was learned as reusable capability so future executions can take the least expensive sufficiently capable path.
The book develops this idea from architecture to working implementation. You'll learn how to separate an agent's Intelligence Plane from its Execution Plane, build executable memory, promote successful reasoning into reusable capabilities, validate deterministic execution, detect when learned capabilities become stale, and return to an LLM when the world changes.
This is not a book about eliminating LLMs. It is about eliminating unnecessary LLM usage.
The implementations are backed by reproducible experiments and public companion code. In the Chapter 3 controlled web-research benchmark, the baseline and Smart Agent architectures each completed 150 of 150 executions with 1.000 mean correctness. The baseline required 150 LLM calls. The Smart Agent required 2—avoiding LLM inference on 98.7% of executions while continuing to retrieve fresh source data.
The result was a reduction in measured model cost from $1.069980 to $0.031082 for that controlled workload, alongside substantial latency and token reductions.
Early Access: This v0.3 edition contains Chapters 1–3 and Appendix A. Future editions will progressively add the remaining implementations, experiments, benchmarks, and economic analysis as the book moves toward v1.0.
Full companion source code is available in the public GitHub repository.
About the Author
Juan Cabrera is a senior software engineer with nearly three decades of experience designing and building software systems. He holds a bachelor's degree in Computer Science and a master's degree in Business, combining deep technical experience with a practical understanding of software economics and business value.
His work with production AI systems led to the central question behind Smart AI Agents: why should an intelligent system repeatedly pay an intelligence premium for work it has already learned how to perform?
In Smart AI Agents, Juan approaches agentic AI as a software engineer rather than as a collection of prompts. The architectures, implementations, experiments, and benchmarks in the book are built around a practical principle: reason when necessary, preserve what was learned, automate what becomes repeatable, and return to reasoning when the world changes.
Click the buttons to get the free sample in PDF or EPUB, or read the sample online here
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms...
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.
Learn more about writing on Leanpub
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!
Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.
Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.