dspy

Optimize language model prompts and pipelines through declarative programming and data-driven compilation.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill solves the fragility and manual labor of traditional prompt engineering by providing a framework to program language models declaratively and optimize them automatically.

Core Features & Use Cases

  • Declarative Programming: Define AI tasks using signatures (inputs and outputs) rather than writing brittle prompt templates.
  • Automatic Optimization: Use data-driven teleprompters to iteratively improve prompts and few-shot examples based on your specific metrics.
  • Modular Pipelines: Build complex, multi-stage AI systems like RAG, agents, or classifiers that are maintainable, portable, and systematically improved.

Quick Start

Use the dspy skill to define a signature for a question-answering task and compile it with a BootstrapFewShot optimizer using your provided training data.

Frequently Asked Questions about dspy

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

FAQPage Schema
What is declarative programming for language models?

Automatic prompt optimization uses data-driven teleprompters to iteratively improve prompts and few-shot examples based on your specific metrics. It replaces manual prompt engineering labor with systematic, data-backed compilation.

How do I build modular pipelines for RAG and AI agents?

You need integration with language model providers and training datasets to perform systematic prompt optimization. The framework requires dependencies like dspy, openai, and anthropic to compile declarative programs into optimized pipelines.

Does this approach work with OpenAI and Anthropic models?

Manual prompt engineering is fragile and labor-intensive, whereas declarative compilation systematically optimizes prompts using your training data. This approach replaces brittle templates with modular, maintainable pipelines.

How do I compile a question-answering task with a BootstrapFewShot optimizer?

To compile a question-answering task, define a declarative signature for the inputs and outputs, then compile it with a BootstrapFewShot optimizer using your provided training data. This automatically generates optimized few-shot examples.