[HN Gopher] Vector Search with SQL
       ___________________________________________________________________
        
       Vector Search with SQL
        
       Author : neumll
       Score  : 15 points
       Date   : 2022-01-12 18:38 UTC (4 hours ago)
        
 (HTM) web link (neuml.github.io)
 (TXT) w3m dump (neuml.github.io)
        
       | neumll wrote:
       | Link to GitHub project: https://github.com/neuml/txtai
        
         | leobg wrote:
         | Looks great. How does it compare to hnswlib? How many vectors
         | can it handle for subsecond queries? Is it approximate or
         | precise nearest neighbor?
        
           | neumll wrote:
           | Thank you. The indexes are built on top of either Faiss,
           | Hnswlib or Annoy depending on the settings - https://neuml.gi
           | thub.io/txtai/embeddings/configuration/#back...
           | 
           | I've primarily focused on single query times, which have
           | averaged around 5ms - 25ms depending on the size of the
           | index. Queries can be batched so query times wouldn't
           | increase linearly. You could batch quite a few and still get
           | subsecond response times.
           | 
           | All three libraries are approximate nearest neighbors but I
           | know at least for Faiss, it can be configured to effectively
           | be a precise query.
        
             | leobg wrote:
             | Thank you. I'll check it out!
        
       | thatjoeoverthr wrote:
       | I'm late to the party; I just learned about embeddings. I've been
       | playing with lexvec this week. I feel like I've found a book of
       | working magic spells.
        
         | visarga wrote:
         | In 10 lines of code you can import a transformer and embed your
         | phrase/word. Then you can do prediction or similarity search
         | really easy. It's a superpower, true.
        
         | neumll wrote:
         | It's certainly a fast moving space. It's not perfect but the
         | NLP scene has made huge strides the last couple years.
        
       | FridgeSeal wrote:
       | I'm not clear on "where" this sits, is it a framework for turning
       | text into embeddings? Is it the database and serving layer (like
       | Milvus, Vald, Pineconr, etc)? Is it just a Python package for
       | generating and serving vector search in-process?
        
         | neumll wrote:
         | It's all of the above.
         | 
         | txtai uses transformers to transform data (text, images, audio)
         | into embeddings. Those embeddings are then loaded into an
         | approximate nearest neighbor index for search. On top of that,
         | content is loaded into a relational database to support SQL
         | based filtering. It's trying to get the best of both
         | vector/similarity search alongside standard structured search
         | using a SQL syntax.
         | 
         | This can be run in-process or via an API -
         | https://neuml.github.io/txtai/api/
         | 
         | Components can be split up, for example there could be a server
         | that vectorizes text into embeddings and another server that
         | hosts the indexes.
         | 
         | There is also a pipeline and workflow framework
         | (https://neuml.github.io/txtai/workflow/). This component has
         | modules that assists with splitting data, transforming,
         | summarizing, translating, parsing tabular content. Workflows
         | can be used purely for transformations or as a driver to load
         | data.
        
       ___________________________________________________________________
       (page generated 2022-01-12 23:01 UTC)