What problem does it solve?
Building robust AI systems often requires stitching together disparate tools, prompts, and workflows in brittle code. DSPy provides a declarative framework to define task signatures and compose Predict, ChainOfThought, ReAct, and ProgramOfThought modules, enabling scalable, maintainable AI pipelines with self-improvement capabilities.
Core Features & Use Cases
- Declarative LM programming with built-in modules: Predict, ChainOfThought, ReAct, ProgramOfThought, and TypedPredictor for type-safe outputs.
- Optimizers and teleprompters: BootstrapFewShot, MIPRO, BootstrapFinetune, COPRO, KNNFewShot for prompt and weight optimization.
- RAG, agents, and multi-stage pipelines: retrieval, reasoning, tool-use, and orchestration of complex workflows.
- Production readiness: batch processing, exportable datasets, saving/loading modules, and LM provider configuration.
Quick Start
Make a simple DSPy module using Predict and run a basic QA example.