7.9.1 Run Retrieval-Augmented Generation

The ML_RAG routine runs retrieval-augmented generation which aims to generate more accurate responses for your queries.

As of MySQL 9.5.0, you can use hybrid search, which combines semantic search and keyword-based search to effectively retrieve data that requires searching on specific keywords as well semantically similar segments.

As of MySQL 9.2.1, for context retrieval, the ML_RAG routine uses the name of the embedding model used to embed the input query to find relevant vector store tables that contain vector embeddings from the same embedding model.

In earlier versions of MySQL, for context retrieval, the ML_RAG routine uses the language specified for generating the output and the name of the embedding model used to embed the input query to find relevant vector store tables that contain information in the same language and vector embeddings from the same embedding model.

This topic contains the following sections:

Before You Begin

Retrieve Context and Generate Relevant Content

To enter a natural-language query, retrieve the context, and generate results using RAG, perform the following steps:

  1. To specify the table for retrieving the vector embeddings to use as context, set the @options variable:

    mysql> SET @options = JSON_OBJECT(
      "vector_store", JSON_ARRAY("DBName.VectorStoreTableName"), 
      "model_options", JSON_OBJECT("language", "Language")
    );

    Replace the following:

    • DBName: the name of the database that contains the vector store table.

    • VectorStoreTableName: the name of the vector store table.

    • Language: the two-letter ISO 639-1 code for the language you want to use. Default language is en, which is English. To view the list of supported languages, see Languages.

      The language parameter is supported as of MySQL 9.0.1-u1.

    For example:

    mysql> SET @options = JSON_OBJECT(
      "vector_store", JSON_ARRAY("demo_db.demo_embeddings"), 
      "model_options", JSON_OBJECT("language", "en")
    );

    To learn more about the available routine options, see ML_RAG Syntax.

  2. To define your natural-language query, set the @query variable:

    mysql> SET @query="AddYourQuery";

    Replace AddYourQuery with your natural-language query.

    For example:

    mysql> SET @query="What is AutoML?";
  3. To retrieve the augmented prompt, use the ML_RAG routine:

    mysql> CALL sys.ML_RAG(@query,@output,@options);
  4. Print the output:

    mysql> SELECT JSON_PRETTY(@output);

    Text-based content that is generated by the LLM in response to your query is printed as output. The output generated by RAG is comprised of the following parts:

    • The text section contains the text-based content generated by the LLM as a response for your query.

    • For some LLMs, the output might contain license information.

    • The citations section shows the segments and documents it referred to as context.

    The output looks similar to the following:

      | {
        "text": " AutoML is a machine learning technique that uses algorithms to automatically generate and optimize models for specific tasks, without the need for manual intervention. It combines the power of machine learning with the ease of use of traditional programming tools, allowing users to quickly and easily create accurate models for their data.",
        "license": "Your use of this Llama model is subject to the Llama 3.2 Community License Agreement available at https://docs.oracle.com/cd/E17952_01/heatwave-9.4-license-com-en/",
        "citations": [
          {
            "segment": "| {   \"text\": \" AutoML is a machine learning technique that uses algorithms to automatically generate and optimize models for specific tasks, without the need for manual intervention. It combines the power of machine learning with the ease of use of traditional programming tools, allowing users to quickly and easily create accurate models for their data.\",   \"citations\": [     {\n      \"segment\": \"What is MySQL?\",       \"distance\": 0.7121,       \"document_name\": \"\"     },\n    {",
            "distance": 0.0725,
            "document_name": "https://demo_namespace.objectstorage.demo_region.oci.customer-oci.com/p/demo_url/n/demo_namespace/b/demo_bucket/o/heatwave-en.pdf",
            "segment_number": 2278
          },
          {
            "segment": "| {   \"text\": \" AutoML is a machine learning technique that automates the process of selecting, training, and evaluating machine learning models. It involves using algorithms and techniques to automatically identify the best model for a given dataset and optimize its hyperparameters without requiring manual intervention from data analysts or ML practitioners. AutoML can be used in various stages of the machine learning pipeline, including data preprocessing, feature engineering, model",
            "distance": 0.0743,
            "document_name": "https://demo_namespace.objectstorage.demo_region.oci.customer-oci.com/p/demo_url/n/demo_namespace/b/demo_bucket/o/heatwave-en.pdf",
            "segment_number": 2386 
          },
          {
            "segment": "| {   \"text\": \" AutoML is a subfield of machine learning that focuses on automating the process of building and training machine learning models. It involves using algorithms and techniques to automatically select features, tune hyperparameters, and evaluate model performance, without requiring human intervention. AutoML can be used for a variety of tasks, including classification, regression, clustering, and anomaly detection.\",   \"citations\": [     {",
            "distance": 0.0762,
            "document_name": "https://demo_namespace.objectstorage.demo_region.oci.customer-oci.com/p/demo_url/n/demo_namespace/b/demo_bucket/o/heatwave-en.pdf",
            "segment_number": 2583
          }
        ],
        "vector_store": [
          "`demo_db`.`demo_embeddings`"
        ],
        "retrieval_info": {
          "method": "n_citations",
          "threshold": 0.0743
        }
      } |

    To continue running more queries in the same session, repeat steps 3 to 5.

