Skip to content
This repository was archived by the owner on Oct 16, 2025. It is now read-only.

Conversation

pamelafox
Copy link
Owner

This algorithm matches what AI Search describes. I stepped through the results with the debugger and they seemed reasonable.

@pamelafox pamelafox requested a review from Copilot March 18, 2025 05:16
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the reciprocal rank fusion implementation to align with the AI Search algorithm. The changes include:

  • Replacing the previous weighted fusion (using alpha) with an RRF scoring approach using a k offset.
  • Updating the hybrid_search function to use the new fusion mechanism.
  • Modifying sample user query strings in both the Spanish and English versions.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
spanish/rag_documents_hybrid.py Updates the reciprocal_rank_fusion function and sample query string.
rag_documents_hybrid.py Updates the reciprocal_rank_fusion function and sample query string.
Comments suppressed due to low confidence (2)

spanish/rag_documents_hybrid.py:85

  • [nitpick] Consider using (i+1+k) instead of (i+k) to properly reflect 1-indexed ranks for RRF scoring, ensuring no off-by-one error.
scores[doc["id"]] += 1 / (i + k)

rag_documents_hybrid.py:85

  • [nitpick] Consider using (i+1+k) instead of (i+k) so that the ranking starts at 1 as expected by standard RRF implementations, which may avoid off-by-one issues.
scores[doc["id"]] += 1 / (i + k)

@pamelafox pamelafox merged commit c1408e1 into main Mar 18, 2025
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants