PolarDB for AI
PolarDB for AI is a distributed machine learning component of PolarDB for MySQL that comes with built-in AI models. You can use SQL statements to call built-in AI models to complete complex analysis tasks without the need to synchronize data from PolarDB to other AI platforms. PolarDB for AI also supports building custom models and loading external models by using SQL statements.
With PolarDB for AI, you can:
|
You can use built-in Qwen foundation models to run inference on and interact with data in PolarDB. Choose a model based on your scenario.
|
|||||
|
Generate SQL from natural language (NL2SQL) You can call the built-in NL2SQL model by using SQL statements to convert natural language into SQL statements.
Output: SELECT s.student_name, COUNT(sc.id) AS leave_count FROM students s JOIN student_courses sc ON s.id = sc.student_id WHERE sc.status = 0 GROUP BY s.student_name ORDER BY leave_count DESC LIMIT 2; |
|||||
|
Build a knowledge-based Q&A system (RAG application) You can vectorize data in PolarDB and call the built-in RAG model by using SQL statements to retrieve relevant documents or information snippets from a knowledge base. This improves response accuracy and overcomes the limitations of large language models in customer service or Q&A scenarios. In the DMS SQL query console, select the View Vectors and Tokens… tab and run |
|||||
Benefits
End-to-end data intelligence: Provides full lifecycle management from model creation and evaluation to inference, eliminating the issues caused by moving data across systems.
MySQL-compatible syntax: Use familiar SQL for machine learning MLOps operations with a minimal learning curve.
Built-in algorithm library: Includes machine learning and AI algorithms for classification, regression, clustering, and more.
Data protection: All data processing and model operations are performed within the database to ensure end-to-end security.
Scope of application
Your cluster must meet the following requirements:
-
Edition is Enterprise Edition and Series is Cluster Edition.
-
Engine version is MySQL 8.0.1 or later.
-
PolarProxy version is 2.7.5 or later.
For information about how to view or upgrade the Engine version and PolarProxy version, see Minor version management.
Billing
To use PolarDB for AI, you must create an AI node. The feature itself is free of charge, but you are billed for the AI node. AI nodes are billed at the same rates as standard compute nodes.
In addition to standard compute node specifications, AI nodes support two GPU specifications that are mainly used for model creation and inference.
-
8 cores, 30 GB + one GU30 (polar.mysql.g8.2xlarge.gpu)
-
16 cores, 125 GB + one GU100 (polar.mysql.x8.2xlarge.gpu)
For compute node billing rules, see Compute nodes.
Get started
-
Add an AI node and configure a database account for the AI node: Enable the PolarDB for AI feature
If you already added an AI node when purchasing the cluster, you can directly configure a database account for the AI node.
-
Connect to the PolarDB cluster by using a cluster endpoint: Connect to PolarDB for AI
-
Explore the built-in models:
-
Advanced usage:
For more information about model usage, see Model workflow and instructions.