Retrieve Context Without Generating Content

To enter a natural-language query and retrieve the context without generating a response for the query, perform the following steps:

  1. To specify the table for retrieving the vector embeddings and to skip generation of content, set the @options variable:

    mysql> SET @options = JSON_OBJECT("vector_store", JSON_ARRAY("DBName.VectorStoreTableName"), "skip_generate", true);

    Replace the following:

    • DBName: the name of the database that contains the vector store table.

    • VectorStoreTableName: the name of the vector store table.

    For example:

    mysql> SET @options = JSON_OBJECT("vector_store", JSON_ARRAY("demo_db.demo_embeddings"), "skip_generate", true);
  2. To define your natural-language query, set the @query variable:

    mysql> SET @query="AddYourQuery";

    Replace AddYourQuery with your natural-language query.

    For example:

    mysql> SET @query="What is AutoML?";
  3. To retrieve the augmented prompt, use the ML_RAG routine:

    mysql> CALL sys.ML_RAG(@query,@output,@options);
  4. Print the output:

    mysql> SELECT JSON_PRETTY(@output);

    Semantically similar text segments used as content for the query and the name of the documents they were found in are printed as output.

    The output looks similar to the following:

      | {
        "citations": [
          {
            "segment": "| {   \"text\": \" AutoML is a machine learning technique that uses algorithms to automatically generate and optimize models for specific tasks, without the need for manual intervention. It combines the power of machine learning with the ease of use of traditional programming tools, allowing users to quickly and easily create accurate models for their data.\",   \"citations\": [     {\n      \"segment\": \"What is MySQL?\",       \"distance\": 0.7121,       \"document_name\": \"\"     },\n    {",
            "distance": 0.0725,
            "document_name": "https://demo_namespace.objectstorage.demo_region.oci.customer-oci.com/p/demo_url/n/demo_namespace/b/demo_bucket/o/heatwave-en.pdf",
            "segment_number": 2278
          },
          {
            "segment": "| {   \"text\": \" AutoML is a machine learning technique that automates the process of selecting, training, and evaluating machine learning models. It involves using algorithms and techniques to automatically identify the best model for a given dataset and optimize its hyperparameters without requiring manual intervention from data analysts or ML practitioners. AutoML can be used in various stages of the machine learning pipeline, including data preprocessing, feature engineering, model",
            "distance": 0.0743,
            "document_name": "https://demo_namespace.objectstorage.demo_region.oci.customer-oci.com/p/demo_url/n/demo_namespace/b/demo_bucket/o/heatwave-en.pdf",
            "segment_number": 2386
          },
          {
            "segment": "| {   \"text\": \" AutoML is a subfield of machine learning that focuses on automating the process of building and training machine learning models. It involves using algorithms and techniques to automatically select features, tune hyperparameters, and evaluate model performance, without requiring human intervention. AutoML can be used for a variety of tasks, including classification, regression, clustering, and anomaly detection.\",   \"citations\": [     {",
            "distance": 0.0762,
            "document_name": "https://demo_namespace.objectstorage.demo_region.oci.customer-oci.com/p/demo_url/n/demo_namespace/b/demo_bucket/o/heatwave-en.pdf",
            "segment_number": 2583
          }
        ],
        "vector_store": [
          "`demo_db`.`demo_embeddings`"
        ],
        "retrieval_info": {
          "method": "n_citations",
          "threshold": 0.0743
        }
      } |

    To continue running more queries in the same session, repeat steps 3 to 5.

