mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-11 00:04:08 -05:00
[PR #1693] [MERGED] feat: hybrid search with reranking #7549
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/1693
Author: @buroa
Created: 4/22/2024
Status: ✅ Merged
Merged: 4/25/2024
Merged by: @tjbck
Base:
dev← Head:buroa/hybrid-search📝 Commits (9)
4e0b32bfeat: hybrid searchdb801aeMerge branch 'dev' into buroa/hybrid-searchc0259aafeat: hybrid search and reranking supportadb009fMerge branch 'dev' into buroa/hybrid-searchd5f60b1Merge branch 'dev' into buroa/hybrid-searchc9c9660fix: address comment in pr #1687e92680achore: update changelog.md72090fachore: update log line1c1d2c2fix: query collection api call📊 Changes
8 files changed (+650 additions, -171 deletions)
View changed files
📝
CHANGELOG.md(+4 -0)📝
Dockerfile(+9 -3)📝
backend/apps/rag/main.py(+123 -91)📝
backend/apps/rag/utils.py(+295 -72)📝
backend/config.py(+24 -4)📝
backend/main.py(+2 -0)📝
src/lib/apis/rag/index.ts(+62 -0)📝
src/lib/components/documents/Settings/General.svelte(+131 -1)📄 Description
This adds three features:
BM25+ChromaDBtogether. I use the documents returned from the ChromaDB collection to build the BM25 retriever.sentence_transformerswe can rerank the results from the hybrid search to get better relevant documents.I updated the UI to allow setting the reranking model and the relevance filter via API calls.
Lastly,
query_embeddings_functionreturns a lambda function that is responsible for providing the correct embeddings for whatever embedding model / engine the user chose. I use this inside the custom ChromaDB retriever when searching and replaced it where relevant as well.Please let me know if I need to explain anything here. I hope it makes sense :)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.