dspy

Automate LM workflows with declarative modules and optimizers.

2.8k|332|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/moltis-org/moltis --skill dspy-moltis-org
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dspy
Source: https://github.com/moltis-org/moltis/tree/main/crates/skills/src/assets/mlops/research/dspy
Command: npx skills add https://github.com/moltis-org/moltis --skill dspy-moltis-org

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

DSPy reduces the complexity of building reliable, scalable AI systems by providing a declarative, modular programming model for composing pipelines, reasoning, and optimization across RAGs and agents.

Core Features & Use Cases

  • Declarative module design with Signatures, Inputs/Outputs, and typed outputs for safer composition.
  • Multi-stage pipelines including Predict, ChainOfThought, ProgramOfThought, ReAct, and MultiChainComparison to build robust AI apps.
  • Built-in optimizers (BootstrapFewShot, MIPRO, BootstrapFinetune, COPRO, KNNFewShot) to improve prompts and model performance automatically.
  • RAG/Agent architectures and tool-use flows for real-time information retrieval and decision making.

Quick Start

Create a simple ChainOfThought module and run a basic question-answer workflow.

Frequently Asked Questions about dspy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build declarative AI pipelines for LM programming?

You can build declarative AI pipelines by defining typed Signatures for inputs and outputs, then composing modular reasoning steps like Predict, ChainOfThought, and ReAct to structure LM workflows safely.

What is the best way to optimize prompts automatically in AI pipelines?

Automatic prompt optimization is handled by built-in optimizers like BootstrapFewShot, MIPRO, and COPRO, which improve prompt performance and model outputs dynamically without manual tuning.

How do I create multi-stage reasoning workflows for RAG and agents?

Multi-stage reasoning workflows for RAG and agents are created by chaining modular components such as ChainOfThought, ProgramOfThought, and ReAct to handle tool-use flows and real-time information retrieval.

Does this approach support research and production environments for complex AI systems?

Yes, this declarative computing model applies to both research and production environments, providing modular pipelines and optimization to reduce the complexity of building scalable AI systems.

What are the limitations of manual prompt engineering for large language models?

Manual prompt engineering lacks scalability and reliability for complex AI systems, whereas declarative programming with built-in optimizers standardizes prompt generation and improves model performance systematically.