dspy

Compile declarative language model signatures into self-improving modules.

Updated Jun 17, 2026
One-click install
npx skills add https://github.com/cxnaive/hermes-agent-llbot --skill dspy-cxnaive
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dspy
Source: https://github.com/cxnaive/hermes-agent-llbot/tree/main/optional-skills/mlops/research/dspy
Command: npx skills add https://github.com/cxnaive/hermes-agent-llbot --skill dspy-cxnaive

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires dspy, openai, anthropic, and includes references (resource) components.

What problem does it solve?

This Skill solves the fragility and manual labor of traditional prompt engineering by providing a framework to program language models declaratively and optimize them automatically using data-driven methods.

Core Features & Use Cases

  • Declarative LM Programming: Define task signatures (inputs and outputs) instead of writing brittle prompt templates.
  • Automatic Optimization: Use built-in teleprompters to iteratively improve prompts and few-shot examples based on your specific validation metrics.
  • Modular Pipelines: Build complex, maintainable AI systems like RAG, multi-hop reasoning, or agentic workflows that are portable across different model providers.

Quick Start

Use the dspy skill to configure your language model and compile a question-answering module using your provided training dataset.

Frequently Asked Questions about dspy

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

FAQPage Schema
How do I optimize LLM pipelines without writing manual prompt templates?

You can optimize LLM pipelines by compiling declarative task signatures into self-improving modules that automatically refine prompts and few-shot examples based on your validation metrics.

Can I build RAG and multi-stage reasoning workflows that work across different LLM providers?

Yes, you can build modular RAG and multi-stage reasoning pipelines that are portable across different LLM providers by defining declarative signatures rather than hardcoding provider-specific logic.

Do I need a validation dataset to use automatic prompt optimization?

Yes, automatic prompt optimization requires systematic validation metrics from your training dataset to iteratively evaluate and refine prompts and few-shot demonstrations.

What is the best way to maintain complex agentic workflows instead of using brittle prompts?

The best way to maintain agentic workflows is programming language models declaratively, which compiles task inputs and outputs into maintainable, optimized pipelines.

Does this approach support both OpenAI and Anthropic models for multi-hop reasoning?

Yes, this approach supports multi-hop reasoning and agentic tool use across various LLM providers, explicitly including dependencies for both OpenAI and Anthropic models.

Why does manual prompt engineering fail when scaling complex AI systems?

Manual prompt engineering fails due to fragility and labor intensity, whereas declarative programming compiles task signatures into optimized, data-driven pipelines that self-improve.