dspy

Declaratively compose prompts, reasoning steps, and tools into modular language-model pipelines.

Updated Mar 30, 2026
One-click install
npx skills add https://github.com/KappTech88/AI-RESEARCH-SKILLS-MCP --skill dspy-kapptech88
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dspy
Source: https://github.com/KappTech88/AI-RESEARCH-SKILLS-MCP/tree/main/skills/dspy
Command: npx skills add https://github.com/KappTech88/AI-RESEARCH-SKILLS-MCP --skill dspy-kapptech88

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It enables developers to assemble complex AI systems by declaratively composing prompts, reasoning steps, and tools, reducing ad-hoc prompt engineering and enabling reusable pipelines across projects.

Core Features & Use Cases

  • Declarative LM programming: define Signatures, modules, and workflows (Predict, ChainOfThought, ReAct, ProgramOfThought) for robust reasoning and tooling.
  • Modular RAG and agents: build retrieval-augmented setups and tool-using agents with clean interfaces.
  • Optimized workflows: integrate teleprompters like BootstrapFewShot, MIPRO, COPRO, to improve prompts with data.

Quick Start

Install DSPy, set up an LM provider, and instantiate a minimal module with a simple Predict to run a basic QA task.

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 without ad-hoc prompt engineering?

Build modular RAG pipelines by declaratively composing prompts, reasoning steps, and tools into reusable components. This approach replaces ad-hoc prompt engineering with structured signatures and modules, enabling robust retrieval-augmented generation across projects.

What is declarative language model programming and when should I use it?

Declarative language model programming assembles complex AI systems by defining signatures, modules, and workflows like ChainOfThought or ReAct. Use it to reduce ad-hoc prompt engineering and enable reusable, type-safe pipelines for research, agents, and classification tasks.

How do I optimize prompts automatically using training data?

Optimize prompts automatically by integrating teleprompters like BootstrapFewShot, MIPRO, or COPRO into your declarative workflows. These optimizers improve your language model prompts systematically using data, enhancing reasoning and tool integration without manual tuning.

Can I use ChainOfThought and ReAct modules with OpenAI or Anthropic providers?

Yes, you can use reasoning modules like ChainOfThought and ReAct with OpenAI or Anthropic providers. The system requires a Python environment with optional language model providers configured, enforcing type-safety and reproducibility through structured outputs.

What is the best way to structure multi-stage reasoning workflows for agents?

The best way to structure multi-stage reasoning workflows is by declaratively composing modules like Predict, ChainOfThought, ReAct, and ProgramOfThought. This modular approach provides clean interfaces for building tool-using agents and complex reasoning steps.

Do I need a specific Python environment to run declarative LM pipelines?

Yes, you need a Python environment with the DSPy framework installed and optional language model providers like OpenAI or Anthropic configured. This setup enforces safety, type-safety, and reproducibility through structured outputs and defined signatures.