dspy

Build declarative language-model programs with structured signatures and optimizers.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires dspy, openai, anthropic, and includes references (resource) components.

What problem does it solve?

DSPy helps you stop manually tweaking prompts and instead build reliable language-model programs that can be optimized from examples to improve output quality.

Core Features & Use Cases

  • Declarative LM programming via signatures: Define tasks as input → output contracts (e.g., question → answer, text → sentiment) so your pipelines are clearer and more maintainable.
  • Modular multi-stage systems: Compose predictors like Predict, ChainOfThought, ReAct, and retrieval modules to build RAG, agents, and classifiers.
  • Automatic prompt optimization with teleprompters: Use optimizers such as BootstrapFewShot and MIPRO to improve performance using a metric over labeled data.

Quick Start

Configure a DSPy language model provider (OpenAI, Anthropic, or Ollama), define a signature for your task, and run an optimizer (like BootstrapFewShot) to improve accuracy on a labeled set.

Frequently Asked Questions about dspy

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

FAQPage Schema
How do I stop manually tweaking prompts for LLM pipelines?

You can stop manually tweaking prompts by using declarative programming with DSPy. Define tasks as input-to-output signatures and apply optimizers like BootstrapFewShot to automatically improve prompt quality using labeled examples and evaluation metrics.

How does automatic prompt optimization work for RAG and agents?

Automatic prompt optimization works by using teleprompters like MIPRO over your modular pipelines. You provide a metric and labeled data, and the optimizer selects effective few-shot examples and instructions to improve RAG, classification, and multi-stage agent performance.

Can I use DSPy with OpenAI and Anthropic models?

Yes, you can use DSPy with OpenAI and Anthropic models. You configure a DSPy language model provider for your chosen service, allowing you to build and optimize your declarative language-model programs across different supported LM providers.

What is the best way to build multi-stage LLM reasoning systems?

The best way to build multi-stage systems is using declarative programming with structured signatures. You compose modular predictors like ChainOfThought and ReAct alongside retrieval modules to create maintainable pipelines for complex reasoning and extraction tasks.

Do I need labeled data to optimize language model programs?

Yes, you need labeled data to optimize language model programs. Optimizers such as BootstrapFewShot require a defined evaluation metric and a set of labeled examples to automatically select prompts and improve output quality.

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

Declarative signatures replace manual prompt engineering with clear input-to-output contracts, making your pipelines more maintainable. This structured approach allows optimizers to systematically improve performance rather than relying on inconsistent manual tweaks.