Retrieve Context and Generate Content Using Hybrid Search

As of MySQL 9.5.0, you can use both keyword-based search with vector-based semantic search, which helps improve the quality of search results and accuracy of the response generated for your query. However, vector store tables created using earlier versions of MySQL only support semantic search. To use hybrid or keyword search with vector store tables created in earlier versions of MySQL, you need to reload the tables.

To enter a natural-language query, retrieve the context, and enhance the accuracy of generated results using hybrid search, perform the following steps:

  1. To specify the table for retrieving the vector embeddings to use as context, set the @options variable:

    mysql> SET @options = JSON_OBJECT(
      "vector_store", JSON_ARRAY("DBName.VectorStoreTableName"), 
      "keyword_search", true
    );

    Replace the following:

    • DBName: the name of the database that contains the vector store table.

    • VectorStoreTableName: the name of the vector store table.

    For example:

    mysql> SET @options = JSON_OBJECT(
      "vector_store", JSON_ARRAY("demo_db.demo_embeddings"), 
      "keyword_search", true
    );

    To learn more about the available routine options, see ML_RAG Syntax.

  2. To define your natural-language query, set the @query variable:

    mysql> SET @query="AddYourQuery";

    Replace AddYourQuery with your natural-language query.

    For example:

    mysql> SET @query="What is AutoML?";
  3. To retrieve the augmented prompt, use the ML_RAG routine:

    mysql> CALL sys.ML_RAG(@query,@output,@options);
  4. Print the output:

    mysql> SELECT JSON_PRETTY(@output);

    Text-based content that is generated by the LLM in response to your query is printed as output. The output generated is comprised of the following parts:

    • The text section contains the text-based content generated by the LLM as a response for your query.

    • For some LLMs, the output might contain license information.

    • The citations section shows the segments and documents it referred to as context. Segments with a distance score are derived from semantic search, and segments with a bm25_score score are derived from keyword search.

    The output looks similar to the following:

    {
      "text": "AutoML stands for Automated Machine Learning. It's a subfield of machine learning that focuses on automating the process of building and training machine learning models, allowing users to select features, tune hyperparameters, and evaluate model performance without requiring human intervention.",
      "license": "Your use of this Llama model is subject to the Llama 3.2 Community License Agreement available at https://docs.oracle.com/cd/E17952_01/heatwave-9.4-license-com-en/",
      "citations": [
        {
          "segment": "\"segment\": \"| {   \\\"text\\\": \\\" AutoML is a subfield of machine learning that focuses on automating the process of building and training machine learning models. It involves using algorithms and techniques to automatically select features, tune hyperparameters, and evaluate model performance, without requiring human intervention. AutoML can be used for a variety of tasks, including classification, regression, clustering, and anomaly detection.\\\",   \\\"citations\\\": [     {\",",
          "distance": 0.0732,
          "document_name": "https://demo_namespace.objectstorage.demo_region.oci.customer-oci.com/p/demo_url/n/demo_namespace/b/demo_bucket/o/heatwave-en.pdf",
          "segment_number": 2278
        },
        {
          "segment": "}, {   \"segment\": \"| {   \\\"text\\\": \\\" AutoML is a subfield of machine learning that focuses on automating the process of building and training machine learning models. It involves using algorithms and techniques to automatically select features, tune hyperparameters, and evaluate model performance, without requiring human intervention. AutoML can be used for a variety of tasks, including classification, regression, clustering, and anomaly detection.\\\",   \\\"citations\\\": [     {\",   \"distance\":",
          "distance": 0.0738,
          "document_name": "https://demo_namespace.objectstorage.demo_region.oci.customer-oci.com/p/demo_url/n/demo_namespace/b/demo_bucket/o/heatwave-en.pdf",
          "segment_number": 2386
        },
        {
          "segment": "| {   \"text\": \" AutoML is a machine learning technique that automates the process of selecting, training, and evaluating machine learning models. It involves using algorithms and techniques to automatically identify the best model for a given dataset and optimize its hyperparameters without requiring manual intervention from data analysts or ML practitioners. AutoML can be used in various stages of the machine learning pipeline, including data preprocessing, feature engineering, model",
          "distance": 0.0743,
          "document_name": "https://demo_namespace.objectstorage.demo_region.oci.customer-oci.com/p/demo_url/n/demo_namespace/b/demo_bucket/o/heatwave-en.pdf",
          "segment_number": 2583
        },
        {
          "segment": "7.2 HeatWave AutoML Monitoring You can monitor HeatWave AutoML status by querying the rapid_ml_status variable or by querying the ML_STATUS column of the performance_schema.rpd_nodes table.\n• Querying the rapid_ml_status variable:\nThe rapid_ml_status variable provides the status of HeatWave AutoML. Possible values are ON and OFF.\n• ON: HeatWave AutoML is up and running.\n• OFF: HeatWave AutoML is down.",
          "bm25_score": 15.8061,
          "document_name": "https://demo_namespace.objectstorage.demo_region.oci.customer-oci.com/p/demo_url/n/demo_namespace/b/demo_bucket/o/heatwave-en.pdf",
          "segment_number": 3285
        },
        {
          "segment": "| rapid_ml_status | ON             |\n+-----------------+----------------+\n• Querying the ML_STATUS column of the performance_schema.rpd_nodes table.\nThe HeatWave plugin writes HeatWave AutoML status information to the ML_STATUS column of performance_schema.rpd_nodes table after each ML query. Possible values include:\n• UNAVAIL_MLSTATE: HeatWave AutoML is not available.\n• AVAIL_MLSTATE: HeatWave AutoML is available.\n• DOWN_MLSTATE: HeatWave AutoML is down.",
          "bm25_score": 15.3699,
          "document_name": "https://demo_namespace.objectstorage.demo_region.oci.customer-oci.com/p/demo_url/n/demo_namespace/b/demo_bucket/o/heatwave-en.pdf",
          "segment_number": 3288
        },
        {
          "segment": "3.1.3 HeatWave AutoML Workflow .......................................................................................... 141\n3.1.4 Oracle AutoML ............................................................................................................... 142\n3.2 HeatWave AutoML Prerequisites ............................................................................................... 143",
          "bm25_score": 15.0427,
          "document_name": "https://demo_namespace.objectstorage.demo_region.oci.customer-oci.com/p/demo_url/n/demo_namespace/b/demo_bucket/o/heatwave-en.pdf",
          "segment_number": 942
        }
      ],
      "vector_store": [
        "`demo_db`.`demo_embeddings`"
      ],
      "retrieval_info": null
    } |

    To continue running more queries in the same session, repeat steps 3 to 5.

