Skip to content

bryanlje/sns-chat-v2

Repository files navigation

SNS Chat Application

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.

Features

  • 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.

Installation

  1. Clone the repository:

    git clone <repository_url>
    cd sns_chat_v2
  2. Install dependencies:

    pip install --upgrade pip
    pip install --no-cache-dir -r requirements.txt
  3. 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

Usage

  1. Run the Flask application:

    waitress-serve --listen=*:5000 sns_chat_v2:app
    gunicorn --bind 0.0.0.0:5000 sns_chat_v2:app
  2. Access the application: Open your web browser and navigate to http://localhost:5000.

  3. Interact with the chatbot: Enter your query in the provided input field and submit it. The chatbot will respond with the relevant information.

Docker

You can also run the application using Docker:

  1. 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

Clearing Chat History

To clear the chat history, click on the "Clear History" button on the web interface. This will reset the chat history.

About

A 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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors