DeployQL / LintDB

Vector Database with support for late interaction and token level embeddings.
https://www.lintdb.com/
Apache License 2.0
54 stars 2 forks source link

Create a Query Engine #9

Closed mtbarta closed 3 months ago

mtbarta commented 7 months ago

In order to enable filtering of documents, we should be able to formulate query trees.

What is a Query Tree

A query tree should be an executable graph on top of our database. If we want to search for the query "insurance draft" only in documents that were created by me, we might create the following query:

                                AND                     
                        ┌─────────────────┐             
                        │                 │             
                        │                 │             
                        │                 │             
embeddings("insurance draft")        author="Matt Barta"

In order to do this, we can look up the inverted list for the embeddings of the query and look up the embeddings of author="Matt Barta". Each query operation can be processed in parallel, and since each inverted list is sorted by key, we can guarantee we will scan over document IDs in order.

Per document ,we can determine if it passes the acceptance criteria of matching all terms.

To Consider

I haven't thought out whether this is inefficient from a latency perspective. We aren't far off from a traditional inverted index, so this seems ok.

Secondly, do we have any information available from the embeddings that would lend itself to a "neural WAND" algorithm?

see #7