Initial Release
This project demonstrates a Vector Search application using Large Language Models (LLMs) integrated with InterSystems IRIS. The application is built using Streamlit and leverages OpenAI’s API for natural language processing tasks.
├── app
│ ├── docker-compose.yaml
│ └── streamlit
│ ├── combined_code.py
│ ├── constants.py
│ ├── db_operations.py
│ ├── Dockerfile
│ ├── helper.py
│ ├── main.py
│ ├── openai_llm.py
│ └── requirements.txt
├── jupyter_notebooks
│ ├── intersystems_vector_search.ipynb
│ └── sample_data
│ ├── example_Imatinib_Teva.pdf
│ ├── large_document.txt
│ └── small_data.txt
└── README.md
Ensure you have the following installed on your local machine:
Create a .env file in the root directory of your project and add the following environment variables:
IRIS_USERNAME=demo
IRIS_PASSWORD=demo
IRIS_HOSTNAME=intersystems
IRIS_PORT=1972
IRIS_TABLE_NAME=intersystems_table
IRIS_NAMESPACE=USER
OPENAI_API_KEY=<your-openai-api-key>
Run the following command to build and start the services:
docker compose up --build
If encounter docker timeout issue do
docker compose down
docker compose up --build
Run Intersystems DB
docker run --name iris-comm -p 1972:1972 -p 52773:52773 -e IRIS_PASSWORD=demo -e IRIS_USERNAME=demo intersystemsdc/iris-community:latest
Run jupyter notebook
cd jupyter_notebooks
jupyter notebook
Once the services are up and running, you can access the Streamlit application by navigating to:
http://localhost:8501
You can upload a .pdf or .txt file through the Streamlit interface.
The file content will be processed and inserted into the InterSystems IRIS database.
Enter your question in the provided input box and click the Submit button.
The application will generate a response to your question using OpenAI’s API and display relevant search results from the InterSystems IRIS database.
Simply do Ctrl+C from the terminal
docker compose down
docker rm iris-comm
Defines the services required for the application: intersystems (IRIS) and app (Streamlit application).
Specifies the Docker image for the Streamlit application, including the installation of necessary dependencies and models.
Contains the main Streamlit application code, which handles file uploads, data processing, and querying.
Handles database operations such as verifying table existence, inserting data, and counting records.
Combines various functionalities such as initializing the database, inserting data, and generating responses to user queries.
Handles interactions with OpenAI’s API for natural language processing tasks.
Lists the Python dependencies required for the Streamlit application.
Contain various helper functions and constants used throughout the application.
Ensure that the InterSystems IRIS container is fully up and running before attempting to use the Streamlit application.
The sleep 25 command in the Docker configuration ensures that the IRIS service has enough time to start before the application attempts to connect.
If you encounter any issues, check the logs of both containers using the following command:
docker-compose logs