dspy

Automate declarative LM programming and prompt optimization for modular AI pipelines.

Updated Jun 11, 2026
One-click install
npx skills add https://github.com/LamseyahElias/jarvis-cloud-v2 --skill dspy-lamseyahelias
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dspy
Source: https://github.com/LamseyahElias/jarvis-cloud-v2/tree/main/hermes-agent/skills/mlops/research/dspy
Command: npx skills add https://github.com/LamseyahElias/jarvis-cloud-v2 --skill dspy-lamseyahelias

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Declarative LM programming and automatic prompt optimization to help engineers build robust, modular AI pipelines with RAG capabilities and agent-like workflows.

Core Features & Use Cases

  • Declarative module design for scalable language-model systems.
  • Automatic prompt optimization and few-shot generation to improve LM performance.
  • Use cases include RAG, ReAct-style agents, and multi-stage reasoning pipelines.

Quick Start

Create a simple ChainOfThought module and run the BootstrapFewShot optimizer on a small training set to observe automatic prompt optimization.

Frequently Asked Questions about dspy

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

FAQPage Schema
What is automatic prompt optimization for modular AI pipelines?

Declarative LM programming structures language model systems into modular components that define specific inputs, outputs, and behaviors. It enables scalable RAG systems and ReAct-style agent workflows by composing reusable modules rather than writing hardcoded prompts.

How do I build a RAG system with agent workflows using declarative modules?

You build a RAG system by defining declarative modules for retrieval and generation, then chaining them into agent workflows. An optimizer like BootstrapFewShot runs on a training set to automatically generate demonstrations and refine the pipeline's logic.

Does this prompt optimization approach work with diverse language model providers?

Yes, declarative LM programming supports building multi-stage reasoning pipelines across diverse LM providers. You define modules and metrics independently, allowing the teleprompter workflow to optimize prompts regardless of the underlying language model provider.

What's the best way to generate few-shot examples for multi-stage reasoning tasks?

The best way to generate few-shot examples is using a metric-driven teleprompter workflow like BootstrapFewShot. It evaluates your declarative modules against a training set to automatically extract effective demonstrations and instruction tweaks for deployment.

When should I not use automated prompt optimization for language model programming?

Avoid automated prompt optimization if you lack a defined metric to evaluate multi-stage reasoning tasks, or if your training set is too small. The teleprompter requires metric-driven feedback to generate effective demonstrations and fine-tuning data.