Run Batch Queries

To run multiple RAG queries in parallel, use the ML_RAG_TABLE routine. This method is faster than running the ML_RAG routine multiple times.

In versions older than MySQL 9.2.1, to alter an existing table or create a new table, MySQL requires you to set the sql-require-primary-key system variable to 0.

The ML_RAG_TABLE routine is available in MySQL 9.0.1-u1.

To run the steps in this section, create a new table input_table in demo_db:

mysql> USE demo_db;
mysql> CREATE TABLE input_table (id INT AUTO_INCREMENT, Input TEXT, primary key (id));
mysql> INSERT INTO input_table (Input) VALUES('What is HeatWave Lakehouse?');
mysql> INSERT INTO input_table (Input) VALUES('What is HeatWave AutoML?');
mysql> INSERT INTO input_table (Input) VALUES('What is HeatWave GenAI?');

To run batch queries using ML_RAG_TABLE, perform the following steps:

  1. To specify the table for retrieving the vector embeddings to use as context, set the @options variable:

    mysql> SET @options = JSON_OBJECT(
      "vector_store", JSON_ARRAY("DBName.VectorStoreTableName"), 
      "model_options", JSON_OBJECT("language", "Language")
    );

    Replace the following:

    • DBName: the name of the database that contains the vector store table.

    • VectorStoreTableName: the name of the vector store table.

    • Language: the two-letter ISO 639-1 code for the language you want to use. Default language is en, which is English. To view the list of supported languages, see Languages.

    For example:

    mysql> SET @options = JSON_OBJECT(
      "vector_store", JSON_ARRAY("demo_db.demo_embeddings"), 
      "model_options", JSON_OBJECT("language", "en")
    );

    To learn more about the available routine options, see ML_RAG_TABLE Syntax.

  2. In the ML_RAG_TABLE routine, specify the table columns containing the input queries and for storing the generated outputs:

    mysql> CALL sys.ML_RAG_TABLE("InputDBName.InputTableName.InputColumn", "OutputDBName.OutputTableName.OutputColumn", @options);

    Replace the following:

    • InputDBName: the name of the database that contains the table column where your input queries are stored.

    • InputTableName: the name of the table that contains the column where your input queries are stored.

    • InputColumn: the name of the column that contains input queries.

    • OutputDBName: the name of the database that contains the table where you want to store the generated outputs. This can be the same as the input database.

    • OutputTableName: the name of the table where you want to create a new column to store the generated outputs. This can be the same as the input table. If the specified table doesn't exist, a new table is created.

    • OutputColumn: the name for the new column where you want to store the output generated for the input queries.

    For example:

    mysql> CALL sys.ML_RAG_TABLE("demo_db.input_table.Input", "demo_db.output_table.Output", @options);
  3. View the contents of the output table:

    mysql> SELECT * FROM output_table\G
    *************************** 1. row ***************************
        id: 1
    Output: {
        "text": "HeatWave Lakehouse is a feature of the HeatWave platform that enables query processing on data resident in Object Storage. It allows you to create tables which point to external data sources and provides rapid in-memory query processing.",
        "error": null,
        "license": "Your use of this Llama model is subject to the Llama 3.2 Community License Agreement available at https://docs.oracle.com/cd/E17952_01/heatwave-9.4-license-com-en/",
        "citations": [
            {
                "segment": "-----------------------+ |  1 | {\"text\": \" HeatWave Lakehouse is a feature of the HeatWave platform that enables query processing on data resident in Object Storage. The source data is read from Object Storage, transformed to the memory optimized HeatWave format, stored in the HeatWave persistence storage layer in Object Storage, and then loaded to HeatWave cluster memory for in-memory query processing. It allows you to create tables which point to external data sources and provides rapid and lakehouse as the primary",
                "distance": 0.0828,
                "document_name": "https://demo_namespace.objectstorage.demo_region.oci.customer-oci.com/p/demo_url/n/demo_namespace/b/demo_bucket/o/heatwave-en.pdf",
                "segment_number": 2308
            },
            {
                "segment": "------------------------------------------+ |  1 | {\"text\": \" HeatWave Lakehouse is a feature of the HeatWave platform that enables query processing on data resident in Object Storage. The source data is read from Object Storage, transformed to the memory optimized HeatWave format, stored in the HeatWave persistence storage layer in Object Storage, and then loaded to HeatWave cluster memory for in-memory query processing. It allows you to create tables which point to external data sources and provides rapid and lakehouse as the primary",
                "distance": 0.0863,
                "document_name": "https://demo_namespace.objectstorage.demo_region.oci.customer-oci.com/p/demo_url/n/demo_namespace/b/demo_bucket/o/heatwave-en.pdf",
                "segment_number": 2415
            },
            {
                "segment": "The Lakehouse feature of HeatWave enables query processing on data in Object Storage. HeatWave Lakehouse reads the source data from Object Storage, transforms it to the memory optimized HeatWave format, saves it in the HeatWave persistence storage layer in Object Storage, and then loads the data to HeatWave Cluster memory. While Lakehouse provides in-memory query processing on data in Object Storage, it does not load data into a DB System table.",
                "distance": 0.1028,
                "document_name": "https://demo_namespace.objectstorage.demo_region.oci.customer-oci.com/p/demo_url/n/demo_namespace/b/demo_bucket/o/heatwave-en.pdf",
                "segment_number": 2799
            }
        ],
        "vector_store": [
            "`demo_db`.`demo_embeddings`"
        ],
        "retrieval_info": {
            "method": "n_citations",
            "threshold": 0.1028
        }
    }
    *************************** 2. row ***************************
        id: 2
    Output: {
        "text": "HeatWave AutoML is a feature of MySQL HeatWave that simplifies the use of machine learning, allowing users to create optimized machine learning models for prediction and explanation without having to leave the platform. It analyzes data characteristics and creates models that can be used on the same server as the data, saving time and effort while keeping data and models secure.",
        "error": null,
        "citations": [
            {
                "segment": "|  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",
                "distance": 0.0561,
                "document_name": "https://demo_namespace.objectstorage.demo_region.oci.customer-oci.com/p/demo_url/n/demo_namespace/b/demo_bucket/o/heatwave-en.pdf",
                "segment_number": 2069
            },
            {
                "segment": "HeatWave shapes and scaling, and all HeatWave AutoML makes it easy to use machine learning, whether you are a novice user or an experienced ML practitioner. You provide the data, and HeatWave AutoML analyzes the characteristics of the data and creates an optimized machine learning model that you can use to generate predictions and explanations. An ML model makes predictions by identifying patterns in your data and applying those patterns to unseen data. HeatWave AutoML explanations help you",
                "distance": 0.0573,
                "document_name": "https://demo_namespace.objectstorage.demo_region.oci.customer-oci.com/p/demo_url/n/demo_namespace/b/demo_bucket/o/heatwave-en.pdf",
                "segment_number": 2420
            },
            {
                "segment": "HeatWave AutoML makes it easy to use machine learning, whether you are a novice user or an experienced ML practitioner. You provide the data, and HeatWave AutoML analyzes the characteristics of the data and creates an optimized machine learning model that you can use to generate predictions and explanations. An ML model makes predictions by identifying patterns in your data and applying those patterns to unseen data. HeatWave AutoML explanations help you understand how predictions are made,",
                "distance": 0.0598,
                "document_name": "https://demo_namespace.objectstorage.demo_region.oci.customer-oci.com/p/demo_url/n/demo_namespace/b/demo_bucket/o/heatwave-en.pdf",
                "segment_number": 967
            }
        ],
        "vector_store": [
            "`demo_db`.`demo_embeddings`"
        ],
        "retrieval_info": {
            "method": "n_citations",
            "threshold": 0.0598
        }
    }
    *************************** 3. row ***************************
        id: 3
    Output: {
        "text": "HeatWave GenAI is a feature of HeatWave that allows communication with unstructured data using natural-language queries, utilizing large language models (LLMs) and an inbuilt vector store for enterprise-specific content search. It also includes HeatWave Chat, a chatbot that extends generative AI and vector search capabilities.",
        "error": null,
        "citations": [
            {
                "segment": "4.1 HeatWave GenAI Overview HeatWave GenAI is a feature of HeatWave that lets you communicate with unstructured data in HeatWave using natural-language queries. It uses a familiar SQL interface which makes it is easy to use for content generation, summarization, and retrieval-augmented generation (RAG).",
                "distance": 0.0521,
                "document_name": "https://demo_namespace.objectstorage.demo_region.oci.customer-oci.com/p/demo_url/n/demo_namespace/b/demo_bucket/o/heatwave-en.pdf",
                "segment_number": 2008
            },
            {
                "segment": "Chapter 3, HeatWave AutoML. 1.4 HeatWave GenAI The HeatWave GenAI feature of HeatWave lets you communicate with unstructured data in HeatWave using natural language queries. It uses large language models (LLMs) to enable natural language communication and provides an inbuilt vector store that you can use to store enterprise-specific proprietary content to perform vector searches. HeatWave GenAI also includes HeatWave Chat which is a chatbot that extends the generative AI and vector search functionalities to let you ask multiple follow-up",
                "distance": 0.0735,
                "document_name": "https://demo_namespace.objectstorage.demo_region.oci.customer-oci.com/p/demo_url/n/demo_namespace/b/demo_bucket/o/heatwave-en.pdf",
                "segment_number": 125
            },
            {
                "segment": "HeatWave Chat also provides a graphical interface integrated with the Visual Studio Code plugin for MySQL Shell.\nBenefits\nHeatWave GenAI lets you integrate generative AI into the applications, providing an integrated end-to-end pipeline including vector store generation, vector search with RAG, and an inbuilt chatbot.\nSome key benefits of using HeatWave GenAI are described below:",
                "distance": 0.0781,
                "document_name": "https://demo_namespace.objectstorage.demo_region.oci.customer-oci.com/p/demo_url/n/demo_namespace/b/demo_bucket/o/heatwave-en.pdf",
                "segment_number": 2014
            }
        ],
        "vector_store": [
            "`demo_db`.`demo_embeddings`"
        ],
        "retrieval_info": {
            "method": "n_citations",
            "threshold": 0.0781
        }
    }

    As of MySQL 9.3.0, the output table generated using the ML_RAG_TABLE routine contains an additional details for error reporting. In case the routine fails to generate output for specific rows, details of the errors encountered and default values used are added for the rows in the output column.

Clean Up

If you created a new database for testing the steps in this topic, ensure that you delete the database to avoid being billed for it:

mysql> DROP DATABASE demo_db;