Agent skill

Embeddings Search

by ericrisco in ericrisco/rsc-harness

A skill your agent uses when choosing an embedding model, chunk size, or query form, when semantic search returns irrelevant results, when adding hybrid BM25+vector or a reranker, or when a…

MITAuto-check passedAI & LLM Engineering

Install Embeddings Search

skills CLI
$ npx skills add ericrisco/rsc-harness --skill embeddings-search -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ericrisco/rsc-harness embeddings-search --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ericrisco/rsc-harness.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/embeddings-search .claude/skills/embeddings-search && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
embeddings-search
GitHub stars
167
Token cost
~2.7k tokens
SKILL.md length
1,169 words
Files
6 (incl. scripts, references)
Skills in repo
227
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when choosing an embedding model, chunk size, or query form, when semantic search returns irrelevant results, when adding hybrid BM25+vector or a reranker, or when a…

  • Works in 5 steps: Pick the embedding model → Chunk the corpus → Construct the query → …
  • Choosing an embedding model
  • SKILL.md covers 1. Pick the embedding model, 2. Chunk the corpus, 3. Construct the query and 4. Hybrid + rerank, plus 2 more sections
  • Runs Shell scripts from its folder

What it does

Embeddings Search is an agent skill from ericrisco/rsc-harness. Use when choosing an embedding model, chunk size, or query form, when semantic search returns irrelevant results, when adding hybrid BM25+vector or a reranker, or when a retrieval change needs a number (recall@k, nDCG, MRR). NOT operating the store — index tuning, quantization (that is vector-db) — nor the retrieve-to-answer loop (that is rag).

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files, including scripts and reference files (for example `evals/README.md`, `evals/cases.yaml` and `references/evaluation.md`).

It sits in AI & LLM Engineering, covering Embeddings. The repository describes itself as: Your agent invents things because it has no memory, and can't touch your database because it has no arms. rsc is the meta-harness that gives it both, plus the trade to know the… The licence is MIT.

When your agent uses it

  • Choosing an embedding model
  • Semantic search returns irrelevant results
  • Adding hybrid BM25+vector
  • A retrieval change needs a number (recall@k

Example prompts

  • “/embeddings-search”

Requirements

  • Python 3
  • A Bash shell

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Pick the embedding model
  2. Chunk the corpus
  3. Construct the query
  4. Hybrid + rerank
  5. Measure retrieval quality

What it can do on your machine

Read from SKILL.md and the folder at commit e3d5b33. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Shell), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Embeddings Search loads about 2.7k tokens when it runs, and up to ~4.4k if it reads all its reference files. Until then it costs about 92 tokens; SKILL.md has 1,169 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~92
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from ericrisco/rsc-harness at commit e3d5b33, republished under its MIT licence (© ericrisco). 1,169 words, ~2,681 tokens.

Download SKILL.mdSave it as .claude/skills/embeddings-search/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
embeddings-search
description
Use when choosing an embedding model, chunk size, or query form, when semantic search returns irrelevant results, when adding hybrid BM25+vector or a reranker, or when a retrieval change needs a number (recall@k, nDCG, MRR). NOT operating the store — index tuning, quantization (that is `vector-db`) — nor the retrieve-to-answer loop (that is `rag`).
tags
embeddings, semantic-search, chunking, hybrid-search, reranking, rrf, retrieval-eval, mteb, matryoshka
recommends
vector-db, rag, structured-extraction, prompt-engineering, postgresdb
origin
risco

embeddings-search — make and judge the vectors

You own the embedding technique layer: turn a corpus into searchable vectors, turn a question into a good retrieval, and measure whether that retrieval is any good. You stop the moment the right chunks come back, measured by a number. You do not assemble a prompt or generate an answer.

Route the adjacent surfaces away:

  • Operating the store — collection schema, HNSW/IVFFlat tuning, metadata-filter path, quantization, ef_search recall knobs → ../vector-db/SKILL.md. You decide what vectors go in and how to query; vector-db decides how the store holds and serves them.
  • The full retrieve → rerank → prompt → generate → answer loop and its groundedness / faithfulness eval → ../rag/SKILL.md.
  • Pulling typed fields out of documents (invoice number, date, total) → ../structured-extraction/SKILL.md.
  • Writing the prompt the model reasons with → ../prompt-engineering/SKILL.md.

