What problem does it solve?
DSPy helps teams move from brittle, manually written prompts to declarative LM programs that can be optimized using data for more reliable outputs.
Core Features & Use Cases
- Declarative language model programming: define inputs/outputs via signatures and compose reusable modules for tasks like QA, extraction, and generation pipelines.
- Automatic prompt optimization: use teleprompters to bootstrap demonstrations or iteratively improve instructions using a metric over training/validation sets.
- RAG and multi-stage systems: combine retrieval, reasoning, reranking, and generation into modular pipelines that improve systematically over time.
- Common use case: optimize a RAG-based research assistant so it retrieves better context and produces more accurate answers using a dataset of question-answer pairs with an evaluation metric.
Quick Start
Use the dspy skill to turn your question-answer task into an optimized declarative program by defining a DSPy signature and compiling it with BootstrapFewShot on your labeled examples.