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.
- Ingest Documents (PDF or TXT) into IRIS
- Chat with the selected Ingested document
- Delete Ingested Documents
- OpenAI ChatGPT
- Clone/git pull the repo into any local directory
git clone https://github.com/mwaseem75/iris-RAG-Gen.git
- Open a Docker terminal in this directory and run:
docker-compose build
- Run the IRIS container:
docker-compose up -d
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
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
Once the Document is Ingested, Select the document from 'Select Chat Option'
Select the Document and press enter. The application will read the vector data and return the relevant answer
To delete the Ingested document, Press the 'Delete selected Document' Button, Once confirmed, the Document will be deleted.
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
The vector data is saved in 'rag_document + id' table. (id of the rag_documents)
Type the below SQL command to retrieve vector data
SELECT top 5
id, embedding, document, metadata
FROM SQLUser.rag_document2
For OpenAI Chat, Select OpenAI option from 'Select Chat Option'