retrieval

retrieval is a skill for Claude Code, Codex from sipyourdrink-ltd/bernstein. It costs 18 tokens per session (329 once invoked), scanned A, original, Apache-2.0.

A guide for building search systems that combine keyword matching with meaning-based search, which finds related ideas even when the wording differs.

In plain words
What is it for?
Use it when working with vector databases, embeddings, document chunking, reranking, query expansion, or search-index pipelines.
Why use it?
It helps improve which documents a search returns and provides rules for measuring accuracy, testing changes, and controlling search settings.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

About the project

Bernstein is an open-source governance layer for AI agents that applies written policies, schedules agent work deterministically, controls approvals, and records verifiable execution history. It is used to coordinate CLI coding agents and other agent workloads, including parallel runs and offline review, while the catalogue entries provide its agent workflows and controls.

sipyourdrink-ltd/bernstein · 1,108 stars · on GitHub · bernstein.run

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/sipyourdrink-ltd/bernstein/retrieval
Any agent
npx skills add sipyourdrink-ltd/bernstein --skill retrieval
Clone the repo
git clone --depth 1 https://github.com/sipyourdrink-ltd/bernstein

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for retrieval

README.md
[![agentmods](https://agentmods.dev/badge/skills/sipyourdrink-ltd/bernstein/retrieval.svg)](https://agentmods.dev/skills/sipyourdrink-ltd/bernstein/retrieval)
Your own site
<a href="https://agentmods.dev/skills/sipyourdrink-ltd/bernstein/retrieval"><img src="https://agentmods.dev/badge/skills/sipyourdrink-ltd/bernstein/retrieval.svg" alt="Measured on agentmods" height="20"></a>
Per session 18 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 329 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00018 $0.00329
Opus 5 $0.00009 $0.00164
Sonnet 5 $0.00004 $0.00066
Haiku 4.5 $0.00002 $0.00033

Measured 6d ago against content hash d05efca234d5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

retrieval scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

templates/skills/retrieval/SKILL.md · 47 lines

What it actually says

Retrieval Engineering Skill

You are a retrieval engineer. Build and optimize search, indexing, and retrieval systems.

Specialization

  • Vector databases (Qdrant, Pinecone, Weaviate)
  • Embedding pipelines and chunking strategies
  • Hybrid search (dense + sparse retrieval)
  • Reranking models and relevance tuning
  • Query understanding and expansion
  • Index management and ingestion pipelines

Work style

  1. Read the task description and existing retrieval code before writing.
  2. Measure recall and precision before and after every change.
  3. Write tests for query construction, filtering, and result parsing.
  4. Keep retrieval configuration (collection names, thresholds, top-k) in config, not hardcoded.
  5. Profile latency for any new retrieval path.

Rules

  • Only modify files listed in your task's owned_files.
  • Run tests before marking complete: uv run python scripts/run_tests.py -x.
  • Never lower recall without explicit approval from the manager.
  • Document any new index schemas or collection changes.

Call load_skill(name="retrieval", reference="hybrid-search.md") for the dense+sparse pattern, or reference="chunking.md" for chunk sizing rules.

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 47 lines · 18 tokens per session scan A d05efca234d5

Subscribe to this mod's changes

retrieval is a skill published in the GitHub repository sipyourdrink-ltd/bernstein (1,108 stars, last pushed today), licensed Apache-2.0. It adds 18 tokens to every session and 329 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

text-provenance

Use when you need to identify the likely source of a text passage, attribute text to documents in a RAG system, detect plagiarism, or match contract clauses to their origin.

LegalQuants/lq-skills · 40 tokens

knowledge-search

Answer questions from the organization's indexed documents using knowledgesearch, and cite every claim back to a retrieved passage. Use whenever a question is about document content. Covers the search-first rule, answering only from the closed set of returned passages, the Sources list format, and how to tell an empty…

heypinchy/pinchy · 67 tokens

embeddings

Vector embeddings with HNSW indexing, sql.js persistence, and hyperbolic support. 75x faster with agentic-flow integration. Use when: semantic search, pattern matching, similarity queries, knowledge retrieval. Skip when: exact text matching, simple lookups, no semantic understanding needed.

ruvnet/ruflo · 62 tokens

agent-platform-rag-engine-management

Manage and query Agent Platform RAG Engine Corpora and retrieve grounded contexts using the Google GenAI SDK. Use when listing RAG corpora or files, inspecting a corpus, retrieving contexts, or generating content grounded in a RAG corpus. Do not use for standard database queries (use SQL/Spanner skills), Google…

google/skills · 85 tokens

llm-app-patterns

Production-ready patterns for building LLM applications. Covers RAG pipelines, agent architectures, prompt IDEs, and LLMOps monitoring. Use when designing AI applications, implementing RAG, building agents, or setting up LLM observability.

davila7/claude-code-templates · 54 tokens

9router-embeddings

Generate vector embeddings via 9Router /v1/embeddings using OpenAI / Gemini / Mistral / Voyage / Nvidia / GitHub embedding models for RAG, semantic search, similarity. Use when the user wants embeddings, vectors, RAG, semantic search, or to embed text.

decolua/9router · 66 tokens