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

4.2.3 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 Object Storage Bucket

  1. Download the HeatWave user guide PDF (A4) - 1.7Mb.

  2. Create an Object Storage Bucket with the name quickstart_bucket.

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

Connecting to the Database System

  • Connect to your HeatWave Database System.

    Ensure that you pass the --sqlc flag while connecting to the database to use the classic MySQL protocol:

    mysqlsh -uAdmin -pPassword -hPrivateIP --sqlc

    Replace the following:

    • Admin: the database system admin name.

    • Password: the database system password.

    • PrivateIP: the private IP address of the database system.

Setting Up the Vector Store

  1. Create and use a new database:

    create database quickstart_db;
    use quickstart_db;
  2. To create a schema to be used for task management, run the following command:

    select mysql_task_management_ensure_schema();
  3. 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 Object Storage 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.

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

    select id, name, message, progress, status, scheduled_time,estimated_completion_time, estimated_remaining_time, progress_bar FROM mysql_task_management.task_status WHERE id=TaskID\G

    Replace TaskID with the displayed task ID.

    The output looks similar to the following:

                            id: 1
                          name: Vector Store Loader
                      message: Task starting.
                      progress: 0
                        status: RUNNING
                scheduled_time: 2024-07-02 14:42:38
    estimated_completion_time: 2024-07-22 10:19:53
      estimated_remaining_time: 52.50000
                  progress_bar: __________
  5. 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:

    |  To set up HeatWave AutoML in MySQL HeatWave, you need to follow these steps:
    
    1. Ensure that you have an operational MySQL DB System and are able to
    connect to it using a MySQL client. If not, complete the steps described
    in Getting Started with MySQL HeatWave.
    2. Ensure that your MySQL DB System has an operational HeatWave Cluster.
    If not, complete the steps described in Adding a HeatWave Cluster.
    3. Obtain the MySQL user privileges described in Section 3.2, Before You Begin.
    4. Prepare and load training and test data. See Section 3.4, Preparing Data.
    5. Train a machine learning model. See Section 3.5, Training a Model.
    6. Make predictions using the trained model. See Section 3.6, Making Predictions.
    7. Generate explanations for the predictions made by the model. See Section 
    3.7, Generating Explanations.
    8. Monitor and manage the performance of the model. See Section 3.8,
    Monitoring and Managing Performance. |

    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 database system, then delete the database system. For more information, see Deleting a DB System.

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