News for hackers. Stuff that matters.
Re:Comparison of vector databases by anthlax on Monday July 31, 2023 @11:36AM (#36944230)
Coming at this from a diffeeent angle, does anyone have any links to tutorials for use-cases? I’d love to see what vectorDB hype is about but as a regular engineer I’m unable to even grasp how to use a vectorDB
Re:Comparison of vector databases by simonw on Monday July 31, 2023 @11:40AM (#36944305)
Re:Comparison of vector databases by ZephyrBlu on Monday July 31, 2023 @11:44AM (#36944377)
Not a tutorial, but TLDR vector DBs are specialized DBs that store embeddings. Embeddings are vector representations of data (E.g. text or images), which means you can compare them in a quantifiable way.

This enables use cases like semantic search and Retrieval-Augmented Generation (RAG) as mentioned in the article.

Semantic search is: I search for "royal" and I get results that mention "king" or "queen" because they are semantically similar.

RAG is: I make a query asking, "tell me about the English royal family", semantically similar information is fetched using semantic search and provided as context to an LLM to generate an answer.

Re:Comparison of vector databases by IKantRead on Monday July 31, 2023 @11:52AM (#36944506)
There are other use cases, but the big reason vectorDBs are exploding now (outside of general "hype") is that LLM embeddings + easy vector search means you can build a semantic search engine for basically anything you want very fast.

"Semantic search" simply means that I want to match the meaning of my query to the meaning of some other value (as opposed to something like string matching, or even TF-IDF representation).

For example: do you want better documentation search? Previously you had to use some other text search engine that likely used an older technique to do query matching and requires you to learn how to configure their software. Now? You can just take each section of your documentation, pass it to an embedding model, and store a link along with the embedding in the vector db.

Want to avoid duplicate code in your code base? You can just pass every function defined into an LLM, store a pointer to the code and an embedding, then when ever a new function is added you can look up similar function, even if those function have entirely different names.

Maybe you want to build out a recommendation engine for similar users of your app based on there profile: Pass the the profiles into an LLM for embedding, then query each user profile agains the db the find all the similar users. Most vectordbs allow arbitrary metadata to be included, so if you wanted to restrict this to similar users in a similar area you could easily code that up.

All of these projects, which formerly would have been pretty major efforts that might not have worked so well, into likely very good retrieval that can be prototyped in a few days once you have the db setup.

Re:Comparison of vector databases by estreeper on Monday July 31, 2023 @11:58AM (#36944602)
I recently wrote a tutorial on making a vector driven semantic search app using all open source tools (pgvector, Instructor, and Flask) that might be helpful: https://revelry.co/insights/open-source-semantic-vector-sear...
Re:Comparison of vector databases by empath-nirvana on Monday July 31, 2023 @11:59AM (#36944615)
I'll give you an example of something i did with a vector database.

I was playing around with making my own UI for interfacing with chatgpt. I saved the chat transcripts in a normal postgres DB, along with the open AI embeddings for each message in a vector db, with a pointer to the message id in postgres in the vector DB metadata.

Then as you chatted, i had chatgpt continuously creating a summary of the current conversation you were having in the background and doing a search in the vector db for previous messages about whatever we're talking about, and it would inject that into the chat context invisibly. So you can do something like say: "Hey do you remember when we talked about baseball" and it would find a previous conversation where you talked about so and so hitting a home run into the context and the bot would have access to that, even though you never mentioned the word "baseball" in the previous conversation -- home run is semantically similar enough that it finds it.

If you're using openai embeddings as your vectors, it's _extremely_ impressive how well it finds similar topics, even when the actual words used are completely different.

Re:Comparison of vector databases by gk1 on Monday July 31, 2023 @12:05PM (#36944720)
We made an entire learning center for interested folks like you: https://www.pinecone.io/learn/

I recommend starting at https://www.pinecone.io/learn/vector-database/