The Streamlit app for the AI Assistant can be found here. You're welcome to give it a try!
The AI Assistant is an intelligent conversational tool leveraging the power of OpenAI's GPT models to provide insightful and interactive responses. Built with Langchain for advanced agent management, memory handling, and tool creation, the assistant offers a seamless user experience through a Streamlit-based interface.
Additionally, it incorporates FAISS for efficient document search capabilities, allowing users to upload and search through PDF, DOCX, and TXT files. This versatile assistant is designed to assist users with answering questions, providing information, and retrieving relevant content from uploaded documents.
This tool is built on a combination of cutting-edge technologies:
- OpenAI: For conversational AI capabilities.
- Langchain: For managing agents, memories, and tools for the AI assistant.
- Streamlit: For the interactive user interface.
- FAISS: For creating a vector store to support document search capabilities.
- Interactive chat interface with the AI Assistant.
- Choose between OpenAI's GPT-4 and GPT-3.5-turbo models.
- Upload and search through PDF, DOCX, and TXT documents.
- Clear chat history and update document storage.
Before installing the project, ensure you have the following installed:
# Install Python 3.x using Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew update
brew install python
# pip is already installed with Python 3.x on macOS.
# Install Python 3.x:
sudo apt update
sudo apt install python3
# Install pip (Python Package Installer):
sudo apt update
sudo apt install python3-pip
Install Python 3.x using Windows Installer:
- Download the latest Python 3.x installer from Python official website.
- Run the installer and select "Add Python to PATH" during installation.
- Click "Install Now" to install Python 3.x.
- The
pip
package is included by default with the Python installer for Windows.
To run the application, follow the steps below:
-
Install Required Packages:
# Install packages python -m pip install -r requirements.txt
This command will install all the necessary dependencies listed in the requirements.txt file.
-
Run the Application:
# Run application streamlit run main.py
This command will start the application and execute the main.py script, allowing you to interact with the application.
-
Setting-up and Using the Pre-Commit Linters (Optional):
# Installing dev package python -m pip install -r dev-requirements.txt # Installing pre-commit hooks (after this, linters will run before commits) pre-commit install # Running pre-commit hooks manually on all files pre-commit run --all-files
-
OpenAI API Key:
- Enter your OpenAI API key in the sidebar to access the assistant. Choose OpenAI model:
-
Select the desired model from the dropdown list:
- GPT-4 or GPT-3.5-turbo.
-
Temperature:
- Adjust the temperature slider for the assistant's response generation.
-
Clear Chat History:
- Click the "Clear History" button to clear the chat history.
-
Upload a File:
- Use the file uploader to support vector store capabilities based on uploaded files. Supported formats include PDF, DOCX, and TXT.
This AI assistant is based on OpenAI and is designed to answer questions based on its training knowledge. Additionally, it features a document upload capability using a vector store.
Please note that this is a beta tool, and any feedback is appreciated to enhance its performance.
- Sharon Mordechai.