Thanks for sharing. Between combining knowledge graphs and now SQL this is really advanced stuff (at least for me) and it'll take a bit of time to digest it but I'm happy that your videos are so detailed. The use of instructor/pydantic is a technique for controlling the conversation is going to take some digging on my part to understand it. I really appreciate you putting so much effort and sharing it with us.
Thank you Ken, much appreciated! There was definitely a lot of stuff in this video, so totally expected that it might take a bit of time to absorb. But once you do, I think you'll already be in a stronger place than most in thinking about RAG beyond simple vectors
I'm glad you asked! It's cursor.sh, a branch of VSCode (and therefore compatible with most VSCode extensions), but with AI-capabilities wayyy better than Copilot. Highly recommend checking it out!
Hey Johannes, nice video, I have a question, trying to build RAG and stuck on chunking the data into vector db. I have huge FAQ on my website (about 500 pages) in format question and then answer. Now want to put this in the vector db, but I don't know if I need to put only answers, or question+answer as one chunk, or question and answer as separates chunks, how you will proceed?
Thank you! That's a good question. Let's assume you are performing search just by embedding the user's question and running that as a vector search (not sufficient for a lot of cases, but for FAQ it might be). In this case, the question in your FAQ-data is the most relevant, because you are basically trying to match the user's question with a semantically similar question in your FAQ-data (and then retrieve the answer). So, as a simple approach you might just do question+answer as one chunk. However, the answer might not actually have a lot of semantic similarity to the user's question, so including the answer in your vector field might negatively affect the quality of your results. So as an alternative, you could do the following: 1. From your FAQ-data, populate your vector db so that each document in the vector db has two fields: a vector field, which only contains the (embedded) FAQ-question, and then separately a content field, which is the (plain-text) answer associated for that question. 2. Then, you run your vector search against the vector field, and return the content field as part of your results. 3. This way, the searching is just based on the semantic similarity of the questions, rather than taking the answers into account. This might be counterintuitive if you are used to thinking about vector searches where the search-field and the retrieved field are always the same, but there are other ways to do it as well. Hope this helps!
@@johannesjolkkonen Heyy, thanks for your answer, good point of view 🙏 Currently my systems works the same, but instead of vector db, I use normal text search implemented in Elasticsearch. I am searching for most similar question, then the output of elastic is passed to gpt and final output is returned. 1) Do you think that by replacing elastic with vector db, I could get better results while searching for proper context to be used later in gpt to finalize response?
Really helpful content but please dont add music while you are talking, especially overpowering music. Makes it very difficult to follow what you are speaking.
Thanks for sharing. Between combining knowledge graphs and now SQL this is really advanced stuff (at least for me) and it'll take a bit of time to digest it but I'm happy that your videos are so detailed. The use of instructor/pydantic is a technique for controlling the conversation is going to take some digging on my part to understand it. I really appreciate you putting so much effort and sharing it with us.
Thank you Ken, much appreciated!
There was definitely a lot of stuff in this video, so totally expected that it might take a bit of time to absorb. But once you do, I think you'll already be in a stronger place than most in thinking about RAG beyond simple vectors
Great video Johannes!
Thanks Avthar!
Nice, Thanks for sharing.
Very nice demo, its funny, I was just wondering if sql and vector search could be combined ... and you've nailed it.
Hey, just curious, what ide is that?
I'm glad you asked! It's cursor.sh, a branch of VSCode (and therefore compatible with most VSCode extensions), but with AI-capabilities wayyy better than Copilot. Highly recommend checking it out!
I’m glad you asked that too
@@johannesjolkkonen cool, thank you. great video is cool also
Hey Johannes, nice video, I have a question, trying to build RAG and stuck on chunking the data into vector db. I have huge FAQ on my website (about 500 pages) in format question and then answer. Now want to put this in the vector db, but I don't know if I need to put only answers, or question+answer as one chunk, or question and answer as separates chunks, how you will proceed?
Thank you!
That's a good question. Let's assume you are performing search just by embedding the user's question and running that as a vector search (not sufficient for a lot of cases, but for FAQ it might be).
In this case, the question in your FAQ-data is the most relevant, because you are basically trying to match the user's question with a semantically similar question in your FAQ-data (and then retrieve the answer). So, as a simple approach you might just do question+answer as one chunk.
However, the answer might not actually have a lot of semantic similarity to the user's question, so including the answer in your vector field might negatively affect the quality of your results.
So as an alternative, you could do the following:
1. From your FAQ-data, populate your vector db so that each document in the vector db has two fields: a vector field, which only contains the (embedded) FAQ-question, and then separately a content field, which is the (plain-text) answer associated for that question.
2. Then, you run your vector search against the vector field, and return the content field as part of your results.
3. This way, the searching is just based on the semantic similarity of the questions, rather than taking the answers into account.
This might be counterintuitive if you are used to thinking about vector searches where the search-field and the retrieved field are always the same, but there are other ways to do it as well.
Hope this helps!
@@johannesjolkkonen Heyy, thanks for your answer, good point of view 🙏 Currently my systems works the same, but instead of vector db, I use normal text search implemented in Elasticsearch. I am searching for most similar question, then the output of elastic is passed to gpt and final output is returned.
1) Do you think that by replacing elastic with vector db, I could get better results while searching for proper context to be used later in gpt to finalize response?
Really helpful content but please dont add music while you are talking, especially overpowering music. Makes it very difficult to follow what you are speaking.