This book, "Principles of Building AI Agents," guides you through creating AI agents, focusing on key elements like providers, models, prompts, tools, and memory. It also covers complex task management, knowledge base access using RAG, and multi-agent systems.
By reading this book, you'll be equipped to:
A: Hosted providers allow you to prototype quickly without worrying about infrastructure issues. Even if you plan to use open-source models eventually, starting with cloud APIs can save time and effort.
A: Start with a more expensive, accurate model during prototyping. Once you have something working, you can tweak the cost by switching to a smaller, faster model.
A: The key steps include chunking documents, embedding data into vectors, indexing vectors in a vector DB, querying the database, reranking results, and synthesizing an answer using an LLM.
A: Use evals to provide quantifiable metrics for measuring agent quality. Different types of evals include textual evals, classification evals, tool usage evals, and prompt engineering evals.
The primary target audience includes software developers and engineers who are looking to build AI agents or integrate AI assistants into their products. The book is also relevant to startup founders and product managers who need to understand the technical aspects of AI agents. The content assumes a basic understanding of programming concepts but does not require prior experience with AI or machine learning. The book is particularly useful for those who want to quickly get up to speed on the key concepts and techniques for building AI agents without getting bogged down in theoretical details. It is also aimed at those who want to leverage open-source frameworks like Mastra to accelerate their development process. The book is designed to be accessible to engineers with experience in web development, data engineering, or DevOps, providing them with the tools and knowledge to transition into AI engineering.
The book emerges in the context of rapid advancements in large language models (LLMs), particularly after the introduction of ChatGPT in November 2022. This period has seen a surge in the development of AI applications, known as agents, which can perform complex tasks by leveraging LLMs. The historical context includes the evolution of AI from earlier technologies like chess engines and speech recognition to the current focus on generative AI. The book also acknowledges the influence of the "Attention is All You Need" paper from Google researchers in 2017, which laid the groundwork for modern LLMs. The rise of open-source AI groups and the increasing availability of models from providers like OpenAI, Anthropic, Google, and Meta further shape the context in which this book is written.