Skip to content

enh: enable reranking through Cross Encoding#73

Open
VarinThakur01 wants to merge 29 commits intomainfrom
rerank
Open

enh: enable reranking through Cross Encoding#73
VarinThakur01 wants to merge 29 commits intomainfrom
rerank

Conversation

@VarinThakur01
Copy link
Copy Markdown
Collaborator

This PR adds the feature of reranking results using Cross Encoding.
The following things have been added

  • Allow passing a rerank_config inside the existing similarity search methods to support reranking.
  • Introduce HanaReranker as a standalone reranker to rerank documents.
  • Addition of test cases for above 2 additions
  • Adding Reranking Documentation in the noteboook

PR Extensions (For future)

  • Replace model validations from Dummy queries to System Views (Will be done together for VECTOR_EMBEDDING() and CROSS_ENCODE())
  • Currently, similarity_search_with_relevance_scores() function doesn't support reranking as it uses the implementation from the parent class. (As the relevance functions are not properly set, we will add the support of reranking in a future PR after fixing the relevance_score functions)

@VarinThakur01 VarinThakur01 requested a review from yonarw March 25, 2026 15:50
Comment thread langchain_hana/vectorstores/hana_reranker.py Outdated
Comment thread langchain_hana/vectorstores/hana_reranker.py Outdated
Comment thread langchain_hana/vectorstores/hana_reranker.py Outdated
Comment thread langchain_hana/vectorstores/hana_reranker.py
Comment thread tests/integration_tests/test_hana_reranker.py Outdated
Comment thread langchain_hana/vectorstores/hana_reranker.py Outdated
Comment thread langchain_hana/vectorstores/hana_db.py Outdated
Comment thread langchain_hana/vectorstores/hana_db.py Outdated
Comment thread langchain_hana/vectorstores/hana_db.py Outdated
@VarinThakur01 VarinThakur01 requested a review from yonarw March 27, 2026 15:02
Copy link
Copy Markdown
Contributor

@yonarw yonarw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three smaller remarks left, otherwise good for merge.

Comment thread langchain_hana/vectorstores/hana_reranker.py Outdated
Comment thread langchain_hana/vectorstores/hana_reranker.py Outdated
Comment thread langchain_hana/utils.py Outdated
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.

2 participants