Skip to content

mwaseem75/iris-RAG-Gen

Repository files navigation

Summary

Iris-RAG-Gen is a generative AI Retrieval-Augmented Generation (RAG) application that leverages the functionality of IRIS Vector Search to personalize ChatGPT with the help of the Streamlit web framework, LangChain, and OpenAI. The application uses IRIS as a vector store.

RAG is a powerful AI model that combines the strengths of retrieval-based and generative models. It leverages a pre-trained language model to generate responses based on retrieved documents, enabling more accurate and context-aware answers.

one one one one one one one OEX license image

Application Interface

image

Features

  • Ingest Documents (PDF or TXT) into IRIS
  • Chat with the selected Ingested document
  • Delete Ingested Documents
  • OpenAI ChatGPT

Installation

  1. Clone/git pull the repo into any local directory
git clone https://github.com/mwaseem75/iris-RAG-Gen.git
  1. Open a Docker terminal in this directory and run:
docker-compose build
  1. Run the IRIS container:
docker-compose up -d 

Getting Started

Get OpenAI Key

Application requires OpenAI API Key, sign up for OpenAI API on this page. Once you have signed up and logged in, click on Personal, and select View API keys in drop-down menu. Create and copy the API Key

image

Run Streamlit Web Application

To run the application Navigate to http://localhost:8051

Follow the Below Steps to Ingest the document:

  • Enter OpenAI Key
  • Select Document (PDF or TXT)
  • Enter Document Description
  • Click on the Ingest Document Button

image

Once the Document is Ingested, Select the document from 'Select Chat Option' image

Select the Document and press enter. The application will read the vector data and return the relevant answer image

To delete the Ingested document, Press the 'Delete selected Document' Button, Once confirmed, the Document will be deleted. image

View Data

Navigate to the Management Portal SQL (http://localhost:53795/csp/sys/exp/%25CSP.UI.Portal.SQL.Home.zen?$NAMESPACE=USER) to view Vector Data [SuperUser | SYS]

Documents Description is saved in the 'rag_documents' table. Type the below SQL command to retrieve the data

SELECT 
id, description, docType
FROM SQLUser.rag_documents

image

The vector data is saved in 'rag_document + id' table. (id of the rag_documents) image

Type the below SQL command to retrieve vector data

SELECT top 5
id, embedding, document, metadata
FROM SQLUser.rag_document2

image

For OpenAI Chat, Select OpenAI option from 'Select Chat Option' image

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published