High Precision RAG

This page will show an end-to-end creation of an Advanced RAG application using Meta's 2024 Second Quarter Financial Report PDF. Highlighted steps; Ingestion, Chunking/Embedding, and App Creation

What You Will Need:

  • API Key and Credentials: Ensure you have an API key and any other necessary credentials for your Large Language Model (LLM).

Step 1: Configure LLM API

Before creating the Q&A system, configure the OpenAI GPT-4 model via the AI Applications page.

  • Add API Key: Enter your API key into the LLM Configuration box.

  • Set Parameters: Copy a response length of 1200 characters and set the temperature to 0.5.

Step 2: Create Your APP

Click the “Create AI App” Button to begin

Enter your application name:

  • Make sure to select the default language model for your application. This can be changed in the editor screen.

Configure Sources:

  • PDF (Upload from Local System): Select PDF as the file type, upload from your desktop, and locate your file of interest.

Already Existing Dataset(Skip if you are ingesting new data)

  • Select the already existing dataset option once you have selected the configured LLM, then click continue to select the correct dataset

  • Select the dataset that has already been processed from pdf, html, word, etc...

  • Hit the next button, and continue with the following steps

Submit Ingest:

  • After configuring your source data, the default target will be created. If you would like to change this you can hit the edit button above the green box.

  • Hit Next

Step 3: Creating Vector Embeddings from Ingested Data:

Run the Process:

  • Hit Next, Select the dataflow to use for this app.

Step 4: Create the Rag App

Hit Review and Submit:

  • Make sure that you are happy with the pre-set rules, if there are any components(retrieval strategies, custom concepts to add, want to select specific LLM for text generation, and adding a custom prompt) you would like to change, you can do so before submitting.

Option to Change Language Model and Prompt:

  • Choose the language models (e.g., LLaMA 2, ChatGPT, Dolly).

  • Provide a custom prompt for the system.

Save and Submit:

  • Save your configurations and submit to create the Q&A system.

  • MongoDB will automatically index the data.

Step 5: Using the Q&A System

Hit the search icon:

Testing the System:

  • Ask a question in the chat box, the system will return an answer along with the data location. For Example: What is the 2024 GAAP advertising Revenue in the three months ended June 30th? What about net cash by operating activities?

Review Results:

  • Users can check the source links to verify the origin of the generated information.

Last updated