HeatWave User Guide  /  ...  /  Quickstart: Setting Up a Help Chat

4.2.4 Quickstart: Setting Up a Help Chat

This quickstart shows how to use the vector store functionality and use HeatWave Chat to create a GenAI-powered Help chat that refers to the HeatWave user guide to respond to HeatWave related queries.

Note

This quickstart assumes that you are familiar with HeatWave Database Systems.

This quickstart contains the following sections:

Before You Begin

Review the Requirements.

Setting Up the Bucket

  1. Download the HeatWave user guide PDF.

  2. Create an Bucket with the name quickstart_bucket.

  3. Upload the PDF file to the Bucket using the prefix quickstart/ to create a new folder by the name quickstart.

Connecting to the Database System

Setting Up the Vector Store

  1. Create and use a new database:

    CREATE DATABASE quickstart_db;
    USE quickstart_db;
  2. Create the vector table and load the source document:

    CALL sys.VECTOR_STORE_LOAD('oci://quickstart_bucket@Namespace/quickstart/heatwave-en.a4.pdf', '{"table_name": "quickstart_embeddings"}');

    Replace Namespace with the name of the bucket namespace that you are using.

    This creates an asynchronous task in the background which loads the vector embeddings into the specified vector store table quickstart_embeddings.

    The routine output that is displayed contains a query with the task ID.

  3. To track the progress of the task, run the task query displayed on the screen:

    SELECT mysql_tasks.task_status_brief("TaskID");

    Replace TaskID with the displayed task ID.

    The output looks similar to the following:

    +-----------------------------------------------------------------------------------------+
    | mysql_tasks.task_status_brief("TaskID")                                                 |                                                                                          
    +-----------------------------------------------------------------------------------------+
    | {"data": {"tables_to_load": "[{\"table_name\": \"quickstart_embeddings\",               |
    | \"load_progress\": 40.0}]"}, "status": "RUNNING", "message": "Loading in progress...",  |
    | "progress": 40}                                                                         |
    +-----------------------------------------------------------------------------------------+
  4. After the task status has changed to Completed, verify that embeddings are loaded in the vector store table:

    SELECT COUNT(*) FROM quickstart_embeddings;

    If you see a numerical value in the output, your embeddings are successfully loaded in the vector store table.

Starting a Chat Session

  1. Clear the previous chat history and states:

    SET @chat_options=NULL;
  2. Ask your question using HeatWave Chat:

    CALL sys.HEATWAVE_CHAT("What is HeatWave AutoML?");

    The HEATWAVE_CHAT routine automatically loads the LLM and runs a semantic search on the available vector stores and retrieves context, by default. The output is similar to the following:

    |  HeatWave AutoML is a feature of MySQL HeatWave that makes it easy to use
    machine learning, whether you are a novice user or an experienced ML practitioner.
    It analyzes the characteristics of the data and creates an optimized machine
    learning model that can be used to generate predictions and explanations. The
    data and models never leave MySQL HeatWave, saving time and effort while keeping
    the data and models secure. HeatWave AutoML is optimized for HeatWave shapes and
    scaling, and all processing is performed on the HeatWave Cluster. |
  3. Ask a follow-up question:

    CALL sys.HEATWAVE_CHAT("How to set it up?");

    The output is similar to the following:

      |  Answer: To set up HeatWave AutoML in MySQL HeatWave, you need to
         follow these steps:
    
      1. Create a new user with the necessary privileges.
      2. Create a new schema named ML_SCHEMA_user_name, where the user_name
         is the name of the owning user.
      3. Create an InnoDB table named MODEL_CATALOG in the ML_SCHEMA_user_name
         schema.
      4. Grant the necessary privileges to the new user for the ML_SCHEMA_user_name
         schema and the MODEL_CATALOG table.
      5. Create a new machine learning model using HeatWave AutoML.
      
      To monitor HeatWave AutoML status, you can query the rapid_ml_status variable
      or the ML_STATUS column of the performance_schema.rpd_nodes table. The
      rapid_ml_status variable provides the status of HeatWave AutoML, with possible
      values of ON and OFF. If the value is ON, HeatWave AutoML is up and running,
      and if it's OFF, HeatWave AutoML is down. You can also query the ML            |

    You can continue asking follow-up questions in the same chat session.

Cleaning Up

To avoid being billed for the resources that you created for this quickstart, perform the following steps:

  1. Delete the database that you created:

    drop database quickstart_db;
  2. If you created a new DB system, then delete the DB system. For more information, see Deleting a DB System.

  3. Delete quickstart_bucket. For more information, see Deleting the Bucket.