dspy

Build modular AI pipelines with DSPy declarative language model programming.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

DSPy enables building complex AI systems by composing modular components through declarative language-model programming, reducing manual prompt engineering and enabling more maintainable pipelines.

Core Features & Use Cases

  • Declarative LM programming for modular AI systems
  • Built-in modules for Predict, ChainOfThought, ReAct, and ProgramOfThought
  • Optimizers and evaluation patterns for self-improving pipelines
  • RAG systems, agents, and multi-stage workflows
  • Type-safe outputs via TypedPredictor for structured results

Quick Start

Install DSPy, define a module signature, and run a simple question-answer example.

Frequently Asked Questions about dspy

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

FAQPage Schema
How do I build declarative AI pipelines without manual prompt engineering?

Declarative AI pipelines reduce manual prompt engineering by composing modular language model components. Using DSPy, you define module signatures and let built-in optimizers self-improve the pipeline for maintainable workflows.

What is the best way to structure a RAG system with language model programming?

A RAG system built with declarative language model programming uses modular components like Predict and ChainOfThought. This approach enables type-safe outputs and self-improving retrieval workflows without fragile prompt strings.

Can I create agent workflows using ReAct and ChainOfThought modules?

Yes, agent workflows can be created using built-in modules like ReAct and ChainOfThought. These compose into multi-stage pipelines that handle reasoning and tool interaction within a declarative language model framework.

How do I get type-safe structured outputs from language models?

Type-safe structured outputs are achieved using TypedPredictor. This module enforces specific output formats within declarative pipelines, ensuring language model responses conform to expected types for reliable downstream processing.

How do teleprompter optimizers improve language model pipelines?

Teleprompter optimizers improve language model pipelines by automatically tuning prompts and module parameters. They evaluate pipeline performance against metrics, enabling self-improving workflows that require less manual intervention.

Does declarative language model programming work for production AI systems?

Declarative language model programming applies to both research and production contexts. By composing modular components and using optimizers, it creates maintainable AI systems that scale effectively beyond initial prototyping.