From the course: Hands-On AI: RAG using LlamaIndex

Unlock the full course today

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

Storing and retrieving

Storing and retrieving

- [Instructor] Now that you know how to load and index data in LlamaIndex, I'm going to show you how we can now store our data. And in this lesson, I'm going to show you how to store data into Quadrant, which is going to be the vector database that we're going to use in this course. So let's go ahead and do that here, do our standard imports. We will set our API keys for cohere OpenAI. Also instantiate our quadrant, URL and the quadrant API key. This function here is just going to create a directory called data. I've already done that here. And essentially we're just downloading a text file. This text file is going to be a book of poems called, "It can be done." So we're just saving that to disc. I've already done that and I'm going to now load the text document itself as a LlamaIndex document object using the simple directory reader. Now remember that simple directory reader. Typically if you just pass it a path that it's going to just read all of the files in that path, or you can…

Contents