dspy

Program language models declaratively and optimize prompts automatically with dspy.

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

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 enables the creation of complex AI systems by allowing declarative programming of language models, optimizing prompts, and automating tasks.

Core Features & Use Cases

  • Declarative Programming: Program LMs declaratively, avoiding manual prompt engineering.
  • Automatic Optimization: Optimize prompts using data-driven methods for better model outputs.
  • Modular AI Pipelines: Build maintainable and portable AI workflows.
  • Use Case: Design a modular AI system for customer support that integrates text extraction, sentiment analysis, and automated responses.

Quick Start

Use the dspy skill to create a QA module for a chatbot that can answer questions based on a provided context.

Frequently Asked Questions about dspy

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

FAQPage Schema
How do I automate prompt optimization for language models without manual prompt engineering?

Automate prompt optimization by using declarative programming to define AI pipelines, letting the system optimize language model prompts data-driven. This avoids manual prompt engineering by treating prompts as modular components.

What is declarative programming for language models and when do I need it?

Declarative programming for language models defines what the AI pipeline should achieve rather than manually crafting prompts. You need it when building complex AI systems requiring maintainable, modular workflows.

How do I build a modular AI pipeline for complex tasks like customer support?

Build a modular AI pipeline by declaratively programming language model modules for tasks like text extraction and sentiment analysis. This creates maintainable, portable AI workflows for complex systems like customer support automation.

Does this declarative AI pipeline approach work with OpenAI and Anthropic models?

Yes, declarative AI pipeline programming works with OpenAI and Anthropic models. It requires configuring a language model provider to integrate these dependencies for pipeline construction and automatic prompt optimization.

What's the best way to structure a QA chatbot that answers questions based on provided context?

Structure a QA chatbot by creating a declarative module that passes context to a language model. This modular approach automates prompt configuration, allowing the model to answer questions based on the provided context accurately.

Why should I use declarative programming over manual prompt engineering for AI workflows?

Use declarative programming over manual prompt engineering to build maintainable, portable AI workflows. It enables automatic prompt optimization using data-driven methods, significantly improving model outputs for complex AI tasks.