Home Applications iris-RAG-Gen

iris-RAG-Gen

This application is not supported by InterSystems Corporation. Please be notified that you use it at your own risk.
5
1 reviews
2
Awards
281
Views
1
IPM installs
0
0
Details
Releases
Reviews  (1)
Awards  (2)
Issues
Articles  (2)
RAG Personal ChatGPT app leverages IRIS Vector Search func.

What's new in this version

Select and Ingest Document Functionality Added
Delete Ingested Document Functionality Added

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

Made with
Install
zpm install iris-rag-gen download archive
Version
1.0.131 Jul, 2024
Python package
streamlit
Category
Technology Example
Works with
InterSystems Vector Search
First published
27 Jul, 2024