1. Pick the embedding model

Decide on three axes: language coverage, quality tier (read MTEB but don't worship it), and cost — where cost is set by dimensions, because dims set storage and memory.

ModelBest whenDims (Matryoshka)Max input~Price /1M tokQuery/doc asymmetry
OpenAI text-embedding-3-smallCheap English/multi baseline1536 (truncatable)8191 tok~$0.02none required
OpenAI text-embedding-3-largeHigher quality, still API-simple3072 (truncatable)8191 tok~$0.13none required
Cohere embed-v4Strong multilingual, APIup to 1536longAPI-pricedsearch_query vs search_document
Voyage voyage-3-largeRetrieval-specialised, top tasksmodel-setlongAPI-pricedyes (input_type)
Gemini EmbeddingTops MTEB English retrieval (~68.3)truncatablelongAPI-pricedyes (task type)
BGE-M3 / e5 (open)Self-host, no per-token bill1024 (BGE-M3)longself-hostyes (query: / passage:)

Quality anchor (mid-2026 MTEB English retrieval): Gemini ~68.3, Cohere embed-v4 ~65.2, OpenAI 3-large ~64.6, BGE-M3 ~63.0. MTEB is the standard comparison, not a verdict on your domain — references/models.md carries the full model matrix (dims, max tokens, price, input_type convention, Matryoshka support) and how to read MTEB without over-trusting it.

Two hard rules — each is a silent failure, no error, just worse results:

  • Match the distance metric to the model. A cosine-trained model indexed or queried with L2 ranks silently wrong. Cosine → <=> in pgvector / Distance.COSINE in Qdrant. The index operator itself is vector-db's job; the requirement originates from the model, so state it in your config.
  • Respect query/document asymmetry. Cohere, Voyage, Gemini, e5, BGE expect a different prompt or input_type for the query vs the stored passage. Embed both sides identically and recall silently drops.

Dimensions = cost. A 1024-dim float32 vector is 4 KB; at 10M docs that is 40 GB, and doubling dims doubles storage and memory. Matryoshka-trained models (OpenAI 3-*, Cohere, Gemini) let you truncate dims for graceful degradation — never re-embed the whole corpus just to shrink vectors.

2. Chunk the corpus

Start boring. Upgrade only when a number tells you to.

python
# Default recipe: recursive split, TOKEN-accurate count, 10–20% overlap.
import tiktoken
from langchain_text_splitters import RecursiveCharacterTextSplitter

enc = tiktoken.get_encoding("cl100k_base")
splitter = RecursiveCharacterTextSplitter.from_tiktoken_encoder(
    encoding_name="cl100k_base",
    chunk_size=512,      # tokens, not characters
    chunk_overlap=64,    # ~12% — keeps sentences from being cut mid-thought
)
chunks = splitter.split_text(document_text)

Counting by characters instead of tokens is the most common own-goal: 512 characters is ~100–130 tokens of English and far fewer of CJK, so "512" silently means different things per language and per model limit.

Upgrade ladder — graduate only when retrieval metrics (section 6) justify the added compute:

StrategyWhen it paysCost
Recursive (default)Always start herelowest
Semantic (group by meaning)Topic-mixed pages where fixed splits cut mid-idea; ~70% lift over naive in some benchmarksone extra embed pass
Late chunkingDocs heavy with pronouns/anaphora ("it", "the company"); +10–12% on thoseneeds a long-context model
Contextual retrieval (prepend a heading/summary per chunk)Chunks that aren't self-contained without their sectionhigher compute, more tokens stored

Embed the searchable text; store the rest as metadata. What you embed is what gets matched — don't bury the answer text under boilerplate, and don't embed raw HTML.

3. Construct the query

The query is half the retrieval. Embed it the way the model expects, then improve it only when recall data says you should.

python
# Asymmetric model: query and document use DIFFERENT input_type. Getting this wrong is silent.
q_vec   = embed(text=user_question, input_type="search_query")     # Cohere / Voyage
d_vec   = embed(text=passage,       input_type="search_document")
# e5 / BGE convention is a textual prefix instead:
#   query    -> "query: how do refunds work"
#   passage  -> "passage: Refunds are processed within 14 days…"

Query-side techniques, when each pays:

  • Query rewriting — when user queries are terse or full of pronouns; normalise before embedding.
  • HyDE (embed a hypothetical answer, not the question) — when questions are short and answers are long/technical, so the answer-shaped vector lands nearer the passage.
  • Multi-query (fan out 3–4 paraphrases, union the hits) — when one phrasing under-recalls; costs N embeds and a dedup.
Show full SKILL.md (497 more words)Show less

4. Hybrid + rerank

Dense and sparse fail in complementary ways: BM25 nails exact terms, IDs, SKUs, rare tokens; dense nails paraphrase. That is why exact-match queries return nothing while paraphrases work — the fix is adding sparse, not a bigger embedding model.

Fuse by rank, not score, with Reciprocal Rank Fusion so you never have to calibrate BM25 tf-idf magnitudes against cosine magnitudes per corpus:

python
# RRF: each doc scores 1/(k + rank) summed across the dense and sparse lists. k≈60.
def rrf(*ranked_lists, k=60):
    scores = {}
    for lst in ranked_lists:                 # fan-in 20–100 per list
        for rank, doc_id in enumerate(lst):  # rank is 0-based
            scores[doc_id] = scores.get(doc_id, 0) + 1.0 / (k + rank + 1)
    return sorted(scores, key=scores.get, reverse=True)

Then a cross-encoder reranker sits AFTER fusion: take top-50, score each against the original query, keep top-5 for downstream use.

  • Current models: Cohere rerank-v4.0-pro / rerank-v4.0-fast (note rerank-3.5 is deprecated). Voyage rerank-2.5 (2025-08-11) is the first widely available instruction-following reranker — 32K-token context (8× Cohere v3.5), reports +7.94% accuracy vs Cohere v3.5 on a 93-dataset suite.
  • A reranker raises precision but cannot recover a doc the retriever never returned. Recall is upstream. If the right chunk isn't in the top-50, no reranker saves you — fix recall first.

The fusion and index mechanics per engine (how Qdrant/Weaviate/pgvector run hybrid) are vector-db's: ../vector-db/SKILL.md.

5. Measure retrieval quality

This is the rigor of the skill. "Search is bad" is not actionable; "recall@10 is 0.62" is.

  1. Build a golden query set — 30–50+ labeled query → relevant doc ids pairs drawn from real questions. This is the asset; everything else is reproducible from it.
  2. Pick metrics — definitions, a runnable Python eval skeleton, golden-set construction and the A/B-one-change methodology are in references/evaluation.md:
    • recall@k — of the truly relevant docs, how many landed in the top-k. Catches "the right chunk never came back."
    • nDCG@k — rewards relevant docs ranked higher. Catches "right docs, wrong order."
    • MRR — how high the first relevant doc sits. Catches "the one answer is buried."
  3. Move-the-number loop. Establish a baseline, change exactly one thing (model OR chunk size OR fusion OR reranker), re-measure on the same query set. Two changes at once and you learn nothing.

A retrieval change shipped without a before/after number on a golden set is a guess. verify.sh flags hybrid/rerank artifacts that mention no recall/nDCG/MRR for exactly this reason.

Anti-patterns

Anti-patternWhy it bitesDo instead
Chunk size in characters"512" means a different token count per language/modelToken-accurate count (tiktoken/model tokenizer)
Same input_type for query and documentAsymmetric models silently lose recall, no errorsearch_query vs search_document (or query:/passage:)
Cosine model indexed/queried with L2Ranking is silently wrongMatch metric to model (cosine → <=>)
Add a reranker to fix bad recallReranker only reorders what retrieval returnedFix recall (hybrid, chunking, model) first
No overlap on proseSentences cut mid-thought lose the answer10–20% overlap
Tuning by eyeballing one queryOne query isn't a measurementGolden set + recall@k/nDCG before vs after
Trusting MTEB rank for your domainLeaderboard ≠ your corpus/languageEval the top 2–3 on your own golden set
Over-large dims "for safety"Doubles storage/RAM, little recall gainRight-size; truncate via Matryoshka
Re-embedding the corpus to change dimsWasteful when the model is Matryoshka-trainedTruncate dims, don't re-embed
Embedding raw HTML/boilerplateMatch signal drowns in markupEmbed clean text; keep the rest as metadata

© ericrisco, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (scripts, references) in skills/embeddings-search of ericrisco/rsc-harness.

  • SKILL.md
  • evals/README.md
  • evals/cases.yaml
  • references/evaluation.md
  • references/models.md
  • scripts/verify.sh

Open the folder on GitHubat commit e3d5b33

Compare with similar skills

Embeddings Search next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Embeddings Search compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Embeddings Search this skillericrisco/rsc-harness167—~2.7kAutomated safety check: PassMIT
Chroma Vector DatabaseOrchestra-Research/AI-Research-SKILLs13k8 repos~2.3kAutomated safety check: PassMIT
CLIP Image-Text MatchingOrchestra-Research/AI-Research-SKILLs13k8 repos~1.7kAutomated safety check: PassMIT
SageMaker Serving Image Selectionhuggingface/skills11k1 repos~4.6kAutomated safety check: PassApache-2.0
Codebase Managementgiancarloerra/SocratiCode3.3k1 repos~1.8kAutomated safety check: PassAGPL-3.0
Sentence-Transformers Training Routerhuggingface/skills11k1 repos~2.6kAutomated safety check: PassApache-2.0

Similar skills

  • Chroma Vector Database

    Orchestra-Research/AI-Research-SKILLs

    Shows how to store documents and embeddings in Chroma, query them by similarity with metadata filters, and persist them to disk for RAG and semantic search projects.

    13k GitHub starsUsed in 8 repos~2.3k tokens
    AI & LLM EngineeringAuto-check passed
  • CLIP Image-Text Matching

    Orchestra-Research/AI-Research-SKILLs

    Explains OpenAI's CLIP model for zero-shot image classification, image-text similarity, semantic image search and content moderation, with install steps and code patterns.

    13k GitHub starsUsed in 8 repos~1.7k tokens
    AI & LLM EngineeringAuto-check passed
  • Official

    Chooses the right serving container and current image URI for deploying a Hugging Face model to a SageMaker endpoint, preferring Hugging Face images over generic ones.

    11k GitHub starsUsed in 1 repo~4.6k tokens
    AI & LLM EngineeringAuto-check passed
  • Codebase Management

    giancarloerra/SocratiCode

    Set up, index, and manage SocratiCode codebase indexing. An agent skill from giancarloerra/SocratiCode.

    3.3k GitHub starsUsed in 1 repo~1.8k tokens
    AI & LLM EngineeringAuto-check passed
  • Official

    Routes a sentence-transformers training task to the right model type and required reference docs and example scripts, covering bi-encoders, rerankers, sparse and multi-vector models.

    11k GitHub starsUsed in 1 repo~2.6k tokens
    AI & LLM EngineeringAuto-check passed
  • Mashup Mods

    rehan-remade/universal-modder

    Build cross-game mashups and total conversions, the "Minecraft inside Elden Ring" or "skateboarding in MW2" kind.

    5.3k GitHub stars~3.3k tokensUpdated today
    AI & LLM EngineeringAuto-check passed

More from ericrisco/rsc-harness

All 227 skills in this repo
  • Ab Testing

    ericrisco/rsc-harness

    A skill your agent uses when designing or analyzing a controlled experiment — falsifiable hypothesis, sample size from an MDE, reading significance/CI/power, CUPED, or rescuing tests that won't go…

    167 GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Accessibility

    ericrisco/rsc-harness

    A skill your agent uses when making a web UI conform to WCAG 2.2 Level AA — axe-core or Lighthouse a11y violations, keyboard operability, focus management, ARIA roles/names/live regions, contrast…

    167 GitHub stars~3.4k tokensUpdated today
    Auto-check passed
  • Ads

    ericrisco/rsc-harness

    A skill your agent uses when running or fixing paid acquisition on Google or Meta — campaign structure (Performance Max, Demand Gen, Search, Advantage+), platform-fit creative, budget/scaling rules…

    167 GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Agent Eval

    ericrisco/rsc-harness

    A skill your agent uses when measuring whether an LLM or agent system actually got better and gating merges on it: golden sets, fixing an inflated LLM-as-judge, scoring RAG (faithfulness, contextual…

    167 GitHub stars~3.2k tokensUpdated today
    Auto-check passed
  • AI Media

    ericrisco/rsc-harness

    A skill your agent uses when a creative goal must become a finished media file: pick and order generative-media models per modality — AI voiceover, image-to-video clips, score — then glue them with…

    167 GitHub stars~3.3k tokensUpdated today
    Auto-check passed
  • Analytics

    ericrisco/rsc-harness

    A skill your agent uses when instrumenting product or web analytics — GA4/PostHog SDK wiring, event taxonomy, funnels, double-counted events, consent gating, PII scrubbing.

    167 GitHub stars~2.8k tokensUpdated today
    Auto-check passed

Questions about Embeddings Search

What does Embeddings Search do?

A skill your agent uses when choosing an embedding model, chunk size, or query form, when semantic search returns irrelevant results, when adding hybrid BM25+vector or a reranker, or when a…. Embeddings Search is an agent skill from ericrisco/rsc-harness. Use when choosing an embedding model, chunk size, or query form, when semantic search returns irrelevant results, when adding hybrid BM25+vector or a reranker, or when a retrieval change needs a number (recall@k, nDCG, MRR).

When should I use Embeddings Search?

Embeddings Search fits situations like: choosing an embedding model; semantic search returns irrelevant results; adding hybrid BM25+vector; A retrieval change needs a number (recall@k.

How do I install Embeddings Search in Claude Code?

Run `npx skills add ericrisco/rsc-harness --skill embeddings-search -a claude-code`. Or copy the skill folder (skills/embeddings-search in ericrisco/rsc-harness) into .claude/skills/embeddings-search in your project. Claude Code loads it when a task matches its description.

How do I install Embeddings Search in Codex?

Run `npx skills add ericrisco/rsc-harness --skill embeddings-search -a codex`. Or copy the skill folder (skills/embeddings-search in ericrisco/rsc-harness) into .agents/skills/embeddings-search in your project. Codex loads it when a task matches its description.

Can I use Embeddings Search in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ericrisco/rsc-harness --skill embeddings-search -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/embeddings-search, .gemini/skills/embeddings-search, .github/skills/embeddings-search and .opencode/skills/embeddings-search in your project.

What does Embeddings Search need to run?

Going by SKILL.md and its folder, Embeddings Search needs a shell for the scripts in its folder. Our summary lists: Python 3; A Bash shell.

Does Embeddings Search access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Embeddings Search safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Embeddings Search use?

Embeddings Search is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Embeddings Search use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.7k tokens, read only when the agent opens those files.

What are the alternatives to Embeddings Search?

Skills that share tags, products or a category with Embeddings Search: Chroma Vector Database (Orchestra-Research/AI-Research-SKILLs, 13k stars), CLIP Image-Text Matching (Orchestra-Research/AI-Research-SKILLs, 13k stars), SageMaker Serving Image Selection (huggingface/skills, 11k stars) and Codebase Management (giancarloerra/SocratiCode, 3.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Embeddings Search?

ericrisco (a GitHub user) maintains it in ericrisco/rsc-harness, which has 167 GitHub stars. The repository holds 227 skills in this directory. The repository was last updated on October 7, 2026.

Source: ericrisco/rsc-harness on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.