/data-and-ai-tools:retrieval-stingerfrom data-and-ai-tools
Designs and audits retrieval systems: full-text search, pgvector recall, hybrid RRF fusion, reranking, chunking, and recall quality evaluation. Use when tuning recall or a search query misses.
Ships in data-and-ai-tools. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are equipping retrieval-wasp-drone - the Wasp Nest's authority on how an app finds things, and (as one documented capability among several) how a Hivemind-style pipeline learns from its own sessions.
This skill covers the domain generally: how a query finds the right rows, chunks, or documents, ranked well, measured honestly - across whichever store and fusion method a project actually runs.
Neon Postgres plus pgvector plus Reciprocal Rank Fusion is the primary, default implementation for this repo's stack. Full-text search (tsvector), pgvector semantic recall, RRF hybrid fusion, optional cross-encoder reranking, chunking strategy, and recall evaluation are covered as first-class Postgres guides. The Deep Lake-backed hybrid recall pipeline built for the Wasp Nestmind product (hybrid lexical+semantic recall over the memory/sessions tables, the <#> cosine path vs the BM25/ILIKE silent fallback, deeplake_hybrid_record weighting, the grep-direct.ts fast path, the tree-sitter codebase graph) stays fully documented as a supported alternative implementation for any project already running it. A skillify/codify capability (the Haiku KEEP/MERGE/SKIP gate that mines agent sessions into SKILL.md provenance rows, plus propagation and scope/privacy) is documented as one specific thing this Stinger can help with - not the definition of retrieval.
Opinionation is the product. On this repo's default: "fuse the lexical and vector arms with RRF at k=50, weight the lexical arm up because this is an exact-identifier-heavy query" - not "you have several search options." On a Deep Lake project: "this query should run hybrid with 0.7/0.3 conceptual weighting because it is a paraphrase-heavy recall, and it is silently falling back to BM25 because embeddings are off" - the original opinions, unchanged. Every claim cites a guide section, a research note in references/research/ (raw or distilled), or Hivemind source under src/shell/, src/hooks/, src/skillify/, src/graph/, src/embeddings/columns.ts when the finding is Deep Lake-specific.
Use when retrieval-wasp-drone is invoked, or the user says: "tune recall", "why did this query miss", "hybrid search this", "add reranking", "chunk this for retrieval", "score retrieval quality", "semantic vs lexical here", "audit the skillify gate", "a bad skill got mined", or "fix propagation".
Designs and audits retrieval for an app: Postgres full-text search, pgvector semantic recall, Reciprocal Rank Fusion hybrid search, optional cross-encoder reranking, chunking strategy, and recall/precision evaluation with golden query sets. Neon Postgres plus pgvector plus RRF is primary for this stack. A Deep Lake hybrid recall pipeline and a Haiku KEEP/MERGE/SKIP skillify (session-to-SKILL.md) codify/propagation loop remain documented alternatives for a project already running them.
Do NOT use for the embedding model/daemon (embeddings-runtime-wasp-drone), the vector column/index/schema (vector-store-wasp-drone), security audits (security-wasp-drone), or PRD authoring (library-wasp-drone).
tsvector/pgvector columns, Drizzle schema) or Deep Lake (look for deeplake-schema.ts, grep-core.ts). If it's a greenfield decision, start with the Postgres guides unless the user says otherwise.guides/00-principles.md before writing any finding. The stack-neutral non-negotiables, the severity rubric, and the cross-Drone handoffs all live there.<#> semantic recall is live or recall is silently falling back to BM25/ILIKE changes nearly every answer (HIVEMIND_EMBEDDINGS / HIVEMIND_SEMANTIC_SEARCH, whether summary_embedding / message_embedding are populated).| Invocation mode | Implementation | Primary guide(s) | Output |
|---|---|---|---|
full-text-search (tsvector, ranking, websearch_to_tsquery) | Postgres | postgres-01-full-text-search.md | Query/index correctness finding + ranking recommendation |
pgvector-recall (semantic arm, operator/index match) | Postgres | postgres-02-pgvector-recall.md | Recall recommendation, with schema/index questions hand off to vector-store-wasp-drone |
hybrid-fusion (combine lexical + vector) | Postgres | postgres-03-rrf-fusion.md | RRF query with weighting recommendation |
reranking (add or evaluate a cross-encoder stage) | Postgres | postgres-04-reranking.md | Recommendation on whether/how to rerank, ablated against recall |
chunking-strategy (how to split documents for retrieval) | Postgres | postgres-05-chunking-strategy.md | Chunking recommendation with citation, not a guess |
recall-eval (score precision/recall, golden query set) | Postgres | postgres-06-recall-quality-eval.md | Metric table (recall@k, precision@k, MRR, nDCG) with before/after |
recall-audit (a Deep Lake query missed, returned noise, or is slow) | Deep Lake | deeplake-01-recall-pipeline.md + deeplake-02-hybrid-search.md + deeplake-08-recall-quality-eval.md | Finding with the UNION ALL behavior + weighting recommendation + file:line |
semantic-vs-lexical (Deep Lake: <#> or BM25) | Deep Lake | deeplake-05-semantic-vs-lexical.md + deeplake-02-hybrid-search.md + deeplake-04-embeddings-integration.md | A decision with the tradeoff and the toggle state |
fallback-investigation (Deep Lake recall fell back to BM25 unexpectedly) | Deep Lake | deeplake-03-bm25-fallback.md + deeplake-04-embeddings-integration.md | Root cause (daemon down, toggle off, NULL embeddings) + fix |
fast-path-change (grep-direct.ts pre-tool-use) | Deep Lake | deeplake-06-fast-path-grep-direct.md + deeplake-01-recall-pipeline.md | Diff to the fast path + correctness check against the slow path |
embeddings-integration (how Deep Lake recall consumes vectors) | Deep Lake | deeplake-04-embeddings-integration.md | Columns/dims/toggle wiring; daemon mechanics handed to embeddings-runtime |
graph-chunking (Deep Lake codebase graph, tree-sitter) | Deep Lake | deeplake-07-treesitter-chunking.md | codebase table extraction finding |
skillify-audit (the codify gate, a bad skill got mined) | Skillify | skillify-01-codify.md + postgres-06-recall-quality-eval.md or deeplake-08-recall-quality-eval.md | Gate verdict analysis (KEEP/MERGE/SKIP), skill-writer + provenance check |
propagation-fix (skills not fanning out, wrong scope) | Skillify | skillify-02-propagation.md + skillify-03-scope-and-privacy.md | pull/auto-pull diagnosis + scope (me/team) correctness |
scope-privacy-review (who sees what) | Skillify | skillify-03-scope-and-privacy.md | Scope boundary finding (hand PII to security-wasp-drone) |
failure-triage (any Deep Lake/skillify mode, symptom-first) | Deep Lake/Skillify | deeplake-09-common-failure-modes.md | Symptom -> cause -> guide routing |
guides/00-principles.md §1.guides/00-principles.md §3.guides/00-principles.md §4.guides/00-principles.md §5.guides/00-principles.md §6, guides/postgres-04-reranking.md.guides/00-principles.md §7, guides/postgres-05-chunking-strategy.md.guides/00-principles.md §8.guides/00-principles.md §9.memory + sessions. The slow path runs both arms of a UNION ALL. A change that searches only one table is a recall regression. See guides/deeplake-01-recall-pipeline.md.guides/deeplake-03-bm25-fallback.md.EMBEDDING_DIMS=768. See guides/deeplake-04-embeddings-integration.md.grep-direct.ts is an optimization, not a different algorithm. See guides/deeplake-06-fast-path-grep-direct.md.guides/skillify-01-codify.md.me/team) is a privacy boundary propagation must respect. See guides/skillify-01-codify.md, guides/skillify-03-scope-and-privacy.md.Stack-neutral; see guides/00-principles.md for the full rubric. Summary:
FULL OUTER JOIN silently narrowed to an INNER JOIN; a <#>/pgvector query against a NULL column expecting clean results; a dropped Deep Lake UNION ALL arm; fast-path/slow-path divergence; a mined skill with no provenance row; a me-scoped skill propagated to teammates. Blocks merge.The severity of a finding is its credibility. Calling a style nit "must-fix" destroys trust.
vector-store-wasp-drone. This Stinger owns the recall query and fusion; vector-store-wasp-drone owns the column and index it queries against.embeddings-runtime-wasp-drone. This Stinger owns how recall consumes vectors and the missing-embedding fallback contract; the model/pipeline that produces them is theirs.security-wasp-drone. This Stinger flags with file:line or query; the audit is theirs.library-wasp-drone authors; this Stinger provides the architectural rationale.quality-wasp-drone. The precision/recall snapshots, ablation results, and gate-verdict distributions feed in.Close-out order on any multi-Drone job: security-wasp-drone then quality-wasp-drone.
Numbered/prefixed so the layering is obvious: stack-neutral principles first, then one prefix per implementation.
guides/00-principles.md - stack-neutral non-negotiables, severity rubric, cross-Drone boundaries.guides/postgres-01-full-text-search.md - tsvector/tsquery, websearch_to_tsquery, ts_rank/ts_rank_cd, GIN indexing.guides/postgres-02-pgvector-recall.md - the semantic recall arm, operator/index-class correctness, the boundary with vector-store-stinger.guides/postgres-03-rrf-fusion.md - Reciprocal Rank Fusion, the reference Postgres implementation, the two-lever tuning model.guides/postgres-04-reranking.md - optional cross-encoder reranking (e.g. Cohere rerank), when it earns its cost, ablation-last discipline.guides/postgres-05-chunking-strategy.md - fixed-size vs semantic chunking with a citation-backed recommendation, overlap, the context cliff.guides/postgres-06-recall-quality-eval.md - recall@k/precision@k/MRR/nDCG, golden query sets, component ablation, before/after discipline.guides/deeplake-01-recall-pipeline.md through guides/deeplake-09-common-failure-modes.md - the original Deep Lake/Hivemind recall material (UNION ALL pipeline, hybrid search, BM25 fallback, embeddings integration, semantic-vs-lexical, fast path, treesitter chunking, recall-quality eval, common failure modes), unchanged.guides/skillify-01-codify.md through guides/skillify-03-scope-and-privacy.md - the Haiku KEEP/MERGE/SKIP codify gate, propagation, and scope/privacy, unchanged.references/) - retrieval ground-truth notes, flat files for the Deep Lake implementation (<#> cosine search, hybrid weighting, the nomic-embed model, BM25/lexical recall, recall-quality evaluation, codebase-graph extraction, skillify-gate rationale - see references/README.md), plus references/research/ for the Postgres-native broadening: references/research/raw/ (source-repository research, not shipped with the plugin) (archived primary sources with citation headers) and references/research/distilled-retrieval.md (the synthesis with inline citations).library/ tree - standalone audits: library/requirements/reports/retrieval/<date>-<topic>.md (slugs: recall-audit-<query-set>, hybrid-fusion-tuning, chunking-strategy-review, fallback-investigation, skillify-gate-audit, propagation-scope-leak, recall-eval-quarterly). Feature-tied: library/requirements/<lifecycle>/prd-<###>-<title>/reports/<date>-<type>-report.md. Use reports/audit-template.md as the skeleton.guides/postgres-03-rrf-fusion.md).references/research/ (raw or distilled), or file:line in Hivemind source plus the governing Deep Lake/skillify guide.Part of The Wasp Nest, curated by Mario Aldayuz a.k.a @thenotoriousllama.
examples/01-hybrid-recall-query.md (opens in a new tab)examples/02-tune-hybrid-weights.md (opens in a new tab)examples/03-trace-recall-miss-bm25-fallback.md (opens in a new tab)examples/04-skillify-gate-walkthrough.md (opens in a new tab)examples/05-inspect-codebase-graph-chunk.md (opens in a new tab)guides/00-principles.md (opens in a new tab)guides/deeplake-01-recall-pipeline.md (opens in a new tab)guides/deeplake-02-hybrid-search.md (opens in a new tab)guides/deeplake-03-bm25-fallback.md (opens in a new tab)guides/deeplake-04-embeddings-integration.md (opens in a new tab)guides/deeplake-05-semantic-vs-lexical.md (opens in a new tab)guides/deeplake-06-fast-path-grep-direct.md (opens in a new tab)guides/deeplake-07-treesitter-chunking.md (opens in a new tab)guides/deeplake-08-recall-quality-eval.md (opens in a new tab)guides/deeplake-09-common-failure-modes.md (opens in a new tab)guides/postgres-01-full-text-search.md (opens in a new tab)guides/postgres-02-pgvector-recall.md (opens in a new tab)guides/postgres-03-rrf-fusion.md (opens in a new tab)guides/postgres-04-reranking.md (opens in a new tab)guides/postgres-05-chunking-strategy.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
retrieval, search-tuning, pgvector, hybrid-search, recall-evaluation
15 skills in this plugin
/ai-coding-tools-stingerChoose, configure or troubleshoot AI coding tools, and write bounded task briefs. Use for tool comparison, prompt context, task scope, acceptance, ownership and verification./ai-tools-platform-stingerChoose AI providers, gateways and local models. Use for AI stack setup, retry and spend budgets, feature margin or local hardware fit. Read guides/ for the decision path./bifrost-stingerBifrost AI gateway specialist: maximhq/bifrost architecture, admin and inference API surface, virtual keys, semantic cache, .so plugins, tags, fork freeze and upgrade policy. Use for any Bifrost work.npx claudepluginhub legioncodeinc/vibe-coding-tools --plugin data-and-ai-toolsOther plugins' skills for the same job