open-webui/backend/open_webui/retrieval
Classic298 d8177c4177
fix: send the query embedding as a vector in external pgvector retrieval (#31112)
External knowledge bases on the pgvector provider failed on every search with "operator does not exist: vector <=> double precision[]", so they looked empty to users. This happened regardless of the VECTOR_DB setting.

The query embedding was bound as a plain Python list. register_vector only adapts pgvector's own Vector type and numpy arrays, so psycopg sent the list as a float array, which the <=> operator does not accept. Wrapping the embedding in pgvector.Vector sends it as a real vector.

Vector is imported from the package root, which works on the pinned pgvector 0.4.2 and on 0.5.x, where the pgvector.psycopg re-export no longer exists.

Verified against a pgvector Postgres: before the fix the reported error reproduces; after it, results come back ranked by cosine distance and filtered to the collection, including schema-qualified tables, halfvec columns and 1536-dimension embeddings.

Fixes #26663
2026-10-01 07:51:32 +04:00
..
loaders fix: uploaded files lose Chinese punctuation and quotes (#31655) 2026-10-01 07:22:08 +04:00
models fix: jina-colbert-v2 reranker fails to load and turns hybrid search off (#31532) 2026-09-30 19:34:20 +04:00
vector fix: editing a knowledge file on Elasticsearch keeps its old text searchable (#31530) 2026-10-01 07:36:44 +04:00
web fix: Playwright web loader returns only the site menu for pages with more than one <main> element (#31644) 2026-09-30 21:06:01 +04:00
external.py fix: send the query embedding as a vector in external pgvector retrieval (#31112) 2026-10-01 07:51:32 +04:00
utils.py fix: admins can still read and change other users' chats with ENABLE_ADMIN_CHAT_ACCESS off (#31416) 2026-09-28 01:51:59 +04:00