Skip to content

Feat/34 llm reranker - #543

Draft
hangolehai wants to merge 10 commits into
ascherj:mainfrom
hangolehai:feat/34-llm-reranker
Draft

Feat/34 llm reranker#543
hangolehai wants to merge 10 commits into
ascherj:mainfrom
hangolehai:feat/34-llm-reranker

Conversation

@hangolehai

@hangolehai hangolehai commented Aug 2, 2026

Copy link
Copy Markdown

Summary

Adds an LLM re-ranking step to the hybrid retriever to score and sort document chunks using OpenAI.

Issue

Closes #34

Changes

  • Created LLMReranker in rag/retriever/llm_reranker.py
  • Updated HybridRetriever to optionally accept the reranker and use it to sort final_results.
  • Added unit tests for the reranker using mock OpenAI responses.

Testing

  • Unit tests pass (make test-unit)
  • Integration tests pass (make test-integration)
  • Linter passes (make lint)
  • Type checker passes (make typecheck)
  • New/updated tests cover the changes

Screenshots / Demo

Notes for Reviewers

Note: There are pre-existing test failures (53 in make test-unit) that I observed before making my changes. My code passed its own unit tests and did not introduce any new failures.

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.

Implement a re-ranking step that uses an LLM to score retrieved chunks before generation

1 participant