Skip to content

agentsope/SkillAlchemy / skills/agentsop-hybrid-retrieval

agentsop-hybrid-retrieval

Verified

Enhancement-overlay SOP for adding sparse (BM25 / keyword) retrieval alongside dense (embedding) retrieval. Activate when a calling agent is building, reviewing, or debugging a retrieval pipeline whose corpus contains exact-match tokens — identifiers, error codes, SKUs, API/function names, proper nouns, citations, rare jargon — that pure dense embedding silently misses. Encodes the single decision rule (**hybrid is traffic-driven, not theoretical: add sparse only when the query share that depends on exact tokens is non-trivial**), the wiring of QueryFusionRetriever-style fusion (RRF vs alpha-weighted), and per-query-type alpha tuning. Frame the work as recovering lexical identity that dense pooling destroys, not as "add keyword search for completeness". Cross-links [[llamaindex]].

FileKindSize
README.mdmarkdown2.1 KB
SKILL.mdskill md25.5 KB
intermediate/operation_candidates.jsonconfig6.9 KB
references/R1-source-evidence.mdmarkdown5.6 KB
# hybrid-retrieval — Enhancement Overlay (C3)

Standalone "when corpus has identifiers, add BM25" recipe, extracted from the
`llamaindex` SOP skill where hybrid search lives buried inside the optimization ladder
(Stage 3, step 4) and Dilemma 2.

## What this skill answers

> My retriever uses embeddings. Users paste an exact code / SKU / function name and get
> the wrong document — or nothing. Should I add BM25? How do I fuse it, and what `alpha`?

## One-sentence model

Dense captures meaning, sparse captures exact tokens; **hybrid wins when both matter** —
but only fuse when traffic actually carries exact-match queries, and **tune the blend
per query type or hybrid loses to dense**.

## When it fires

- Corpus has exact-match tokens: identifiers, error codes, SKUs, API/function names,
  proper nouns, citations, rare jargon.
- "I searched the exact string and got nothing" bug reports on a dense-only retriever.
- Tuning recall where both meaning and exact strings matter.

## When it does NOT fire

- Purely semantic traffic (<5% lexical-identity queries) — dense-only.
- No dense baseline + eval loop yet — baseline first (see `[[llamaindex]]`).
- The problem is chunking / embedding-model / reranking, not recall of exact tokens.

## The decision ladder (traffic-driven)

| Lexical share of traffic | Move |
|---|---|
| `< 5%` | Dense-only. Skip hybrid. |
| `5–50%` | Add hybrid (BM25 + dense), fuse, tune alpha **per query type**. |
| `> 50%` (code, logs, legal) | Invert: BM25-first, dense as rerank signal. |

## Files

- `SKILL.md` — 7-section operating model (activation / mental model / SOP / 8 ops /
  2 dilemmas / anti-patterns / cross-framework table).
- `references/R1-source-evidence.md` — extraction provenance from `[[llamaindex]]`.
- `intermediate/operation_candidates.json` — machine-readable operations + dilemmas.

## Cross-links

- `[[llamaindex]]` — parent RAG SOP (baseline, eval loop, optimization ladder, Dilemma 2).
- `[[langchain]]` — `EnsembleRetriever` equivalent.
- `[[agentsop-query-routing]]` — applies per-type alpha when no single global alpha works.

Overlay · v0.1.0 · Phase D enhance.
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall