Introduction
Preface, how to use this book, prerequisites, and complete setup instructions to get started.
Read Chapter →
The definitive guide to programming—rather than prompting—language models. Build robust, optimized, and self-improving AI applications.
Start ReadingPreface, how to use this book, prerequisites, and complete setup instructions to get started.
Read Chapter →Understand the core philosophy of DSPy and why "programming" beats "prompting" for complex LLM tasks.
Read Chapter →Learn to define the input/output behavior of your AI modules structurally and type-safely.
Read Chapter →Discover the building blocks of DSPy programs, from simple Predictors to ChainOfThought and Agents.
Read Chapter →Master the art of measuring performance with custom metrics and systematic evaluation loops.
Read Chapter →Use compilers like MIPRO and BootstrapFewShot to automatically optimize your prompts and weights.
Read Chapter →Build RAG systems, classifiers, and intelligent agents ready for production deployment.
Read Chapter →Explore adapters, caching, async operations, debugging, and deployment strategies.
Read Chapter →Real-world case studies from enterprise RAG systems to AI code assistants and more.
Read Chapter →API reference, troubleshooting guide, additional resources, glossary, and community links.
Read Chapter →