dspy

Compose declarative LM programs with signatures and optimize prompts via teleprompters.

1|1|Updated Apr 25, 2026
One-click install
npx skills add https://github.com/linfordWu/owls --skill dspy-linfordwu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dspy
Source: https://github.com/linfordWu/owls/tree/main/skills/mlops/research/dspy
Command: npx skills add https://github.com/linfordWu/owls --skill dspy-linfordwu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

DSPy provides a structured, declarative approach to building and maintaining large language model applications, enabling developers to compose modular tasks, enforce type-safe outputs, and automate prompt optimization.

Core Features & Use Cases

  • Declarative Signatures: Define inputs/outputs with type safety to reduce ambiguity and errors.
  • Modular Pipelines: Compose Predict, ChainOfThought, ReAct, and other modules into end-to-end workflows (e.g., RAG, agents, and multi-step reasoning).
  • Prompt Optimization: Built-in teleprompters (BootstrapFewShot, MIPRO, COPRO, etc.) to improve prompts with data-driven methods.
  • Production-Grade Use Cases: RAG systems, multi-agent collaboration, data processing, and complex decision pipelines.

Quick Start

Install DSPy, define a simple Predict-based module, and run a forward pass to obtain an answer.

Frequently Asked Questions about dspy

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

FAQPage Schema
How do I automate prompt optimization for large language model workflows?

Automate prompt optimization by using built-in teleprompters like BootstrapFewShot or MIPRO, which apply data-driven methods to improve prompts within declarative LM workflows. This replaces manual prompt tuning with programmatic optimization.

What is the best way to build modular RAG pipelines with declarative programming?

Build modular RAG pipelines by composing modules like Predict, ChainOfThought, and ReAct into end-to-end workflows using declarative signatures. This enforces type-safe outputs and reduces ambiguity when structuring retrieval and generation steps.

How do I enforce type-safe structured outputs in multi-agent systems?

Enforce type-safe structured outputs in multi-agent systems by defining declarative signatures that specify exact input and output types. This reduces errors and ensures modules coordinate reliably across complex decision pipelines.

Can I use automatic prompt optimization tools for production-grade agent systems?

Yes, you can use automatic prompt optimization for production-grade agent systems. Built-in teleprompters validate results and optimize prompts data-driven, supporting complex multi-agent collaboration and robust decision pipelines.

Why should I use declarative programming instead of manual prompt engineering?

Declarative programming replaces manual prompt engineering by abstracting prompts into composable signatures and modules. This allows teleprompters to automatically optimize and validate prompts, reducing maintenance overhead for large LM systems.

Do I need specific teleprompters to optimize multi-step reasoning workflows?

Yes, you need teleprompters like BootstrapFewShot, MIPRO, or COPRO to optimize multi-step reasoning workflows. These coordinate modules and apply data-driven methods to improve prompts across complex pipelines.