Skip to content

feat: Adding code to call the rag_api simple reranker.#10574

Open
kalaspuffar wants to merge 1 commit intodanny-avila:mainfrom
kalaspuffar:new/feature/simple_reranker
Open

feat: Adding code to call the rag_api simple reranker.#10574
kalaspuffar wants to merge 1 commit intodanny-avila:mainfrom
kalaspuffar:new/feature/simple_reranker

Conversation

@kalaspuffar
Copy link
Copy Markdown

@kalaspuffar kalaspuffar commented Nov 19, 2025

Summary

This pull request was originally introduced in
#9102

We are trying to use a local model to rerank search results using a Python library and implemented as a rest api in the rag_api repository:
danny-avila/rag_api#190

Then we implement a caller in the agents repository:
danny-avila/agents#33

Lastly, we have the code in this PR that will tie it all together.

We need a param in the webSearch configuration block in librechat.yaml

webSearch:
  rerankerType: "simple"

Change Type

Please delete any irrelevant options.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Testing

After this PR is added and the rag_api is started with our new function, and the configuration is done in rag and in this library, a web search should be able to be done without having an external ranker configured.

Test Configuration:

Checklist

Please delete any irrelevant options.

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented on any complex areas of my code

Extra remarks

I've run all test suites and linting and get 6k linting errors on my branch and a newly cloned repository.
I have not, to my knowledge, introduced any new errors in the tests, but I get the same errors on my branch and a newly cloned repository.

@kalaspuffar
Copy link
Copy Markdown
Author

Tried with Node 20, but it did not matter; still 6k linting errors on a newly cloned repository.

npm run lint
.....

✖ 6234 problems (6083 errors, 151 warnings)
  5855 errors and 8 warnings potentially fixable with the `--fix` option.
node --version
v20.19.5

@kalaspuffar kalaspuffar changed the title Adding code to call the rag_api simple reranker. feat: Adding code to call the rag_api simple reranker. Nov 19, 2025
@kalaspuffar kalaspuffar force-pushed the new/feature/simple_reranker branch 2 times, most recently from aa96c54 to a2e3da6 Compare November 23, 2025 20:56
@danny-avila danny-avila requested a review from Copilot November 28, 2025 16:17
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 adds support for a local "simple" reranker option for web search functionality, enabling users to run reranking with open-source models through the rag_api service instead of relying solely on external services like Jina or Cohere.

  • Adds a new simple reranker type to the existing reranker options (Jina, Cohere)
  • Introduces simpleRerankerInstanceUrl configuration parameter throughout the stack
  • Updates UI components to allow users to configure the simple reranker instance URL

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/data-schemas/src/types/web.ts Adds simpleRerankerInstanceUrl to web search configuration keys
packages/data-schemas/src/app/web.ts Adds simple reranker auth configuration and loads the instance URL from config
packages/data-provider/src/types/web.ts Adds simple to the RerankerType union and includes simpleRerankerInstanceUrl in SearchToolConfig
packages/data-provider/src/config.ts Adds SIMPLE enum value and schema validation for the simple reranker configuration
librechat.example.yaml Updates configuration example with simple reranker URL option and version bump
.env.example Adds SIMPLE_RERANKER_URL environment variable example
client/src/locales/en/translation.json Adds translation keys for simple reranker UI labels
client/src/hooks/Plugins/useAuthSearchTool.ts Includes simpleRerankerInstanceUrl in the search API key form data type and submission
client/src/components/SidePanel/Agents/Search/ApiKeyDialog.tsx Adds UI configuration option for simple reranker with input field
README.md Documents the new local reranking capability with open-source models

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

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Comment thread client/src/components/SidePanel/Agents/Search/ApiKeyDialog.tsx Outdated
Comment thread .env.example Outdated
Comment thread client/src/locales/en/translation.json Outdated
Comment thread README.md Outdated
@kalaspuffar kalaspuffar force-pushed the new/feature/simple_reranker branch 2 times, most recently from 4252a49 to f7b4e81 Compare December 2, 2025 21:54
@kalaspuffar
Copy link
Copy Markdown
Author

I'm pretty happy with the last change not to have an instance URL, sadly the GUI will not allow it at this point. The selection will not stick and I can't turn on the WebSearch feature now that I don't have any value to supply to that interface. Looking for a solution but that should be a minor fix.

@kalaspuffar kalaspuffar force-pushed the new/feature/simple_reranker branch from f7b4e81 to dcbf7c0 Compare December 3, 2025 16:28
@kalaspuffar
Copy link
Copy Markdown
Author

Problem solved, for some reason we did not allow any service to exist without any required keys.

@kalaspuffar kalaspuffar force-pushed the new/feature/simple_reranker branch 2 times, most recently from 3d9ca05 to 64266e1 Compare December 5, 2025 04:47
@kalaspuffar kalaspuffar force-pushed the new/feature/simple_reranker branch 4 times, most recently from aeb24bd to 2b8578c Compare December 15, 2025 19:49
@kalaspuffar
Copy link
Copy Markdown
Author

Made a small change to verify that the specific service (simple) was selected if we wanted to allow no required fields. This should satify the tests.

@kalaspuffar kalaspuffar force-pushed the new/feature/simple_reranker branch from 81f9111 to 11e0cf3 Compare January 21, 2026 17:44
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