From the course: Building Apps with AI Tools: ChatGPT, Semantic Kernel, and Langchain

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Solution: A librarian with a library

Solution: A librarian with a library

(upbeat music) - [Instructor] Let's see how we can give our librarian a library. So from the previous video, we can see here we have a dataset_small, which has around eight books, and we have a regular dataset, which is close to 6,000. Now let's head over to our main.py under our source folder. So in here we have a basic solution that works. It's around 45 lines. And then we have an advanced solution in main_advanced. Let's start off with main. So how do we get to our solution? First, we load in our dataset small with our CSV loader. This lets us get all the information that we need, and we use the source column title to indicate which document belongs to which. Then we're going to create a new vector database. I chose to use Quadrent, since I wanted to showcase a different database that we used before. It's built into LangChain, so it's easy to use. Then we're going to create our retrieval QA chain, passing in our…

Contents