Agent skill

dspy

Compile prompts into self-improving pipelines with signatures, modules, optimizers, and programmatic prompt engineering

Stars 4
Forks 4

Install this agent skill to your Project

npx add-skill https://github.com/vamseeachanta/workspace-hub/tree/main/.claude/skills/ai/prompting/dspy

SKILL.md

Dspy

Quick Start

bash
# Install DSPy
pip install dspy-ai

# Optional: For retrieval
pip install chromadb faiss-cpu

# Set API key
export OPENAI_API_KEY="your-api-key"

When to Use This Skill

USE when:

  • Need to optimize prompts programmatically rather than manually
  • Building pipelines where prompt quality is critical to success
  • Want reproducible, testable prompt engineering
  • Working with complex multi-step reasoning tasks
  • Need to automatically find effective few-shot examples
  • Building systems that improve with more training data
  • Require systematic evaluation and comparison of prompt strategies
  • Want to abstract away prompt engineering from application logic

DON'T USE when:

  • Simple single-shot prompts that work well as-is
  • Need fine-grained control over exact prompt wording
  • Building applications with minimal LLM interactions
  • Prototyping where rapid iteration is more important than optimization
  • Resource-constrained environments (optimization requires API calls)

Prerequisites

bash
# Core installation
pip install dspy-ai>=2.4.0

# For vector retrieval
pip install chromadb>=0.4.0 faiss-cpu>=1.7.0

# For different LLM providers
pip install openai>=1.0.0 anthropic>=0.5.0

# For evaluation
pip install pandas>=2.0.0 scikit-learn>=1.0.0

# Environment setup
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."

Resources


Version History

  • 1.0.0 (2026-01-17): Initial release with signatures, modules, optimizers, and RAG

Sub-Skills

  • 1. Signatures
  • 2. Modules
  • 3. Retrieval-Augmented Generation
  • 4. Optimizers
  • 5. Evaluation and Metrics (+1)
  • 1. Start Simple, Then Optimize (+2)
  • Optimization Not Improving (+2)

Sub-Skills

  • DSPy Philosophy
  • Example 1: Engineering Report Analysis Pipeline (+2)
  • Integration with LangChain (+1)

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results