dspy

Compose prompts and modules to build AI systems with automatic optimization.

174|23|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/RedWoodOG/Hermes-Desktop --skill dspy-redwoodog
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dspy
Source: https://github.com/RedWoodOG/Hermes-Desktop/tree/main/skills/mlops/research/dspy
Command: npx skills add https://github.com/RedWoodOG/Hermes-Desktop --skill dspy-redwoodog

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Declaratively compose prompts and modules to build complex AI systems.

Core Features & Use Cases

  • Declarative LM programming with signatures and structured outputs.
  • Modular composition for reusable, end-to-end pipelines (RAG, agents, benchmarks).
  • Built-in optimizers/teleprompters (BootstrapFewShot, MIPRO, BootstrapFinetune, COPRO, KNNFewShot) to improve prompts automatically.
  • Cross-provider LM support and tooling for robust experimentation.

Quick Start

Define a small module and run a quick prediction to see how DSPy wires prompts and optimizers together.

Frequently Asked Questions about dspy

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

FAQPage Schema
What is declarative programming for LM pipelines and how does it work?

Declarative programming for LM pipelines involves composing prompts and modules via signatures to build complex AI systems. You define what the pipeline should achieve using structured inputs and outputs, allowing the framework to handle prompt wiring and module orchestration automatically.

How do I optimize prompts automatically across different language models?

You optimize prompts automatically by applying built-in teleprompters like BootstrapFewShot, MIPRO, or COPRO. These optimizers adjust and improve your prompts across multiple LM providers, ensuring robust experimentation and effective performance without manual prompt engineering.

Can I build RAG pipelines and agent orchestration using modular composition?

Yes, you can build RAG pipelines and agent orchestration using modular composition. By defining reusable modules with specific signatures, you can declaratively wire them together to create end-to-end workflows that integrate retrieval, generation, and tool use.

What is the best way to structure modules for end-to-end AI workflows?

The best way to structure modules for end-to-end AI workflows is to define clear signatures for each step and compose them declaratively. This modular approach allows you to build reusable components for RAG pipelines or agent benchmarks while leveraging automatic prompt optimization.

Do I need to understand teleprompters and module signatures to configure prompt improvements?

Yes, understanding module signatures and available teleprompters is required to configure safe, effective prompt improvements. You need to know how to define structured inputs and outputs and select the appropriate optimizer to automatically enhance your LM pipelines.

Why use declarative LM programming instead of manual prompt engineering?

Declarative LM programming replaces manual prompt engineering by using signatures and structured outputs to compose modules. This approach enables automatic prompt optimization through teleprompters, ensuring your pipelines self-improve and adapt across different LM providers without constant manual tuning.