Skip to content

feat: add deterministic MMR diversity reranker - #14

Merged
AshwinUgale merged 1 commit into
AshwinUgale:mainfrom
77cjj:feat/mmr-reranker
Sep 6, 2026
Merged

AshwinUgale merged 1 commit into
AshwinUgale:mainfrom
77cjj:feat/mmr-reranker

Conversation

@77cjj

@77cjj 77cjj commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

What & why

Adds a dependency-free MMRReranker and wires mmr / mmr:<lambda> into retrieval sweeps. It uses lexical relevance plus token-set Jaccard redundancy so users can measure relevance/diversity trade-offs without model downloads or network access.

Closes #7.

Checklist

  • pytest -q passes (all tests; two existing optional-extra skips)
  • ruff check src tests passes
  • New unit tests cover near-duplicate diversification, stable deterministic ties, lambda validation, CLI parsing, sweep execution, and HTML reporting
  • retrieval-lab demo runs green offline/keyless
  • CHANGELOG.md updated
  • README reranking options updated
  • I read CONTRIBUTING.md

Notes

The implementation is deterministic and uses original shortlist order as the final tie-breaker, so no RNG state or seed is needed. ruff format --check src tests currently reports pre-existing formatting drift across 32 files on current main with Ruff 0.16.6; the files containing the new reranker and focused reranker tests were formatted, and ruff check is clean.

@AshwinUgale
AshwinUgale merged commit e7d37e7 into AshwinUgale:main Sep 6, 2026
4 checks passed
@AshwinUgale

Copy link
Copy Markdown
Owner

Thanks so much for this, @77cjj! 🙏Clean, well-scoped, and right in line with the project's
conventions — deterministic and keyless, dependency-free, with the full slice covered (CLI,
sweep, HTML, CHANGELOG, README) and thorough tests. Traced the MMR logic and it checks out.
Great addition — merging. 🎉

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.

Add an MMR (diversity) reranker

2 participants