dspy

Optimize DSPy prompts and pipelines using teleprompters and training data.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

DSPy optimizes prompts and orchestrates declarative LM programming to turn prompt engineering into data-driven, self-improving pipelines. It supports multi-stage systems, tool use, and optimization across multiple LMs for complex reasoning tasks in research, development, and production. This skill requires a DSPy module, a defined metric, and training data to perform bootstrap few-shot, MIPRO, or finetuning teleprompter optimization and evaluation.

Core Features & Use Cases

  • Declarative LM programming: Define tasks using signatures and modular blocks that compose into complex workflows.
  • Prompt optimization: Automatically generate and select better prompts and demonstrations via teleprompters (BootstrapFewShot, MIPRO, COPRO).
  • Multi-stage systems & tool use: Build agents, RAG systems, and parallel pipelines with reliable error handling and traceability.
  • Production-grade workflows: Use in research, R&D, and production for high-assurance reasoning tasks and complex data processing.

Quick Start

Create a minimal DSPy workflow with a simple ChainOfThought module and run a basic prompt to observe the reasoning steps and final 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 multi-stage language model pipelines?

Automating prompt optimization for multi-stage pipelines requires defining a DSPy module, a metric, and training data to run teleprompter optimizations like BootstrapFewShot or MIPRO, turning manual prompt engineering into data-driven workflows.

What is declarative LM programming and when do I need it for complex reasoning tasks?

Declarative LM programming defines tasks using signatures and modular blocks that compose into complex workflows, needed when building multi-stage systems, agents, or parallel pipelines for high-assurance reasoning tasks in research and production.

Can I use dspy to build RAG systems with tool use and reliable error handling?

You can build RAG systems with tool use by defining modular blocks and signatures, orchestrating multi-stage systems with traceability, and relying on the framework's built-in error handling for production-grade workflows.

Do I need training data and a defined metric to perform prompt optimization?

Training data and a defined metric are required to perform prompt optimization, as teleprompters like BootstrapFewShot, MIPRO, and finetuning rely on these inputs to evaluate and generate better prompts and demonstrations.

What's the best way to start building a declarative LM workflow with dspy?

The best way to start is by creating a minimal DSPy workflow using a simple ChainOfThought module, running a basic prompt to observe the reasoning steps and final answer before applying advanced optimization.

How does dspy compare to manual prompt engineering for production-grade applications?

Unlike manual prompt engineering, this approach uses teleprompters to automatically generate and select better prompts and demonstrations via bootstrap few-shot, MIPRO, or finetuning optimization, enabling self-improving pipelines for complex reasoning tasks.