dspy-embedding-retrieval — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited dspy-embedding-retrieval (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Build semantic retrieval over an application-owned text corpus with dspy.Embedder and dspy.Embeddings.
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)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)Wrap any callable that accepts list[str] and returns a 2D numeric array:
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)Use dspy.EmbeddingsWithScores when downstream logic needs similarity thresholds or reranking.
For corpora at or above the brute_force_threshold default of 20_000, DSPy builds a FAISS index. Install FAISS first:
pip install faiss-cpuPersist the index when embedding the corpus is expensive:
search.save("./retrieval-index")
loaded = dspy.Embeddings.from_saved("./retrieval-index", embedder=embedder)EmbeddingsWithScores when debugging relevance.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.