From the course: Building Secure and Trustworthy LLMs Using NVIDIA Guardrails
Unlock the full course today
Join today to access over 25,200 courses taught by industry experts.
Retrieval-augmented generation (RAG) with actions
From the course: Building Secure and Trustworthy LLMs Using NVIDIA Guardrails
Retrieval-augmented generation (RAG) with actions
- [Instructor] It's time now to dive deep into retrieval augmented generation using Guardrails. So let's dive right in. To get started, we need to install some prerequisite libraries. These include NeMo Guardrails, pinecone-client, data sets, and OpenAI. You can use the pip install command to install all of these libraries, and this will ensure that you have all the necessary tools to implement RAG with Guardrails. Next, we need to set up our data. We'll use another set that contains some information on the recent Llama 2 models and other research papers from Archive. To load the dataset, simply import load dataset from datasets library and then specify our split, which is train in our case. You can also visualize the data, and as you can see, we have various keys. The main ones are doi and chunk-id, where the doi is the unique identifier for each research paper. Let's combine the unique IDs for each record in the data set by concatenating these two fields. This will ensure that each…