dspy

Develop and orchestrate end-to-end AI workflows with DSPy's declarative LM programming and built-in optimizers.

11|Updated May 17, 2026
One-click install
npx skills add https://github.com/StarryCod/cogitum --skill dspy-starrycod
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dspy
Source: https://github.com/StarryCod/cogitum/tree/main/cogitum/data/skills/mlops/research/dspy
Command: npx skills add https://github.com/StarryCod/cogitum --skill dspy-starrycod

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Declarative LM programming enables building complex AI systems with structured modules, automated prompt optimization, and reusable pipelines, reducing hand-tuned prompts and trial-and-error iteration.

Core Features & Use Cases

  • Type-safe modules and signatures (Predict, ChainOfThought, ReAct, ProgramOfThought) to compose scalable AI systems.
  • Built-in optimizers (BootstrapFewShot, MIPRO, BootstrapFinetune, COPRO, KNNFewShot) to automatically improve prompts and, optionally, fine-tune weights.
  • End-to-end pipelines for RAG, agents, classifiers, and multi-stage workflows with evaluation and deployment tooling.

Quick Start

Define a simple QA module and optimize prompts with BootstrapFewShot.

Frequently Asked Questions about dspy

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

FAQPage Schema
How do I automate prompt optimization for RAG systems without manual tuning?

Automate prompt optimization for RAG systems by applying built-in optimizers like BootstrapFewShot or MIPRO, which automatically generate and refine prompts to improve pipeline performance without manual trial-and-error.

What is declarative LM programming and how does it structure multi-stage workflows?

Declarative LM programming structures multi-stage workflows using type-safe modules and signatures like Predict, ChainOfThought, and ReAct, enabling scalable AI system composition through reusable, modular pipelines.

Can I use ChainOfThought and ReAct modules to build agent pipelines?

Yes, you can build agent pipelines using module primitives like ChainOfThought and ReAct to orchestrate multi-stage workflows, allowing seamless composition of reasoning and action-based tasks across LM providers.

Does DSPy support fine-tuning model weights alongside prompt optimization?

Yes, DSPy supports optional fine-tuning of model weights alongside prompt optimization through teleprompters like BootstrapFinetune, allowing you to improve both prompts and weights within end-to-end AI workflows.

What's the best way to evaluate and deploy end-to-end AI classifiers?

The best way to evaluate and deploy AI classifiers is using built-in evaluation metrics within declarative pipelines, allowing you to measure performance and deploy optimized multi-stage workflows systematically.