dspy-rag-pipeline

Build and optimize RAG pipelines with ColBERTv2 in DSPy.

120|13|Updated Dec 21, 2025
One-click install
npx skills add https://github.com/OmidZamani/dspy-skills --skill dspy-rag-pipeline
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dspy-rag-pipeline
Source: https://github.com/OmidZamani/dspy-skills/tree/main/skills/dspy-rag-pipeline
Command: npx skills add https://github.com/OmidZamani/dspy-skills --skill dspy-rag-pipeline

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables building retrieval-augmented generation (RAG) pipelines using ColBERTv2 while providing a framework to systematically optimize both retrieval and generation components.

Core Features & Use Cases

  • Configurable RAG: Connect ColBERTv2 retrieval with a language model to generate grounded answers.
  • Joint Optimization: Simultaneously tune retrieval quality and answer generation for better factuality.
  • Production-ready Example: Use the provided production pattern to evaluate accuracy and grounding on a document corpus.

Quick Start

Configure ColBERTv2 as the retriever, set the LM, define a DSPy RAG module, and run it with a sample question to see retrieved passages and a grounded answer.

Frequently Asked Questions about dspy-rag-pipeline

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

FAQPage Schema
How do I build a retrieval-augmented generation pipeline with ColBERTv2?

Retrieval-augmented generation (RAG) combines document retrieval with language model generation to produce factual, grounded answers. This Skill configures ColBERTv2 as the retriever, connects it to an LM within DSPy, defines a RAG module that retrieves passages then generates answers, and supports production evaluation and grounding checks.

Can I use ColBERTv2 with DSPy for end-to-end pipeline optimization?

Yes. This Skill assembles a complete RAG pipeline in DSPy where ColBERTv2 retrieves passages from a document corpus and the language model generates grounded responses. It enables joint optimization of both retrieval quality and answer generation simultaneously.

What's the difference between retrieval-augmented generation and standard language model generation?

Standard language models generate answers from learned parameters alone, risking hallucination. RAG retrieves relevant passages from external documents first, then generates answers grounded in those passages, improving factuality and enabling access to current or domain-specific knowledge.

How do I configure a retriever and language model for a RAG pipeline?

Configure ColBERTv2 as the retriever, set your language model, define the number of passages to retrieve, create a GenerateAnswer signature, and assemble a RAG module that chains retrieval then generation. The Skill provides production-quality patterns for this configuration.

Can I evaluate accuracy and grounding in a RAG pipeline?

Yes. This Skill includes production-ready evaluation patterns to assess accuracy and verify that generated answers are grounded in retrieved passages from your document corpus, supporting validation before deployment.

What does joint optimization of retrieval and generation mean?

Joint optimization tunes the retriever and generator together rather than separately, ensuring retrieved passages support better answers and answers improve based on retrieval quality. DSPy enables this co-optimization within a single pipeline.