The GenAI feature of MySQL AI lets you communicate with unstructured data 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).
Using GenAI, you can perform natural-language searches in a single step using either in-database or external large language models (LLMs). All the elements that are necessary to use GenAI with proprietary data are integrated and optimized to work with each other.
This chapter assumes that you are familiar with MySQL.
Key Features
-
In-Database LLM
GenAI uses a large language model (LLM) to enable natural language communication in multiple languages. You can use the capabilities of the LLM to search data as well as generate or summarize content. However, as this LLM is trained on public data, the responses to your queries are generated based on information available in the public data sources. To produce more relevant results, you can use the LLM capabilities with the vector store functionality to perform a vector search with RAG.
-
In-Database Vector Store
GenAI provides an inbuilt vector store that you can use to store enterprise-specific proprietary content available in your local filesystem, and perform vector-based similarity search across documents. Queries that you ask are automatically encoded with the same embedding model as the vector store without requiring any additional inputs or running a separate service. The vector store also provides valuable context for the LLM for RAG use cases.
-
Retrieval-Augmented Generation
GenAI retrieves content from the vector store and provides it as context to the LLM along with the query. This process of generating an augmented prompt is called retrieval-augmented generation (RAG), and it helps GenAI produce more contextually relevant, personalized, and accurate results.
-
GenAI Chat
This is an inbuilt chatbot that extends the LLMs capabilities as well as vector store and RAG functionalities of GenAI to let you ask multiple follow-up questions about a topic in a single session. You can use GenAI Chat to build customized chat applications by specifying custom settings, prompt, chat history length, and number of citations to be used for generating a response.
GenAI Chat also provides a graphical interface integrated with the Visual Studio Code plugin for MySQL Shell.
-
Accelerated Vector-Based Query Processing
GenAI lets you run queries on tables that contain vector embeddings at an accelerated pace by offloading them to the MySQL AI Engine (AI engine). For more information, see About Accelerated Processing of Queries on Vector-Based Tables.
Benefits
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.
Some key benefits of using the GenAI feature of MySQL AI are:
The natural-language processing (NLP) capabilities of the LLMs let non-technical users have human-like conversations with the system in natural language.
The in-database integration of LLM and embedding generation eliminates the need for using external solutions, and ensures the security of the proprietary content.
The in-database integration of LLMs, vector store, and embedding generation simplifies complexity of applications that use these features.
Review the Supported Languages, Embedding Models, and LLMs.