[PR #2929] [MERGED] Reranker option for RAG #4178

Closed
opened 2026-02-22 18:35:18 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/2929
Author: @timothycarambat
Created: 1/2/2025
Status: Merged
Merged: 1/2/2025
Merged by: @timothycarambat

Base: masterHead: reranker


📝 Commits (7)

📊 Changes

16 files changed (+339 additions, -9 deletions)

View changed files

frontend/src/pages/WorkspaceSettings/VectorDatabase/VectorSearchMode/index.jsx (+51 -0)
📝 frontend/src/pages/WorkspaceSettings/VectorDatabase/index.jsx (+2 -0)
📝 frontend/src/pages/WorkspaceSettings/index.jsx (+3 -0)
📝 server/endpoints/api/workspace/index.js (+1 -0)
📝 server/models/workspace.js (+10 -0)
server/prisma/migrations/20250102204948_init/migration.sql (+2 -0)
📝 server/prisma/schema.prisma (+1 -0)
📝 server/storage/models/.gitignore (+2 -1)
server/utils/EmbeddingRerankers/native/index.js (+153 -0)
📝 server/utils/agents/aibitat/plugins/memory.js (+1 -0)
📝 server/utils/chats/apiChatHandler.js (+2 -0)
📝 server/utils/chats/embed.js (+1 -0)
📝 server/utils/chats/openaiCompatible.js (+2 -0)
📝 server/utils/chats/stream.js (+1 -0)
📝 server/utils/helpers/index.js (+1 -0)
📝 server/utils/vectorDbProviders/lance/index.js (+106 -8)

📄 Description

Pull Request Type

  • feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

Relevant Issues

resolves #1124

What is in this change?

  • Supports native reranking as a workspace config option LanceDB support only at this time

Additional Information

  • We do not duplicate this model to our storage, so VPN/blocked users may fail to download the model and rerank will fail
  • LanceDB is supported only at this time. Open PR for more vector db support to prioritize it.
  • Embedding model is ms-marco-MiniLM-L-6-v2 for speed on all devices. We may make this a config for future models like mxbai-rerank-xsmall-v1

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/2929 **Author:** [@timothycarambat](https://github.com/timothycarambat) **Created:** 1/2/2025 **Status:** ✅ Merged **Merged:** 1/2/2025 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `reranker` --- ### 📝 Commits (7) - [`b0d1935`](https://github.com/Mintplex-Labs/anything-llm/commit/b0d1935c1e59fbd2338df4b8834ab9d2e61136f7) Reranker WIP - [`480c8b1`](https://github.com/Mintplex-Labs/anything-llm/commit/480c8b1c41b8f60ef01e6ca494b8cc80c837efbb) add cacheing and singleton loading - [`e1da41d`](https://github.com/Mintplex-Labs/anything-llm/commit/e1da41d29f3da5599b99c1cb19baa1f4b547a6cb) merge with master - [`dbe6667`](https://github.com/Mintplex-Labs/anything-llm/commit/dbe6667ef489aeafdcf03f6e7d3333b9580bd26f) Add field to workspaces for vectorSearchMode - [`7505e2e`](https://github.com/Mintplex-Labs/anything-llm/commit/7505e2e9ed32e9a6f8c662202b92f18c230913e6) update hint text - [`2907a68`](https://github.com/Mintplex-Labs/anything-llm/commit/2907a680f41941c4c190b6f40f4e405b13c04e5e) When reranking, swap score to rerank score - [`556b131`](https://github.com/Mintplex-Labs/anything-llm/commit/556b1310a17e729732de95b63dd01789301ca9ed) update optchain ### 📊 Changes **16 files changed** (+339 additions, -9 deletions) <details> <summary>View changed files</summary> ➕ `frontend/src/pages/WorkspaceSettings/VectorDatabase/VectorSearchMode/index.jsx` (+51 -0) 📝 `frontend/src/pages/WorkspaceSettings/VectorDatabase/index.jsx` (+2 -0) 📝 `frontend/src/pages/WorkspaceSettings/index.jsx` (+3 -0) 📝 `server/endpoints/api/workspace/index.js` (+1 -0) 📝 `server/models/workspace.js` (+10 -0) ➕ `server/prisma/migrations/20250102204948_init/migration.sql` (+2 -0) 📝 `server/prisma/schema.prisma` (+1 -0) 📝 `server/storage/models/.gitignore` (+2 -1) ➕ `server/utils/EmbeddingRerankers/native/index.js` (+153 -0) 📝 `server/utils/agents/aibitat/plugins/memory.js` (+1 -0) 📝 `server/utils/chats/apiChatHandler.js` (+2 -0) 📝 `server/utils/chats/embed.js` (+1 -0) 📝 `server/utils/chats/openaiCompatible.js` (+2 -0) 📝 `server/utils/chats/stream.js` (+1 -0) 📝 `server/utils/helpers/index.js` (+1 -0) 📝 `server/utils/vectorDbProviders/lance/index.js` (+106 -8) </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [x] ✨ feat - [ ] 🐛 fix - [ ] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #1124 ### What is in this change? - Supports native reranking as a workspace config option _LanceDB support only at this time_ <!-- Describe the changes in this PR that are impactful to the repo. --> ### Additional Information - We do not duplicate this model to our storage, so VPN/blocked users may fail to download the model and rerank will fail - LanceDB is supported only at this time. Open PR for more vector db support to prioritize it. - Embedding model is [ms-marco-MiniLM-L-6-v2](https://huggingface.co/Xenova/ms-marco-MiniLM-L-6-v2) for speed on all devices. We may make this a config for future models like [mxbai-rerank-xsmall-v1](https://huggingface.co/mixedbread-ai/mxbai-rerank-xsmall-v1) <!-- Add any other context about the Pull Request here that was not captured above. --> ### Developer Validations <!-- All of the applicable items should be checked. --> - [x] I ran `yarn lint` from the root of the repo & committed changes - [x] Relevant documentation has been updated - [x] I have tested my code functionality - [x] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:35:18 -05:00
yindo closed this issue 2026-02-22 18:35:18 -05:00
yindo changed title from [PR #2929] Reranker option for RAG to [PR #2929] [MERGED] Reranker option for RAG 2026-06-05 15:17:14 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4178