dspy

Automate declarative language-model programming to design and optimize AI pipelines.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Building robust AI systems often requires stitching together disparate tools, prompts, and workflows in brittle code. DSPy provides a declarative framework to define task signatures and compose Predict, ChainOfThought, ReAct, and ProgramOfThought modules, enabling scalable, maintainable AI pipelines with self-improvement capabilities.

Core Features & Use Cases

  • Declarative LM programming with built-in modules: Predict, ChainOfThought, ReAct, ProgramOfThought, and TypedPredictor for type-safe outputs.
  • Optimizers and teleprompters: BootstrapFewShot, MIPRO, BootstrapFinetune, COPRO, KNNFewShot for prompt and weight optimization.
  • RAG, agents, and multi-stage pipelines: retrieval, reasoning, tool-use, and orchestration of complex workflows.
  • Production readiness: batch processing, exportable datasets, saving/loading modules, and LM provider configuration.

Quick Start

Make a simple DSPy module using Predict and run a basic QA example.

Frequently Asked Questions about dspy

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

FAQPage Schema
How do I optimize prompts for language models automatically?▼

Automated prompt optimization is handled by teleprompters like BootstrapFewShot, MIPRO, and COPRO. These optimizers tune your language model pipelines data-driven, replacing manual prompt engineering with systematic weight and few-shot example adjustments.

What is declarative programming for machine learning pipelines?▼

Declarative machine learning programming involves defining task signatures and composing modules like Predict and ChainOfThought. This approach enables scalable, maintainable AI pipelines by abstracting brittle prompt stitching into structured, self-improving workflows.

How do I build RAG systems and agents without brittle code?▼

Building RAG systems and agents is done by composing modular components for retrieval, reasoning, and tool-use. This framework orchestrates complex multi-stage workflows, replacing fragile custom code with maintainable, declarative AI pipelines.

Can I use ChainOfThought and ReAct modules for complex reasoning tasks?▼

ChainOfThought and ReAct modules are fully supported for complex reasoning tasks. You can compose these built-in modules alongside ProgramOfThought and TypedPredictor to orchestrate multi-stage workflows and ensure type-safe outputs.

Does this framework support batch processing and exportable training data?▼

Batch processing and exportable training data are supported for production readiness. You can configure language model providers, save and load modules, and export datasets to streamline deployment and evaluation of your AI pipelines.

When should I use automated teleprompters instead of manual prompt engineering?▼

Automated teleprompters should be used when building scalable, robust AI systems that require data-driven prompt optimization. If your workflow involves complex RAG, classifiers, or multi-stage agents, these optimizers replace brittle manual tuning with maintainable, self-improving pipelines.