Dspy Embedding Retrieval
Use for DSPy retrieval with dspy.Embedder, dspy.Embeddings, FAISS indexes, semantic search, and local or hosted embedding models.
Install
/plugin marketplace add OmidZamani/dspy-skillsThe repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.
npx skills add OmidZamani/dspy-skills --skill dspy-embedding-retrievalgit clone --depth 1 https://github.com/OmidZamani/dspy-skills.git /tmp/dspy-skills
mkdir -p ~/.claude/skills
cp -r /tmp/dspy-skills/skills/dspy-embedding-retrieval ~/.claude/skills/dspy-embedding-retrievalPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# DSPy Embedding Retrieval
## Goal
Build semantic retrieval over an application-owned text corpus with `dspy.Embedder` and `dspy.Embeddings`.
## Basic Hosted Embedder
```python
import dspy
corpus = [
"DSPy programs are composed from modules.",
"MIPROv2 optimizes instructions and demonstrations.",
"RLM explores large contexts with a sandboxed REPL.",
]
embedder = dspy.Embedder("openai/text-embedding-3-small")
search = dspy.Embeddings(corpus=corpus, embedder=embedder, k=2)
result = search("Which optimizer tunes prompts?")
print(result.passages)
print(result.indices)
```
## Use in RAG
```python
class LocalRAG(dspy.Module):
def __init__(self, retriever):
super().__init__()
self.retriever = retriever
self.answer = dspy.ChainOfThought("context: list[str], question -> answer")
def forward(self, question: str):
context = self.retriever(question).passages
return self.answer(context=context, question=question)
```
## Custom Local Embeddings
Wrap any callable that accepts `list[str]` and returns a 2D numeric array:
```python
from sentence_transformers import SentenceTransformer
import dspy
model = SentenceTransformer("sentence-transformers/static-retrieval-mrl-en-v1")
embedder = dspy.Embedder(model.encode)
search = dspy.Embeddings(corpus=corpus, embedder=embedder, k=5)
```
## Scores, FAISS, and Persistence
Use `dspy.EmbeddingsWithScores` when downstream logic needs similarity thresholds or reranking.Details
- Skill name
dspy-embedding-retrieval- Repository
- OmidZamani/dspy-skills
- Path
skills/dspy-embedding-retrieval/SKILL.md- License
- MIT
- Repo updated
- 23 June 2026
- Listed in
- heilcheng/awesome-agent-skills
FAQ
What does the Dspy Embedding Retrieval skill do?
Use for DSPy retrieval with dspy.Embedder, dspy.Embeddings, FAISS indexes, semantic search, and local or hosted embedding models.
How do I install the Dspy Embedding Retrieval skill?
Claude Code plugin: /plugin marketplace add OmidZamani/dspy-skills. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Dspy Embedding Retrieval popular?
It lives in OmidZamani/dspy-skills, which has 125 GitHub stars and 13 forks, and is included in 1 curated skill list.
Related skills
Dspy Adapters Multimodal
125OmidZamani/dspy-skills
Use for DSPy adapter selection, JSONAdapter, XMLAdapter, ChatAdapter, native function calling, structured outputs, and multimodal inputs like dspy.Image or dspy.Audio.
Dspy Advanced Module Composition
125OmidZamani/dspy-skills
Use for composing DSPy modules with Ensemble, MultiChainComparison, ensemble voting, sequential pipelines, and multi-program workflows.
Dspy Better Together
125OmidZamani/dspy-skills
Use for BetterTogether, prompt plus weight optimization, fine-tuning sequences, and strategy chains like p -> w -> p.
Dspy Finetune Bootstrap
125OmidZamani/dspy-skills
Use for BootstrapFinetune, fine-tuning DSPy models, teacher-student distillation, weight optimization, and lower-cost deployment.
Dspy Bootstrap Fewshot
125OmidZamani/dspy-skills
Use for BootstrapFewShot, bootstrapped demonstrations, teacher-model demos, and low-data DSPy prompt optimization.
Dspy Gepa Reflective
125OmidZamani/dspy-skills
Use for GEPA reflective optimization, ReAct agent optimization, feedback metrics, LLM reflection, and execution trajectories.
Browse the most popular Claude skills, all ai, llms & agents skills, or write your own with the skills generator.