dspy

Automate declarative prompt optimization for language model pipelines.

31|3|Updated May 7, 2026
One-click install
npx skills add https://github.com/markwang2658/hermes-windows-native --skill dspy-markwang2658
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dspy
Source: https://github.com/markwang2658/hermes-windows-native/tree/main/hermes-agent/optional-skills/mlops/research/dspy
Command: npx skills add https://github.com/markwang2658/hermes-windows-native --skill dspy-markwang2658

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

DSPy enables end-to-end self-improving pipelines by automating prompt optimization and modular reasoning for language models.

Core Features & Use Cases

  • Declarative module definitions: Define tasks and workflows without imperative prompts, enabling reuse and safety.
  • Teleprompter-driven optimization: Generate and evaluate prompts or instructions to improve model outputs using data-driven metrics.
  • Use Case: Optimize a multi-stage QA/RAG pipeline across OpenAI and Claude providers with few-shot demonstrations.

Quick Start

Install dspy, load your module, and run a basic few-shot optimization for a QA task.

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 reasoning pipelines?

Automate prompt optimization by defining declarative LM pipelines and using teleprompters with data-driven metrics to generate and evaluate instructions. You provide a labeled trainset and an evaluation metric to improve model outputs.

What is declarative programming for language model pipelines?

Declarative programming for language models defines tasks and workflows without imperative prompts, enabling reuse and safety. It shifts focus from manual prompt engineering to modular reasoning definitions optimized automatically by teleprompters.

How do I optimize few-shot demonstrations for RAG workflows?

Optimize few-shot demonstrations for RAG workflows using optimizers like BootstrapFewShot or MIPRO. These teleprompters generate and evaluate prompts against a defined metric using a labeled trainset to improve multi-stage QA outputs.

Can I use automated prompt optimization across multiple LM providers like OpenAI and Claude?

Yes, automated prompt optimization supports multiple LM providers like OpenAI and Claude. You can optimize multi-stage QA and RAG pipelines across different providers using data-driven metrics and teleprompters.

Do I need a labeled dataset to run automated prompt optimization?

Yes, you need a labeled trainset and a defined evaluation metric to run automated prompt optimization. A validation set is optional but recommended to support optimizers like BootstrapFewShot, MIPRO, and KNNFewShot.

What are the limitations of using teleprompters for prompt optimization?

Teleprompter-driven optimization requires structured labeled data and a defined evaluation metric to function. Without a clear metric or sufficient trainset data, optimizers like BootstrapFewShot or COPRO cannot effectively evaluate and improve prompt quality.