pg.ddx.io pgvector/pgvector GitHub issues and pull requests
help / color / mirror / Atom feed[pgvector/pgvector] issue #623: Multi-vector search
13+ messages / 4 participants
[nested] [flat]
* [pgvector/pgvector] issue #623: Multi-vector search
@ 2024-07-15 21:07 "branaway (@branaway)" <noreply+branaway@github.com>
0 siblings, 0 replies; 13+ messages in thread
From: branaway (@branaway) @ 2024-07-15 21:07 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Hi, I'm wondering if pgVector support complex multi-vector search similar to what MS does in https://github.com/microsoft/MSVBASE?
Our app is one of those that requires search across multiple vectors and scalers. We're researching new options in addition to Milvus hybrid search. Vbase from MS promises superior performance but it does not look mature enough.
^ permalink raw [nested|flat] 13+ messages in thread
* Re: [pgvector/pgvector] issue #623: Multi-vector search
@ 2024-07-15 21:50 ` "ankane (@ankane)" <noreply+ankane@github.com>
11 siblings, 0 replies; 13+ messages in thread
From: ankane (@ankane) @ 2024-07-15 21:50 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Hi @branaway, you can order by multiple vectors with:
```sql
... ORDER BY (embedding <-> '[1,2,3]') + (other_embedding <-> '[4,5,6]') ...
```
However, it won't be able to use an index.
^ permalink raw [nested|flat] 13+ messages in thread
* Re: [pgvector/pgvector] issue #623: Multi-vector search
@ 2024-07-15 21:50 ` "ankane (@ankane)" <noreply+ankane@github.com>
11 siblings, 0 replies; 13+ messages in thread
From: ankane (@ankane) @ 2024-07-15 21:50 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
@ankane closed this.
^ permalink raw [nested|flat] 13+ messages in thread
* Re: [pgvector/pgvector] issue #623: Multi-vector search
@ 2024-07-15 23:29 ` "branaway (@branaway)" <noreply+branaway@github.com>
11 siblings, 0 replies; 13+ messages in thread
From: branaway (@branaway) @ 2024-07-15 23:29 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
> Hi @branaway, you can order by multiple vectors with:
>
> ```sql
> ... ORDER BY (embedding <-> '[1,2,3]') + (other_embedding <-> '[4,5,6]') ...
> ```
>
> However, it won't be able to use an index.
Thank for the reply @ankane . What the consequence then for not using an index? Does it fall back to brute force?
^ permalink raw [nested|flat] 13+ messages in thread
* Re: [pgvector/pgvector] issue #623: Multi-vector search
@ 2024-07-15 23:42 ` "ankane (@ankane)" <noreply+ankane@github.com>
11 siblings, 0 replies; 13+ messages in thread
From: ankane (@ankane) @ 2024-07-15 23:42 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Yes, it'll perform exact nearest neighbor search.
^ permalink raw [nested|flat] 13+ messages in thread
* Re: [pgvector/pgvector] issue #623: Multi-vector search
@ 2024-07-16 03:18 ` "branaway (@branaway)" <noreply+branaway@github.com>
11 siblings, 0 replies; 13+ messages in thread
From: branaway (@branaway) @ 2024-07-16 03:18 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
> Yes, it'll perform exact nearest neighbor search.
and perform very badly?
^ permalink raw [nested|flat] 13+ messages in thread
* Re: [pgvector/pgvector] issue #623: Multi-vector search
@ 2024-07-16 03:20 ` "jkatz (@jkatz)" <noreply+jkatz@github.com>
11 siblings, 0 replies; 13+ messages in thread
From: jkatz (@jkatz) @ 2024-07-16 03:20 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
@branaway It's difficult to discuss this without understanding more about what you're trying to search for. What is the outcome of your search? Do you need to search over multiple embeddings in the same query? Are you applying different filters to the query? What would an example SQL statement look like?
It's hard to discuss performance without having a better understanding of what you're trying to accomplish.
^ permalink raw [nested|flat] 13+ messages in thread
* Re: [pgvector/pgvector] issue #623: Multi-vector search
@ 2024-07-16 03:40 ` "branaway (@branaway)" <noreply+branaway@github.com>
11 siblings, 0 replies; 13+ messages in thread
From: branaway (@branaway) @ 2024-07-16 03:40 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
> @branaway It's difficult to discuss this without understanding more about what you're trying to search for. What is the outcome of your search? Do you need to search over multiple embeddings in the same query? Are you applying different filters to the query? What would an example SQL statement look like?
>
> It's hard to discuss performance without having a better understanding of what you're trying to accomplish.
Yes, I'd like to search on multiple vectors in one query. e.g.:
find me the top 100 jobs that 1) match my skills 2) close to my salary expectation 3) company has good reputation, 4) close to where I live, etc... and the importance in that order (using a weighting notation)
It seems to me the MS VBase has developed an extension for pg to attack difficult queries like this. I'm wondering if this objective is in the near future scope of pgVector, or has there already a feature for that.
^ permalink raw [nested|flat] 13+ messages in thread
* Re: [pgvector/pgvector] issue #623: Multi-vector search
@ 2024-07-16 03:44 ` "branaway (@branaway)" <noreply+branaway@github.com>
11 siblings, 0 replies; 13+ messages in thread
From: branaway (@branaway) @ 2024-07-16 03:44 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
One might say we can use simple scaler filter for salary, locations etc, but I'd like to vectorize everything ( I would like to treat simple scaler as a sparse vector ) and use a uniformed weighted system for AI based apps. That's the idea.
^ permalink raw [nested|flat] 13+ messages in thread
* Re: [pgvector/pgvector] issue #623: Multi-vector search
@ 2024-07-16 03:48 ` "branaway (@branaway)" <noreply+branaway@github.com>
11 siblings, 0 replies; 13+ messages in thread
From: branaway (@branaway) @ 2024-07-16 03:48 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Another use case could as be to find a good date: the look, education, age, ethnicity, character. etc. all can be vectors.
^ permalink raw [nested|flat] 13+ messages in thread
* Re: [pgvector/pgvector] issue #623: Multi-vector search
@ 2024-09-26 16:04 ` "ernests (@ernests)" <noreply+ernests@github.com>
11 siblings, 0 replies; 13+ messages in thread
From: ernests (@ernests) @ 2024-09-26 16:04 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
@ankane I'm actually also interested in this question. Ability to do sort of matching across multiple vectors. In a way it is a weighted similarity search where one dimension has closer similarity than other. One items having multiple dimensions (e.g. 5) and weighted result based on individual dimension similarity.
^ permalink raw [nested|flat] 13+ messages in thread
* Re: [pgvector/pgvector] issue #623: Multi-vector search
@ 2024-09-26 17:37 ` "jkatz (@jkatz)" <noreply+jkatz@github.com>
11 siblings, 0 replies; 13+ messages in thread
From: jkatz (@jkatz) @ 2024-09-26 17:37 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
You can also use a multiple-search / reranking technique (which can leverage the index) - an example of this is with [hybrid search](https://jkatz05.com/post/postgres/hybrid-search-postgres-pgvector/), but you can apply a similar technique if the goal is to weight independent scores.
^ permalink raw [nested|flat] 13+ messages in thread
* Re: [pgvector/pgvector] issue #623: Multi-vector search
@ 2024-09-27 07:02 ` "branaway (@branaway)" <noreply+branaway@github.com>
11 siblings, 0 replies; 13+ messages in thread
From: branaway (@branaway) @ 2024-09-27 07:02 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
> You can also use a multiple-search / reranking technique (which can leverage the index) - an example of this is with [hybrid search](https://jkatz05.com/post/postgres/hybrid-search-postgres-pgvector/), but you can apply a similar technique if the goal is to weight independent scores.
Can the technique be used on merging searches over more than one vector fields?
^ permalink raw [nested|flat] 13+ messages in thread
end of thread, other threads:[~2024-09-27 07:02 UTC | newest]
Thread overview: 13+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-07-15 21:07 [pgvector/pgvector] issue #623: Multi-vector search "branaway (@branaway)" <noreply+branaway@github.com>
2024-07-15 21:50 ` "ankane (@ankane)" <noreply+ankane@github.com>
2024-07-15 21:50 ` "ankane (@ankane)" <noreply+ankane@github.com>
2024-07-15 23:29 ` "branaway (@branaway)" <noreply+branaway@github.com>
2024-07-15 23:42 ` "ankane (@ankane)" <noreply+ankane@github.com>
2024-07-16 03:18 ` "branaway (@branaway)" <noreply+branaway@github.com>
2024-07-16 03:20 ` "jkatz (@jkatz)" <noreply+jkatz@github.com>
2024-07-16 03:40 ` "branaway (@branaway)" <noreply+branaway@github.com>
2024-07-16 03:44 ` "branaway (@branaway)" <noreply+branaway@github.com>
2024-07-16 03:48 ` "branaway (@branaway)" <noreply+branaway@github.com>
2024-09-26 16:04 ` "ernests (@ernests)" <noreply+ernests@github.com>
2024-09-26 17:37 ` "jkatz (@jkatz)" <noreply+jkatz@github.com>
2024-09-27 07:02 ` "branaway (@branaway)" <noreply+branaway@github.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox