SNS Chat is an RAG-powered chatbot application designed to assist employees at SNS Network with their queries. It leverages LangChain, NVIDIA, and HuggingFace APIs to provide accurate and efficient responses.
- AI Chat: Utilise powerful language models to provide accurate answers to employee questions.
- Multi-query Retrieval: Generate multiple perspectives on user questions to improve retrieval accuracy.
- Contextual Compression: Compress retrieved documents with reranking for efficient information extraction.
- Flask Web Interface: A simple and interactive web interface built using Flask.
-
Clone the repository:
git clone <repository_url> cd sns_chat_v2
-
Install dependencies:
pip install --upgrade pip pip install --no-cache-dir -r requirements.txt
-
Set environment variables:
export NIM_IP='YOUR_IP' export PHOENIX_IP='YOUR_IP' # Comment out if not using Phoenix export LLM_MODEL='YOUR_MODEL' # Example: mistralai/Mistral-7B-Instruct-v0.3
-
Run the Flask application:
waitress-serve --listen=*:5000 sns_chat_v2:app
gunicorn --bind 0.0.0.0:5000 sns_chat_v2:app
-
Access the application: Open your web browser and navigate to
http://localhost:5000. -
Interact with the chatbot: Enter your query in the provided input field and submit it. The chatbot will respond with the relevant information.
You can also run the application using Docker:
- Pull and run the Docker image:
docker run --rm -it -e NIM_IP=YOUR_IP -e PHOENIX_IP=YOUR_IP -p 5000:5000 --name sns_chat mulberrydunes/sns_chat:0.0.5
To clear the chat history, click on the "Clear History" button on the web interface. This will reset the chat history.