dspy

Implement declarative language model programming with automatic prompt optimization.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill simplifies the development of AI systems by enabling declarative programming of language models, providing automatic prompt optimization, and modular AI pipelines.

Core Features & Use Cases

  • Declarative Programming: Write AI tasks in a natural language, reducing the need for manual prompt engineering.
  • Automatic Optimization: Optimize prompts and models using data-driven methods for better performance.
  • Modular AI: Create modular AI components that can be combined to build complex systems.
  • Use Case: Develop a customer support bot that combines RAG systems, classifiers, and text summarization to provide accurate, efficient support.

Quick Start

Use the dspy skill to build a question-answering system using the following code:

import dspy
qa = dspy.ChainOfThought("question -> answer")
response = qa(question="What is the capital of France?")
print(response.answer)

Frequently Asked Questions about dspy

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

FAQPage Schema
How do I build an AI system with declarative programming instead of manual prompt engineering?

Declarative language model programming allows you to build AI systems by specifying tasks naturally rather than crafting manual prompts, enabling automatic optimization and modular pipelines for complex workflows.

What is the best way to optimize prompts for language models automatically?

Automatic prompt optimization uses data-driven methods to tune language models for better performance, replacing manual prompt engineering with systematic adjustments based on evaluation data.

How do I create a modular AI pipeline for a customer support bot using RAG?

You can build a modular AI pipeline by combining RAG systems, classifiers, and text summarization components to create a customer support bot that provides accurate, efficient responses.

Do I need OpenAI and Anthropic integration to use declarative language model programming?

Yes, integrating with language models requires dependencies on the OpenAI and Anthropic libraries, which provide the underlying model calls for executing your declarative AI workflows.

Can I use declarative programming to combine multiple AI components like classifiers and summarization?

Yes, declarative programming supports modular AI components, allowing you to combine classifiers, text summarization, and other modules to build complex, multi-component reasoning systems.

What are the limitations of using declarative programming for complex AI development?

Declarative language model programming requires managing dependencies like dspy, openai, and anthropic, and involves complex multi-component workflows and data-driven optimization that demand advanced implementation knowledge.