dspy

Generate and optimize LLM programs using declarative signatures and metrics.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps you replace fragile, manual prompt crafting with structured language model programs that are easier to maintain, test, and improve.

Core Features & Use Cases

  • Declarative LLM Programming: Define inputs and outputs with signatures instead of hardcoding prompts.
  • Automatic Prompt Optimization: Improve few-shot examples and instructions using training data and metrics.
  • RAG and Agent Workflows: Build retrieval-augmented generation, tool-using agents, and multi-stage reasoning pipelines.
  • Use Case: A research team can use this Skill to create a question-answering system that retrieves documents, reasons over them, and iteratively optimizes performance on a validation set.

Quick Start

Ask the skill to design a DSPy pipeline for your task, including a signature, module choice, retrieval or tool usage if needed, and a metric for optimization.

Frequently Asked Questions about dspy

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

FAQPage Schema
How do I build reliable LLM workflows without manual prompt engineering?

To build reliable LLM workflows without manual prompt engineering, use declarative signatures to define inputs and outputs, composable modules for structure, and optimization metrics to automatically generate and improve few-shot examples and instructions.

What is the best way to optimize prompts for retrieval-augmented generation and multi-step reasoning?

The best way to optimize prompts for retrieval-augmented generation and multi-step reasoning is applying automatic prompt optimization, which uses training data and validation metrics to iteratively evaluate and improve LLM program instructions and few-shot examples.

Can I use OpenAI and Anthropic models to build multi-step reasoning agents?

Yes, you can use OpenAI and Anthropic models to build multi-step reasoning agents by defining declarative signatures and composable modules that structure tool usage and retrieval-augmented generation within your LLM programming pipelines.

How do I design a DSPy pipeline for question answering and structured extraction?

To design a DSPy pipeline for question answering and structured extraction, define a declarative signature, choose composable modules, integrate retrieval or tool usage if needed, and establish an optimization metric to evaluate performance on a validation set.

Why should I replace manual prompt crafting with structured language model programs?

You should replace manual prompt crafting with structured language model programs because declarative signatures and composable modules make LLM applications easier to maintain, test, and iteratively improve using automatic prompt optimization.

Does this approach work for classification and multi-stage reasoning pipelines?

Yes, this approach works for classification and multi-stage reasoning pipelines by using declarative signatures and composable modules to structure the workflows, while applying optimization metrics to automatically evaluate and improve performance.