What problem does it solve?
DSPy enables building modular, self-improving language-model pipelines by declaring tasks as signatures and composing multiple components into cohesive workflows, reducing ad-hoc prompting and brittle integrations.
Core Features & Use Cases
- Declarative task definitions via signatures and field-based inputs/outputs for robust LM tooling.
- Modular composition of Predict, ChainOfThought, ReAct, and other building blocks to create complex data-to-decision pipelines.
- Optimizers (BootstrapFewShot, MIPRO, BootstrapFinetune, COPRO, KNNFewShot) to automatically improve prompts and, optionally, fine-tune models for RAG, agents, and classifiers.
- Practical patterns for multi-stage pipelines, retrieval-augmented generation, agent systems, and structured information extraction.
- Extensive references and real-world examples to guide production-ready deployments.
Quick Start
Create a simple DSPy module and run a BootstrapFewShot optimization on a small labeled trainset.