mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 11:28:35 -05:00
[PR #12050] [MERGED] Fix: Normalize all database distances to score in [0, 1] (needs testing for different DBs) #38472
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/12050
Author: @mahenning
Created: 3/25/2025
Status: ✅ Merged
Merged: 3/27/2025
Merged by: @tjbck
Base:
dev← Head:fix-db-order📝 Commits (3)
94d9d3dFix: Normalze all database distances to score in [0, 1]7531b7dSatisfy github format check7490bc9Merge branch 'dev' into fix-db-order📊 Changes
6 files changed (+22 additions, -29 deletions)
View changed files
📝
backend/open_webui/retrieval/utils.py(+5 -24)📝
backend/open_webui/retrieval/vector/dbs/chroma.py(+7 -1)📝
backend/open_webui/retrieval/vector/dbs/milvus.py(+4 -1)📝
backend/open_webui/retrieval/vector/dbs/opensearch.py(+1 -1)📝
backend/open_webui/retrieval/vector/dbs/pgvector.py(+3 -1)📝
backend/open_webui/retrieval/vector/dbs/qdrant.py(+2 -1)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
Fixed
Additional Information
Sources:
Chromadb: https://docs.trychroma.com/docs/collections/configure
Elasticsearch: https://www.elastic.co/search-labs/blog/vector-similarity-techniques-and-scoring
Milvus: https://milvus.io/docs/metric.md
Opensearch: Implementation in open-webui used [0, 2] with shift +1, see code snippet below
4906af9319/backend/open_webui/retrieval/vector/dbs/opensearch.py (L123)Pgvector: https://github.com/pgvector/pgvector?tab=readme-ov-file#querying
https://github.com/supabase/supabase/issues/12244
qdrant: https://qdrant.tech/documentation/concepts/collections/#collections
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.