3 ms·
Vector databases make it so semantically similar sentences get mapped to be closer together in the vector space. So the sentence "I started working as a progra
by gamegoblin 3y ago
Vector databases make it so semantically similar sentences get mapped to be closer together in the vector space.
So the sentence "I started working as a programmer" will be very close to "I began my job as a software developer". This makes it very powerful for natural language search.
So when the user asks a bot "Find the text message John sent me 3 years ago about wanting to found a company, I think it was like a hang gliding company? or parasailing? idk"
Behind the scenes you can ask GPT "Output a list of 10 candidate sentences that are plausible text messages that John may have sent", and it spits out
"I'm thinking of starting a hang gliding company" and "I might found a parasailing company" etc.
Then you query the vector DB for those imaginary sentences, and as a result you get sentences that are semantically similar. You take the top N nearest neighbors and plug them in to the GPT context window and say:
"Here are 100 sentences that might match the original query. If any of them match, select the number that matches. Otherwise output null"
If you engineer this system well, you can get pretty decent results.
This is great for key:value type querying, but IMO there is a lot of ground to be explored by extending it with more graph-like links. I.e. use vector search to get some initial nodes that are better than random, but then start doing a little beam-search algorithm from those nodes to find nodes they are "linked" to in some way that may answer the query better.
- satvikpendem 3y agoSo you have to feed in the items to ChatGPT manually (or via some script) it looks like? In the future I guess ChatGPT with plugins could query the database on its own? Does it work for text data or can it work for other types of data as well?
- gamegoblin 3y agoYou call the ChatGPT API programmatically, entirely automated. You call the API, parse the response, make a decision in code, call the API again, etc. The GPT API just becomes a natural language reasoning module in an otherwise normal codebase.
- MacsHeadroom 3y agoIt works for all types of data. You can say "Give me objects similar to water" and have it return words like "liquid" and "juice," pictures of water, the water drop emoji, and babbling brook and rain storm sound files. It all depends on how you produce the vectors before storage. The vector database just stores them.
- satvikpendem 3y agoHow does the production of vectors work? How do you know that you should associate the water emoji to pictures of water close together in the hyperspace?