dspy

Composes modular DSPy pipelines for LM tasks with declarative AI.

1.2k|116|Updated Mar 19, 2026
One-click install
npx skills add https://github.com/math-inc/OpenGauss --skill dspy-math-inc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dspy
Source: https://github.com/math-inc/OpenGauss/tree/main/skills/mlops/research/dspy
Command: npx skills add https://github.com/math-inc/OpenGauss --skill dspy-math-inc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

DSPy provides a framework to build complex AI systems as modular, declarative pipelines, enabling tooling for prompts, RAG, and agent workflows.

Core Features & Use Cases

  • Declarative signatures and safe module composition for LM tasks
  • Chain-of-Thought, ReAct, and ProgramOfThought style modules for flexible reasoning
  • Optimization workflows with teleprompters (BootstrapFewShot, MIPRO, COPRO, COPRO)
  • Real-world use cases including RAG pipelines, agents, and structured extraction

Quick Start

Install DSPy and run a simple Predict-based QA flow to see results.

Frequently Asked Questions about dspy

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

FAQPage Schema
How do I build modular RAG pipelines with declarative AI modules?

Declarative RAG pipelines are built by composing DSPy modules like Predict, ChainOfThought, and ReAct, which enables modularity and reuse for multi-step reasoning tasks. This framework treats LM tasks as composable pipelines rather than hardcoded prompts.

What is data-driven prompt optimization for LM workflows?

Data-driven prompt optimization uses teleprompters like BootstrapFewShot, MIPRO, and COPRO to automatically tune and optimize prompts within declarative AI pipelines. This replaces manual prompt engineering with systematic, programmatic optimization workflows.

Can I use declarative signatures for multi-step reasoning and agent workflows?

Yes, declarative signatures support safe module composition for multi-step reasoning and agent workflows. Modules like ReAct and ProgramOfThought provide flexible reasoning patterns that can be combined to build complex AI systems.

What's the best way to structure agent workflows without manual prompt engineering?

Structure agent workflows by composing declarative modules such as ChainOfThought and ReAct into modular pipelines, then apply teleprompter optimization. This approach enables reuse and data-driven prompt tuning instead of manual engineering.

Do I need dependencies installed to run declarative LM pipelines?

The Skill lists no external dependencies, but requires a YAML frontmatter with name and description in SKILL.md. Optional references, scripts, and assets can be included to support the pipeline implementation.

When should I not use declarative pipelines for LM tasks?

Declarative AI pipelines may add unnecessary overhead for simple, single-step LM tasks that do not require modular composition, multi-step reasoning, or data-driven prompt optimization. For straightforward predictions without reuse needs, direct API calls may suffice.