Skip to content

Add optional RAG cross-encoder reranking - #20

Merged
lmdixon23 merged 4 commits into
mainfrom
issue-10-rag-reranker-20260726-164218
Jul 26, 2026
Merged

Add optional RAG cross-encoder reranking#20
lmdixon23 merged 4 commits into
mainfrom
issue-10-rag-reranker-20260726-164218

Conversation

@lmdixon23

Copy link
Copy Markdown
Owner

Summary

  • add opt-in cross-encoder re-ranking over a configurable embedding candidate pool;
  • preserve embedding-only retrieval as the default behavior;
  • expose re-ranking through the CLI and Flask serving configuration;
  • preserve the original embedding score alongside the final cross-encoder score;
  • add deterministic, network-free re-ranker and pipeline tests;
  • add a reproducible baseline-versus-re-ranked evaluation command;
  • update sentence-transformers dimension detection for current and older supported releases.

Validation

  • 19 passed in the RAG assistant test suite;
  • 2 passed in the RAG-to-eval-harness bridge suite;
  • real-model evaluation completed on CPU using:
    • sentence-transformers 5.6.1;
    • transformers 5.14.1;
    • torch 2.13.0.

Measured smoke result

Configuration recall@3 MRR
Embedding only 1.000 0.900
Cross-encoder re-ranked 1.000 1.000
Observed delta +0.000 +0.100

The re-ranker moved the approximate-nearest-neighbor case from rank 2 to rank 1.

This is a five-case smoke result over three small documents. It records the observed delta and does not establish a general quality lift. Issue #18 tracks the expanded discriminative benchmark.

Closes #10

@lmdixon23
lmdixon23 merged commit 8675a3a into main Jul 26, 2026
21 checks passed
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.

RAG Assistant: add a cross-encoder re-ranker and measure the MRR lift

1 participant