Skip to content

Add hybrid search (BM25+RRF) and cross-encoder reranking#1

Open
JMRussas wants to merge 2 commits intomainfrom
feature/hybrid-search-reranking
Open

Add hybrid search (BM25+RRF) and cross-encoder reranking#1
JMRussas wants to merge 2 commits intomainfrom
feature/hybrid-search-reranking

Conversation

@JMRussas
Copy link
Owner

Summary

  • Adds hybrid search combining vector similarity + BM25 (FTS5) via Reciprocal Rank Fusion, improving recall for queries that match both semantically and by keyword
  • Adds optional cross-encoder reranking using sentence-transformers ONNX backend (cross-encoder/ms-marco-MiniLM-L6-v2), lazy-loaded on first use
  • Both features are config-gated (search.hybrid and reranker.enabled, both default false) — zero impact on existing deployments
  • Also includes tools/sync-forks.sh for propagating changes to noz-rag/verse-rag, and source_subdir support in pipeline.py

Test plan

  • Verify existing vector-only search still works when hybrid=false (default)
  • Enable hybrid=true in verse-rag config, compare results for 5-10 queries
  • Enable reranker.enabled=true, verify model downloads and reranking improves relevance
  • Run tools/sync-forks.sh to verify fork propagation works
  • Run pip install -r requirements.txt to verify sentence-transformers installs on Windows

Generated by Claude Code · Claude Opus 4.6

JMRussas and others added 2 commits February 28, 2026 01:44
Extends the search tool with two config-gated improvements:

1. Hybrid search: Runs BM25 (FTS5) alongside vector search and fuses
   results via Reciprocal Rank Fusion. Enabled with search.hybrid=true.

2. Reranking: Optional cross-encoder pass (sentence-transformers ONNX)
   that reranks candidates after retrieval. Enabled with reranker.enabled=true.

Both default to false — existing deployments are unaffected. No schema
changes required. Also adds tools/sync-forks.sh for fork propagation and
source_subdir support in pipeline.py.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Surface the review-driven development process and test coverage
for hiring managers who won't click into commit history.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant