dspy

Compose DSPy modules and optimizers to build self-improving AI pipelines.

Updated Apr 23, 2026
One-click install
npx skills add https://github.com/Rawgrowth-Consulting/rawclaw-agent --skill dspy-rawgrowth-consulting
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: dspy
Source: https://github.com/Rawgrowth-Consulting/rawclaw-agent/tree/main/skills/mlops/research/dspy
Command: npx skills add https://github.com/Rawgrowth-Consulting/rawclaw-agent --skill dspy-rawgrowth-consulting

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Declarative DSPy enables teams to build complex, self-improving AI pipelines without hand-tuning prompts, by composing LM calls, reasoning steps, and optimization workflows into modular components.

Core Features & Use Cases

  • Declarative module composition for Predict, ChainOfThought, ReAct, and ProgramOfThought to build end-to-end AI systems.
  • Supports RAG, agents, classifiers, and multi-stage pipelines with built-in optimization using teleprompters.
  • Real-world use: design a multi-hop QA or a RAG-based document classifier that improves over time with data.

Quick Start

Create a simple three-stage pipeline (retrieve, think, answer) and run a basic end-to-end example.

Frequently Asked Questions about dspy

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

FAQPage Schema
How do I build self-improving AI pipelines without hand-tuning prompts?▼

Declarative programming enables self-improving AI pipelines by composing LM calls and optimizers into modular components. This eliminates manual prompt tuning by using built-in teleprompters to automatically optimize multi-stage ML workflows.

What is declarative module composition for language model pipelines?▼

Declarative module composition is a method to build end-to-end AI systems using components like Predict, ChainOfThought, ReAct, and ProgramOfThought. It allows you to structure complex reasoning steps and LM calls without writing imperative prompt instructions.

How do I set up a multi-stage RAG pipeline with automatic optimization?▼

You set up a multi-stage RAG pipeline by declaratively composing retrieval, thinking, and answering steps. Built-in optimizers then automatically refine the language model calls within these stages using your provided data.

Can I use declarative programming to build multi-hop QA agents?▼

Yes, you can build multi-hop QA agents and classifiers using declarative module composition. The framework supports agents and multi-stage pipelines that improve over time through automatic optimization workflows.

Does declarative programming require manual prompt engineering for classifiers?▼

No, declarative programming removes the need for manual prompt engineering by using optimizers. These teleprompters automatically tune the language model calls within your classifiers and RAG systems based on data.

What are the limitations of using declarative LM pipelines for ML systems?▼

Declarative LM pipelines require defining modular components and providing data for the automatic optimization process to function effectively. Teams must structure their multi-stage ML workflows declaratively rather than relying on isolated prompt adjustments.