Static, over-engineered prompts quickly lose effectiveness as models and data change. DSPy replaces inflexible text-based prompts with dynamic contract-based Python code, so your prompts can freely adapt and scale. In Building LLM Applications with DSPy, AI engineers Serj Smorodinsky and Brett Kennedy introduce the powerful DSPy framework and show you how it can revolutionize the way you think of prompt and context engineering. In this practical guide, you’ll learn how DSPy automatically optimizes context, evaluates prompt effectiveness, and automatically tweaks your prompts as models drift and change. As you go, you’ll get tips and techniques to maintain stable inference results as your apps and agents evolve.
Building LLM Applications with DSPy introduces DSPy best practices you can adopt to create reliable, production-ready systems through proper task definition, evaluation, and optimization. Practical to the core, this book helps you construct a full professional portfolio of AI applications, including an LLM-based classification system, a summarizer, and a RAG-based application. You'll build multi-step workflows using DSPy's modular system, finally culminating in fully agentic pipelines, all without writing a single prompt by hand. A DSPy contributor, author Serj Smorodinsky speaks authoritatively about how to get the most out of this elegant tool. And, as with every Manning book, you’ll find a carefully constructed learning path, readable text, lots of helpful graphics, and our promise that the details are correct and reliable.