dspy

Compile declarative language model calls and optimize prompts with DSPy.

Updated Jun 9, 2026
One-click install
npx skills add https://github.com/zhouboyu-xreal/Hermes-Memory --skill dspy-zhouboyu-xreal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dspy
Source: https://github.com/zhouboyu-xreal/Hermes-Memory/tree/main/skills/mlops/research/dspy
Command: npx skills add https://github.com/zhouboyu-xreal/Hermes-Memory --skill dspy-zhouboyu-xreal

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps automate prompt optimization and improve language model performance with declarative programming.

Core Features & Use Cases

  • Declarative Language Model Programming: Build AI systems by defining signatures and modules, without manual prompt engineering.
  • Automatic Prompt Optimization: Leverage data-driven methods to automatically refine prompts.
  • Use Case: If you're developing a complex AI system with multiple components and workflows, this Skill can help you build and optimize it more efficiently.

Quick Start

Use the dspy skill to create a QA module for the language model.

Frequently Asked Questions about dspy

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

FAQPage Schema
How do I optimize language model prompts automatically without manual engineering?

Automatic prompt optimization uses declarative programming to define signatures and modules, leveraging data-driven methods to refine prompts without manual engineering. This approach compiles language model calls and optimizes them using trained data.

What is declarative programming for AI systems and how does it handle multi-component workflows?

Declarative programming for AI systems builds multi-component workflows by defining signatures and modules rather than writing manual prompts. This mechanism optimizes language models by compiling calls and applying data-driven techniques automatically.

Do I need the DSPy library to use automatic prompt optimization for language models?

Yes, the DSPy library is required to compile declarative language model calls and optimize them using trained data. It provides the foundational framework for creating signatures and modules without manual prompt engineering.

Can I use OpenAI and Anthropic models with declarative programming for prompt optimization?

Yes, declarative programming for prompt optimization supports OpenAI and Anthropic models as dependencies. You can build and optimize multi-component AI systems using these providers within the framework.

What's the best way to build a complex multi-component AI system without manual prompt engineering?

The best way to build a complex multi-component AI system without manual prompt engineering is using declarative programming. Define signatures and modules to construct workflows, then apply automatic prompt optimization using data-driven methods.

Why does automatic prompt optimization require trained data for language models?

Automatic prompt optimization requires trained data to apply data-driven methods that refine prompts accurately. This data enables the system to evaluate and optimize language model performance across multi-component workflows effectively.