Prompt example extracted from DSPy Examples.
What we’ll learn today In this tutorial we’ll build a haiku-writing program that starts with four lines of Python and grows into a tool-using, prompt-optimized agent. Along the way we’ll touch each of DSPy’s core components. We’ll learn: - How to install DSPy, configure a **language model** and write a simple DSPy program. - What a **Signature** is, and why DSPy uses signatures instead of hand-written prompt strings. - What a **Module** is, how `Predict`, `ChainOfThought`, and `ReAct` differ, and when to reach for each. - How to compose a custom `dspy.Module` that decomposes a task into named, independent stages. - How to write **metrics** and use **optimizers** to compile better versions of our program. - How to save optimized programs and reload them. --- **Next:** [Setting up DSPy →](installation.md)