dspy

Automates building self-improving AI systems by declaratively programming LM workflows.

Updated Apr 23, 2026
One-click install
npx skills add https://github.com/Chris-Chai-Minjae/hermes-agent-r1-bridge --skill dspy-chris-chai-minjae
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dspy
Source: https://github.com/Chris-Chai-Minjae/hermes-agent-r1-bridge/tree/main/skills/mlops/research/dspy
Command: npx skills add https://github.com/Chris-Chai-Minjae/hermes-agent-r1-bridge --skill dspy-chris-chai-minjae

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Declarative and modular LM programming enables building complex AI systems with fewer errors and more maintainable pipelines.

Core Features & Use Cases

  • Compose Predict, ChainOfThought, ReAct, ProgramOfThought, and other DSPy modules into end-to-end workflows.
  • Build retrieval-augmented generation (RAG) systems, agents, and classifiers with strong type safety and reusability.
  • Automatically optimize prompts and instructions using teleprompters to improve performance across tasks.

Quick Start

Create a DSPy module that orchestrates a retrieval-augmented QA pipeline and demonstrates end-to-end modular composition.

Frequently Asked Questions about dspy

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

FAQPage Schema
How do I automate LM workflows without manually writing prompts?

Automating LM workflows declaratively lets you program pipelines using modular components instead of manual prompts. You compose modules like ChainOfThought and ReAct into end-to-end workflows, then use teleprompters such as BootstrapFewShot to automatically optimize instructions and improve task performance.

What is the best way to build a retrieval-augmented generation pipeline with modular components?

Building a retrieval-augmented generation pipeline is best done by composing DSPy modules into an end-to-end workflow. You orchestrate retrieval and prediction steps with strong type safety and reusability, creating maintainable RAG systems that can be automatically optimized using teleprompters.

Can I use declarative programming to build AI agents and classifiers?

Yes, declarative programming supports building AI agents and classifiers by composing modules like ReAct and Predict into multi-stage workflows. This approach provides strong type safety and reusability, enabling you to build complex agent systems with fewer errors and more maintainable pipelines.

Do I need Python and the DSPy library to optimize prompts automatically?

Yes, you need Python and the DSPy library to optimize prompts automatically. The environment supports optional teleprompters like BootstrapFewShot and MIPRO, which iterate on designs and automatically improve prompt performance across research and production tasks.

How does declarative LM programming compare to manual prompt engineering for production environments?

Declarative LM programming reduces errors and improves maintainability compared to manual prompt engineering by treating prompts as modular, programmable components. It enables automatic optimization through teleprompters, allowing you to iterate on designs and improve performance across production environments without manual tuning.

Why should I use teleprompters like BootstrapFewShot and MIPRO for prompt optimization?

Teleprompters like BootstrapFewShot and MIPRO automate prompt optimization by iterating on designs to improve performance across tasks. They replace manual prompt tuning with systematic optimization, enabling self-improving AI systems that deliver better results in both research and production environments.