Skip to content

ibmstorage/ibm-storageinsights-chatbot

Repository files navigation


Chatbot Logo

Chatbot using IBM Storage Insights APIs


Introduction

What is Chatbot using IBM Storage Insights APIs?

IBM Storage Insights is an observability and AIOps platform for storage systems which helps administrators and SRE to monitor and manage their storage fleet.

This is an open-source chatbot created by the IBM Storage Insights team to enable natural language interactions. It enables users to interact & chat with IBM Storage Insights in natural language form to assist in easy observability and monitoring. By leveraging large language models (LLMs) and advanced prompt engineering, the bot intelligently detects user intent, extracts relevant entities, and seamlessly makes IBM Storage Insights API calls to fulfil user queries.

Powered by IBM Watsonx and utilizing both Granite and Llama (Built with Llama) LLMs, this chatbot provides a conversational, intuitive approach for managing and accessing storage data and insights.

Key Features

  • Natural Language Understanding: Utilizes LLMs to process user queries and convert them into actionable API calls.
  • Entity Recognition: Extracts storage-specific entities from user input to ensure accurate API interactions.
  • REST API Integration: Directly interacts with Storage Insights APIs to retrieve storage system alerts, metrics, notifications, and more.

Supported APIs

This chatbot currently supports the following IBM Storage Insights APIs:

  • Storage system alerts
  • Storage system metrics
  • Storage system notifications
  • Storage system list
  • Tenant alerts
  • Tenant notifications
  • Storage system volumes
  • Storage system details

Note: This is a sample Do-It-Yourself (DIY) GenAI-enabled observability chatbot for IBM Storage Insights, provided on an as-is basis. The functionality currently includes a limited set of IBM Storage Insights REST API capabilities, as listed above. Users are encouraged to extend and adapt this project to incorporate additional REST API endpoints as desired. This is a community-driven project, and IBM does not offer formal support.


Installation

Prerequisites

Before installing the chatbot, ensure you have the following prerequisites:

  1. Sign up for IBM watsonx as a Service: Sign up for IBM watsonx as a Service.

    Select DALLAS region as the LLM availability differs from region to region.

    You get 50,000 free tokens per month with your Lite account, consider upgrading to a pay-as-you-go account where you get $200 free credits which are valid for 30 days. For more information, visit Upgrading your account

  2. Create a watsonx API key: Setup your watsonx machine learning instance by following Steps 1 to 9 in this document Create a watsonx API key .

    Keep note of the generated Watsonx Project ID.

    Keep note of the generated Watsonx API key.

  3. Storage Insights API Key: Refer section Generating a REST API key.

    External Rest APIs can only be accessed with IBM Storage Insights Pro license.

    This IBM Storage Insights External Rest API key will be used during login.

  4. Podman: Install Podman.

    • You can then verify the installation information using:
      podman info
    • If podman is setup correctly, you will be able to see detailed information about your host.
  5. Install Git: Install Git.

  6. Install OpenSSL : Install OpenSSL

    OpenSSL comes pre-installed on many Unix-based operating systems, such as Linux and macOS. Run below command to check if OpenSSL is already installed on your system

    openssl version

    If OpenSSL is installed, this command will display the version of OpenSSL installed, like: OpenSSL 3.1.1 30 May 2023 (Library: OpenSSL 3.1.1 30 May 2023)

Installation

  1. Clone the GitHub repo:
    https://github.com/ibmstorage/ibm-storageinsights-chatbot.git

    git clone https://github.com/ibmstorage/ibm-storageinsights-chatbot.git
  2. Go to directory ibm-storageinsights-chatbot/.

    cd ibm-storageinsights-chatbot/
  3. Generate a secret key using the script generate_key.sh. This secret is required to encrypt/decrypt the Storage Insights API key during all communications.

    • Make the script executable using the command:
      chmod +x generate_key.sh
    • Run the script:
      ./generate_key.sh
    • The key will be printed on the terminal. Copy the key as it will be used in next step.
  4. To start an HTTPS server, generate self-signed certificates using the provided script generate_certificates.sh.

    • Make the script executable:

      chmod +x generate_certificates.sh
    • Run the script:

      ./generate_certificates.sh
    • The script will prompt you to enter some details. Fill in the required information to proceed.

    • The generated certificates will be stored in:

      • frontend/certificates/
      • backend/certificates/

    Note: Self-signed certificates work only with Google Chrome. For other browsers, manually copy the CA-certified certificates to the frontend/certificates/ and backend/certificates/ directories as needed.

  5. Set environment variables:

    1. Setting variables for Frontend

    1. Go to frontend/.

      cd frontend/
    2. Open dockerfile.frontend in a text editor and add values for REACT_APP_BACKEND_BASE_URL and REACT_APP_SECRET_KEY:

      • REACT_APP_BACKEND_BASE_URL: Backend server URL where the backend APIs are hosted. If your are running the chatbot on a Host with IP 9.200.34.201, the URL will be https://9.200.34.201:9508/chatbot. Please change the Host IP according to your infrastructure.
      • REACT_APP_SECRET_KEY: Refer to Step 3 for copying the newly generated secret key.
    3. After setting up the necessary variables, go pack to the parent directory using below command:

      cd ..

    2. Setting variables for Backend

    1. Go to backend/.
      cd backend/
    2. Open dockerfile.backend in a text editor and add values for the following variables:
      • WATSONX_APIKEY: Refer to Prerequisites, point 4 for copying the API key.
      • PROJECT_ID: Refer to Prerequisites, point 3 for copying the Project ID.
      • WATSONX_HOSTED_SERVICE: This is watsonx endpoint URl and depends on the region you selected while setting up the account. Refer Endpoint URLs section for possible values.
      • ORIGIN: URL where the frontend is hosted. If your are running the chatbot on a Host with IP 9.200.34.201, the URL will be https://9.200.34.201:9502. Please change the Host IP according to your infrastructure.
      • SECRET_KEY: Refer to step 3 for copying the newly generated secret key.
  6. Go back to parent directory ibm-storageinsights-chatbot/.

    cd ..
  7. You will find an install script install_si_chatbot.sh. Some values are pre-configured but can be changed as per your infrastructure. These values are:

    • FRONTEND_IMAGE_TAG
    • BACKEND_IMAGE_TAG
    • VOLUME_NAME
    • BACKEND_PORT
    • FRONTEND_PORT
  8. Make the script executable using the command:

    chmod +x install_si_chatbot.sh
  9. Run the script:

    ./install_si_chatbot.sh
  10. Access the frontend UI from the link:

    https://<host>:9502/chatbot/

Common Installation Errors

  1. If you encounter below error

    Error: creating container storage: the container name "frontend" is already in use

    Run below commands and execute install_si_chatbot.sh script again

    podman stop backend
    podman stop frontend
    podman rm backend
    podman rm frontend

Helpful videos

  1. Video guide for IBM Watsonx as a service
  2. Video guide for Chatbot Installation
  3. User guide for Chatbot Features Overview

License

Apache License (Version 2.0)

Authors

See AUTHORS.md