⚡AgentSkills
🤖 AI Engineering · RAG Pipelines

Implement hybrid keyword + vector search

Combine BM25-style lexical search with dense embeddings and fuse results so both rare terms and paraphrases are found.

intermediate~35 minAI EngineersML EngineersLLM App Developers

Steps

  1. 1Stand up a lexical index (BM25) alongside your vector index on the same chunks
  2. 2Embed queries with the same model and distance metric used at ingestion
  3. 3Retrieve top-k from both indexes with k at least double your final context size
  4. 4Fuse rankings with Reciprocal Rank Fusion (RRF), k=60 as default
  5. 5Optionally rerank fused candidates with a cross-encoder on top-50
  6. 6A/B against pure-vector on your golden questions; keep the winner per query class

Common Pitfalls

  • ▲Mixing similarity metrics between ingestion and query time
  • ▲Fusing raw scores instead of ranks across incompatible scales

Success Signals

  • ✓Hit-rate lift over best single retriever
  • ✓P95 retrieval latency under 300ms

Commands

Install with skills CLI
$ npx skills add aniruddhaadak80/skills --skill rag-pipelines-hybrid-search
Install globally
$ npx skills add aniruddhaadak80/skills --skill rag-pipelines-hybrid-search -g

Tags

#rag#search#bm25#ai-engineering#rag-pipelines

Related skills

Choose chunk sizes, overlaps, and structure-aware splits so retrieved context actually helps the model answer.

🤖 AI Engineering·~25m

Score groundedness, relevance, and completeness with judge prompts plus deterministic checks wired into CI.

🤖 AI Engineering·~45m