dspy

Build declarative language-model pipelines and optimize them with teleprompters.

Updated Feb 15, 2026
One-click install
npx skills add https://github.com/ricable/mcai --skill dspy-ricable
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dspy
Source: https://github.com/ricable/mcai/tree/main/.agents/skills/dspy
Command: npx skills add https://github.com/ricable/mcai --skill dspy-ricable

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

DSPy removes the guesswork from prompt engineering by letting you build complex language-model systems declaratively and improve them with data-driven optimization instead of manual trial and error.

Core Features & Use Cases

  • Declarative AI Programming: Define signatures, modules, and multi-stage workflows for tasks like QA, summarization, extraction, and routing.
  • RAG and Agent Systems: Combine retrieval, reasoning, tool use, and conditional control flow into reusable AI pipelines.
  • Automatic Optimization: Use training examples and metrics to tune prompts, demonstrations, and instructions for better reliability.
  • Use Case: Build a production RAG assistant that retrieves documents, reasons over context, validates outputs, and iteratively improves with optimizers like BootstrapFewShot or MIPRO.

Quick Start

Use the dspy skill to design a small AI workflow for your task, then optimize it with a metric and a few representative examples.

Frequently Asked Questions about dspy

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

FAQPage Schema
How do I optimize language model prompts automatically instead of manual trial and error?

Automatic prompt optimization uses data-driven teleprompters to tune instructions and demonstrations from training examples, replacing manual trial and error. You define a metric and a few examples, then run optimizers like BootstrapFewShot or MIPRO to improve pipeline reliability.

What is the best way to build declarative AI pipelines for RAG and multi-agent systems?

Declarative AI pipelines for RAG and agents are built using composable signatures and modules. This approach lets you define multi-stage workflows for retrieval, reasoning, and tool use, which can then be automatically optimized using evaluation metrics and training data.

How do I structure output extraction and classification workflows with language models?

Structured output extraction and classification workflows are defined using declarative signatures. By specifying the input and output schema directly, the pipeline enforces structured reasoning and validates outputs, which can then be optimized for accuracy with teleprompters.

Can I use teleprompters to optimize multi-stage reasoning and tool-using agents?

Teleprompters can optimize multi-stage reasoning and tool-using agents by leveraging training examples and evaluation metrics. They automatically tune prompts and demonstrations within composable modules, improving the reliability of conditional control flow and agent actions.

Do I need training examples and metrics to use declarative programming for AI workflows?

Training examples and metrics are required for declarative programming to automatically optimize AI workflows. While you can define pipelines without them, data-driven optimization relies on these inputs to tune prompts and validate structured extraction or reasoning reliability.