Chapter 9. Real-World Use Cases
In Chapter 8, you learned to build agents: ReAct loops, RAG pipelines, memory strategies, and Recursive Language Models that manage their own context. You’ve got the building blocks. Now let’s see what happens when you put them together to solve real problems.
This chapter is the convergence point for everything in this book. Each use case maps directly to the failure modes from Chapter 1, applies the context engineering techniques you learned there, and uses the DSPy modules, evaluation metrics, and optimizers from Chapters 2 through 8. The table in Table 9-1 shows how each section connects to the concepts you’ve already learned.
| Use Case | Failure Modes | Techniques | Agentic Pattern | Key DSPy Feature |
|---|---|---|---|---|
|
9.1 Sentiment Classifier |
Context Underspecification |
FewShot Learning, Prompt Optimization |
Classification |
ChainOfThought, BootstrapFewShotWithRandomSearch ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access