From: lucasgadams (@lucasgadams) <noreply+lucasgadams@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #259: Understanding HNSW + filtering
Date: Fri, 26 Jul 2024 13:35:04 +0000
Message-ID: <gh-pgvector-pgvector-259-c2252780576@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-259@github.com>
References: <gh-pgvector-pgvector-259@github.com>
Definitely interested in this. Our use case is similar to others mentioned above. We have a combination of public and private (to a user) documents in our database. When we do embedding search, it is always with a combination of joins (foreign key from document to embedding) and potentially some additional filtering (embedding type). The join is usually coming from a complex query of a few tables, users to document metadata, filtering document metadata to specific collections, possibly some string matches on metadata, ect. So far we have been using brute force search because we can often get the search space down to 50-100k, and we have a big postgres instance. No problems there for private user docs. But this will increase in the future, where instead of user docs we have company docs that can be much larger. We will still be using joins to pre-filter (to company owned docs), but the search space will be 100x larger, so we will be adding indexes eventually. Pre-filtering is a must for this sort of thing, as individual companies might have very similar documents which means post-filtered searches are not going to be very accurate. Hoping we can do this sort of thing in pgvector! Otherwise we will need to use one of the managed products that support pre-filtering.