Skip to content

[CAI-879] Add the google reranker by LlamaIndex#2202

Open
mdciri wants to merge 6 commits intomainfrom
CAI-879-google-reranker
Open

[CAI-879] Add the google reranker by LlamaIndex#2202
mdciri wants to merge 6 commits intomainfrom
CAI-879-google-reranker

Conversation

@mdciri
Copy link
Copy Markdown
Collaborator

@mdciri mdciri commented Mar 27, 2026

List of Changes

Add the use of the Google Ranker by LlamaIndex with safe asynchronicity.

Motivation and Context

Use a maintained library.

How Has This Been Tested?

Locally in docker compose and in DEV

Screenshots (if appropriate):

Types of changes

  • Chore (nothing changes by a user perspective)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 27, 2026

🦋 Changeset detected

Latest commit: 6c373bd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
chatbot Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

Branch is not up to date with base branch

@mdciri it seems this Pull Request is not updated with base branch.
Please proceed with a merge or rebase to solve this.

Copy link
Copy Markdown
Contributor

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 migrates the chatbot’s Google reranking integration to the maintained LlamaIndex Google reranker package and adds a small wrapper to avoid asyncio event-loop binding issues during async request handling.

Changes:

  • Replace the custom Google reranker implementation with a wrapper around llama_index.postprocessor.google_rerank.GoogleRerank that lazily creates the async Discovery Engine client.
  • Update RAG tool setup to construct scoped service-account credentials and configure the reranker with model/project/location.
  • Switch the local __main__ server entrypoint to llama_index.core.async_utils.asyncio_run.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
apps/chatbot/src/modules/tools/rag_tool.py Wires in AsyncSafeGoogleRerank and builds Google service-account credentials for reranking.
apps/chatbot/src/modules/google_reranker.py Replaces the custom reranker with an async-safe wrapper around LlamaIndex’s Google reranker.
apps/chatbot/src/app/main.py Uses LlamaIndex’s asyncio_run helper to run the Hypercorn server coroutine.
apps/chatbot/pyproject.toml Adds the LlamaIndex Google rerank postprocessor dependency.
apps/chatbot/poetry.lock Locks the new dependency (and updates lock metadata).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2026

Jira Pull Request Link

This Pull Request refers to the following Jira issue CAI-879

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants