dspy

Automate building declarative LM pipelines with DSPy.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

DSPy enables building complex AI systems by declaratively composing language-model tasks into modular pipelines, reducing manual prompt tuning and enabling self-improving workflows.

Core Features & Use Cases

  • Declarative signatures with type-safe inputs/outputs for LM tasks
  • Built-in optimizers (BootstrapFewShot, MIPRO, COPRO, etc.) to automate prompt and data optimization
  • Multi-stage pipelines, RAG, agents, and reusable modules for production-grade AI systems

Quick Start

Define a simple DSPy module with a QA signature and run BootstrapFewShot to optimize prompts on a tiny trainset.

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 language model pipelines?

Build declarative LM pipelines by composing modular tasks with type-safe signatures. This approach reduces manual prompt engineering and enables self-improving workflows for complex RAG and agent systems.

How do I build a multi-stage RAG pipeline with type-safe signatures?

Build a multi-stage RAG pipeline by defining declarative, type-safe input and output signatures for each LM task. These modular components are then composed together, ensuring JSON-serializable configurations for production-grade AI systems.

Can I use DSPy optimizers with OpenAI and Anthropic models?

Yes, you can use DSPy optimizers like BootstrapFewShot, MIPRO, and COPRO with OpenAI and Anthropic models. The framework supports declarative LM programming across these providers to automate prompt and data optimization.

What is the best way to create self-improving AI agents without manual prompt tuning?

The best way to create self-improving AI agents without manual prompt tuning is using declarative LM programming with built-in optimizers. This automates prompt and data optimization, allowing modular agent pipelines to improve themselves over time.

Does declarative LM programming work for both research and production tasks?

Yes, declarative LM programming works for both research and production tasks. It supports modular composition, multi-stage pipelines, and JSON-serializable configurations, satisfying requirements for scalable AI systems from experimentation to deployment.