dspy

Build declarative LLM programs and RAG pipelines with DSPy.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you replace brittle, manually tuned prompts with maintainable, data-driven language model programs that are easier to debug, optimize, and reuse.

Core Features & Use Cases

  • Declarative signatures and reusable modules for prediction, chain-of-thought reasoning, program-of-thought math, and ReAct-style tool use.
  • Built-in optimization workflows such as BootstrapFewShot, MIPRO, BootstrapFinetune, and KNNFewShot for improving prompts from examples.
  • Production patterns for RAG, agents, classifiers, structured extraction, and multi-stage pipelines with validation and retries.
  • Example use case: create a customer support bot that routes requests, retrieves documentation, and improves itself from labeled interactions.

Quick Start

Use the dspy skill to design a simple question-answering module from your examples and optimize it with a few-shot metric.

Frequently Asked Questions about dspy

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

FAQPage Schema
How do I optimize LLM prompts automatically using examples instead of manual tuning?

You can optimize LLM prompts automatically by using optimization teleprompters like BootstrapFewShot and MIPRO to generate and refine prompts from labeled examples, replacing brittle manual tuning with data-driven improvement.

What is the best way to build a RAG pipeline with structured output and validation?

The best way to build a RAG pipeline with structured output is using declarative LLM programming to define retrieval workflows and multi-stage systems with built-in validation and retries for production-ready reliability.

How do I create self-improving AI agents that use tools and retrieve documentation?

Create self-improving AI agents by defining ReAct-style tool use modules and retrieval workflows, then applying optimization teleprompters to improve agent routing and responses from labeled interactions.

Can I use declarative signatures for multi-stage reasoning and classification tasks?

Yes, declarative signatures support multi-stage reasoning, classification, and structured extraction tasks by allowing you to build modular, reusable components for chain-of-thought and program-of-thought workflows.

Does DSPy work for replacing manually tuned prompts in customer support bots?

DSPy works for customer support bots by enabling you to route requests, retrieve documentation, and build pipelines that improve themselves from labeled interactions using validation-driven prompt optimization.

What are the limitations of using teleprompters for language model programming?

Teleprompters require labeled examples and defined metrics to optimize language model programs, meaning their effectiveness depends on the quality of your training data and the accuracy of your validation criteria.