Semantic Search in Bubble with OpenAI and Pinecone

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right let's learn how to achieve semantic search generative QA in bubble using the openai and Pinecone apis essentially our baby chat gbt based only on information of our choosing now on the left side I recreated chat gbt using the chat completions API I do have a video about how to do that so that we can do this what is the capital of Italy and see the difference between the two apps we get back the expected answer what if we do the same in the app that we're building on the right we get back nothing because we have not sold our empty brain what is true so let's tell it that the capital of Italy is Milan now our brain is learning a new fact whether true or not we can now ask it what is the capital of Italy and we are going to get back an answer based on the body of knowledge that we just fed it now you can see the endless applications for this internal company documentation historical medical facts and so on so how do we build this two things get yourself an open AI API key that's free the same with pine cone then in the open AI documentation we are going to copy the embeddings curl so that we can go into bubbles open I'm sorry the API connector and we can paste the curl in here if you don't know how to do it it is achieved by clicking this and pasting that in here and you will end up having something very similar to this again if you can figure out the rest of my API key you win a prize uh so make the input dynamic because that's going to be what we write into this chat boxes that we just looked at completions don't worry about it it was just for this demo now go to Pinecone and in Pinecone you are going to do this you're going to create a new index that new index is going to have a name of your choosing but it's going to have 1536 dimensions and now you're going to choose P2 because it's the newer inside of your index you're going to have all these beautiful API resources we're gonna only care about upsert which is how we ingest data into the database so you can copy this and back into bubble we're gonna paste it and we're gonna end up with something like this make these fields Dynamic you can pause the video and then we're gonna get the query as well here and we're gonna end up with something like this making these parameters Dynamic okay workflows when clicking that button so the capital of Italy is we are upsetting we are feeding data to the database the way that this works is we're going to take a piece of text we're going to put it through the open AI embeddings model it's going to break it up into all these different numbers you don't need to know why and how it's just going to do it so that pine cone which is a vector database is going to accept those vectors which is which is all these different numbers that represent all these different words that we just created it wants an ID I do this by a random string you can look up how to do that it's very simple text is going to be the text from the input um same input as uh that because it's going to save that into um metadata and then the values so those vectors that it's expecting are going to be the vectors coming from the previous column query this is where we ask what is the capital of push when we push that button yes we are going to turn that text into vectors again why because Pinecone only understands those vectors the vector database so we're going to take those vectors all those numbers and I do recommend checking out the documentation it's very very clear and very very informative take all those numbers understand what you're actually asking in natural language so again the result of this and then you can get the response and show it like I do on um a custom State you can save that information in the database so this is the very very very very basics of how to achieve this of course we are going to need a much longer explainer but hopefully this is a good primer feel free to ask me questions and I'll be happy to unpack it all
Info
Channel: Damiano Redemagni
Views: 6,040
Rating: undefined out of 5
Keywords: Bubble, OpenAI, Pinecone, Semantic Search, Generative QA, GPT-3, Natural Language Processing, Vector Search, Tutorial, How-To, AI, Machine Learning, NLP, API
Id: DkOyTUGxOSo
Channel Id: undefined
Length: 5min 0sec (300 seconds)
Published: Sat Apr 01 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.