Dataset
Datasets (formerly Data Connections) are the unified entry point for Alibaba Cloud Model Studio RAG to manage external data sources. By creating a dataset, applications can securely access data in enterprise databases, document systems, and object storage, and query and reference the data in real time during conversations.
NoteThis page describes RAG datasets (formerly Data Connections). The new Connector for agent scenarios is now available, supporting more connectable systems and MCP-based invocation by agents. Migrate legacy data connections before September 30, 2026 by following Data connection migration.
Datasets are the unified entry point for RAG to manage external data sources. When you create a dataset, you select a dataset type based on the data source. Applications can then securely access data in enterprise databases, document systems, and object storage, and query and reference the data in real time during conversations.
Dataset types
Datasets fall into two main categories based on how data is stored and accessed — platform-hosted and stream processing — with three dataset types in total:
Format | Dataset type | Storage | Scenarios |
|---|---|---|---|
Platform-hosted | File | Alibaba Cloud Model Studio or your own OSS | Upload and manage unstructured documents (PDF, Word, Markdown, etc.), with support for local upload and continuous synchronization from external sources such as Lark, DingTalk, SharePoint, Yuque, and OSS |
Table | Alibaba Cloud Model Studio or your own OSS | Import and query structured tabular data, such as CSV and Excel. | |
Stream processing | Database | Data remains in the source database for real-time access. | Connect to MySQL, PostgreSQL, or PolarDB-X 2.0 databases and execute SQL queries (supported only for data sources imported with DMS). |
NoteYuque, OSS, DingTalk, Lark, and SharePoint are not created as standalone dataset types. They serve only as import and synchronization sources for file datasets. For details, see Data synchronization rules below.
Prerequisites
Before you create a dataset, ensure you meet the following prerequisites:
-
Account permissions: You must use a root user or a RAM user with permissions to manage datasets. A root user must authorize a RAM user before they can use the dataset feature. For details, see Permission Management.
-
Data source preparation:
- File/Table dataset: You must have documents or spreadsheets ready for upload, or have an existing OSS Bucket.
- MySQL database: You must have a MySQL database instance (Alibaba Cloud RDS or self-managed). Ensure the instance is accessible via a public or private network.
- PostgreSQL database: You must have a PostgreSQL database instance with its
wal_levelparameter set tological. - PolarDB-X 2.0 database: You must have an Alibaba Cloud PolarDB-X 2.0 instance in a region that supports private network access. If you plan to import the data source using DMS, you must first register the PolarDB-X instance in DMS.
- Yuque sync source: You must have a Yuque Knowledge Base and a Personal Access Token. Only the public version of Yuque is supported.
- OSS sync source: You must have an OSS Bucket and have activated Alibaba Cloud Vector Search.
Create a dataset
-
Go to the Dataset page and click Create in the upper-right corner.
-
Enter a dataset name (up to 20 characters) and a description (up to 200 characters). The description guides how accurately agents call the dataset, so include the data content and purpose.
-
Select a dataset type (File, Table, or Database), and then configure the settings for that type:
File
A file dataset is used to manage unstructured documents (such as PDF and Word) and supports local upload and continuous synchronization from external sources such as Lark, DingTalk, SharePoint, Yuque, and OSS.
-
Select File for the dataset type.
-
Select a storage location:
-
Use Platform Storage: Data is stored in the storage space provided by Alibaba Cloud Model Studio. This option offers a limited-time free quota of up to 200,000 files and 1 TB of storage.
-
Use Your Own OSS Storage: Data is stored in your own OSS bucket. This option is suitable for large-scale data storage.
Note
- If you are using this option for the first time, follow the on-screen instructions to complete the authorization.
- The target bucket must have the
bailian-connector-accesstag with the valueReadAndWriteto allow access from Alibaba Cloud Model Studio. Add tag
-
Table
A table dataset is used to manage structured data, such as CSV and Excel files.
-
Select Table for the dataset type.
-
Select a storage location:
-
Use Platform Storage: Data is stored in the storage space provided by Alibaba Cloud Model Studio. This option provides a 1 TB free quota. After the quota is used up, billing automatically switches to pay-as-you-go. This option is suitable for small-scale data storage.
-
Use Your Own OSS Storage: Data is stored in your own OSS bucket. This option is suitable for large-scale data storage.
Note
- If you are using this option for the first time, follow the on-screen instructions to complete the authorization.
- The target bucket must have the
bailian-connector-accesstag with the valueReadAndWriteto allow access from Alibaba Cloud Model Studio. Add tag
-
MySQL
A MySQL database dataset is a stream processing dataset. It connects to a MySQL database, allowing applications to execute SQL queries and retrieve real-time data.
NoteOnly MySQL datasets created using the import from DMS data source method support SQL query execution; those created with the create custom data source method do not.
-
Select Database for the dataset type, and select MySQL for the database type.
-
Configure Data Source Information:
-
Create custom data source: Manually configure the connection to an Alibaba Cloud RDS for MySQL instance or a self-managed MySQL database. You can connect over a public or private network.
- Alibaba Cloud RDS for MySQL: Authorize access by using a Service-Linked Role (SLR) to associate the dataset with a MySQL database in Alibaba Cloud RDS. After you select this option, the database address and port are automatically populated based on the instance ID.
- Self-managed MySQL: Manually configure the connection details for a remote self-managed MySQL database. You must enter the database address and port.
-
Import from DMS data source: Quickly import a data source that is already configured in Data Management Service (DMS). The first time you use this option, you must complete the SLR authorization for the EventBridge, RDS, and DMS service management roles.
-
-
Select network type:
-
Public network (Default): Connect to the database over the public network. When you select this option, you must add the specified IP address range to the allowlist of your database instance.
-
Private network: Connect to the database over an internal network. You must also select the region. This option is recommended for production environments because it provides a more stable and secure connection.
-
Enter database connection information:
Parameter
Description
Database instance
Displayed only for Alibaba Cloud RDS for MySQL. Enter the RDS instance ID, for example,
rm-******adq7.Database address
For Alibaba Cloud RDS for MySQL, this parameter is automatically populated and the input is disabled. For self-managed MySQL, you must enter it manually.
Database port
For Alibaba Cloud RDS for MySQL, this parameter is automatically populated with 3306 and the input is disabled. For self-managed MySQL, you must enter it manually.
Database username
Required. Enter the username for the database connection.
Database password
Required. Enter the database password. The corresponding user must have read permissions on the database.
-
(Optional) Click Start Test to verify the database connectivity.
The system uses EventBridge to test connectivity, and the test is free of charge. After the test is successful, you can select the target database from the Select DB drop-down list.
-
NoteAfter a dataset is created, its database connection information, including the database password, cannot be modified. If you change the database password in the RDS console, the password saved in the dataset becomes invalid, data synchronization stops due to an authentication failure, and the knowledge base data is no longer updated. In this case, delete the original dataset and create a new one with the new password. Because a knowledge base cannot change its associated dataset, you must also re-create the associated knowledge base.
PostgreSQL
A PostgreSQL database dataset supports connections to Alibaba Cloud RDS for PostgreSQL instances and self-managed PostgreSQL databases.
PrerequisitesNoteOnly PostgreSQL datasets created using the import from DMS data source method support SQL query execution; those created with the create custom data source method do not.
-
The database account must have high-level permissions (Superuser or REPLICATION permissions).
-
The instance system parameter
wal_levelmust be set tological(the default is 'replica'). -
(For self-managed instances only) You have configured the
listen_addressesparameter to allow access from the 100.64.0.0/16 CIDR block. To do this:- Edit the configuration file:
sudo vim /etc/postgresql/[version]/main/pg_hba.conf - Add the following rule to the top of the file:
host [database_name] [username] 100.64.0.0/16 md5 - Reload the configuration:
sudo systemctl reload postgresql
- Edit the configuration file:
-
Select Database for the dataset type, and select PostgreSQL for the database type.
-
Configure database connection:
- Host Address: The connection address (public or private) of the database instance.
- Port: The default is 5432.
- Database Name (dbName): Required. Specify the database to connect to.
- Username: A database account with high-level permissions.
- Password: The database password.
-
Click Test Connectivity to ensure the configuration is correct. The PostgreSQL dataset uses Data Transmission Service (DTS) to test connectivity.
Comparison between MySQL and PostgreSQL datasets:
Difference
MySQL
PostgreSQL
Default port
3306
5432
Additional required fields
None
Requires dbName (database name)
Connectivity test service
EventBridge
Data Transmission Service (DTS)
Special configuration requirements
None
Requires setting the instance system parameter
wal_leveltologicalPolarDB-X 2.0
A PolarDB-X 2.0 database dataset is a stream processing dataset. It connects to an Alibaba Cloud PolarDB-X 2.0 distributed database, allowing applications to execute SQL queries and retrieve real-time data.
NoteOnly PolarDB-X 2.0 datasets created using the import from DMS data source method support SQL query execution; those created with the create custom data source method do not.
-
Select Database for the dataset type, and select PolarDB-X 2.0 for the database type.
-
Configure Data Source Information:
-
Create custom data source: Authorize access using a Service-Linked Role (SLR) to associate the dataset with an Alibaba Cloud PolarDB-X 2.0 database. The database address and port are automatically populated based on the selected instance and cannot be manually entered.
The first time you use this option, you must authorize two Service-Linked Roles in the pop-up window: the DTS service management role (
AliyunServiceRoleForSFMConnectorAccessDTS) and the PolarDB-X service management role (AliyunServiceRoleForSFMAccessPolarDBX). -
Import from DMS data source: Quickly import a PolarDB-X data source that is already configured in Data Management Service (DMS). The first time you use this option, you must complete the SLR authorizations for the DMS, DTS, and PolarDB-X service management roles.
-
-
Select network type: Only private network is supported. You must select a region to connect to the PolarDB-X instance over an internal network. This option is suitable for production environments.
-
Enter database connection information:
Parameter
Description
Database instance
Displayed only for the create custom data source method. From the drop-down list, select a PolarDB-X 2.0 instance under the current account in the selected region.
Select Data Source
Displayed only for the import from DMS data source method. From the list of DMS data sources, select one PolarDB-X data source. DMS ensures the connectivity of the data source.
Database address
This field is automatically populated based on the selected instance and input is disabled when using the create custom data source method. When using the import from DMS data source method, you must manually enter or confirm the address.
Database port
This field is automatically populated based on the selected instance and input is disabled when using the create custom data source method. When using the import from DMS data source method, you must manually enter or confirm the port.
Database username
Required. Enter the username for the database connection.
Database password
Required. Enter the database password. The corresponding user must have read permissions on the database.
-
(Optional) Click Start Test to verify the database connectivity. After the test is successful, you can select the target database from the Select DB drop-down list.
Key differences from the MySQL dataset:
- Network type: Only private network connections are supported.
- Data source: Supports only Alibaba Cloud PolarDB-X 2.0 instances, not self-managed databases.
- SLR Authorization: The first time you use this dataset, you must explicitly authorize the DTS and PolarDB-X service management roles (and the DMS role if using the DMS method) in the pop-up window.
-
-
Click Confirm to complete the creation.
Import data
Import files
Click Details on the file dataset card to open the file management page.
-
In the Category pane on the left, select an existing category or click the + icon to create a new one.
Alibaba Cloud Model Studio manages imported files by category.
NoteEach workspace supports a maximum of 500 categories. To request a higher category limit, submit a ticket.
-
Click Import Data to open the Import Data page. For the import method, select Upload Local File.
The platform does not support importing JSON, CSV, or YAML files directly. Convert them to XLSX or XLS format before importing.
-
For Parsing Method, select Default Settings or Custom Settings. (Custom Settings lets you configure parsing rules for different formats to improve parsing results).
Parsing method details
Configure the parsing strategy based on your needs. If you are unsure, use the default settings. For details on Intelligent Document Parsing, LLM Parsing, and Digital Parsing, see document understanding.
The available parsing methods depend on the selected file type (document, image, audio, and video).
-
Digital Parsing: Cannot parse illustrations and charts in files.
-
Intelligent document parsing: The parser identifies and extracts text from illustrations and then generates text summaries. These summaries, along with other non-image content, are chunked, converted into vectors, and used for knowledge base retrieval.
-
Large model document parsing: Enables agents that use a model from Select Model to answer questions about illustrations and charts in a file. Select LLM Parsing to recognize and understand this type of content.
-
Qwen-VL parsing: Supports only image formats. You can select a Qwen-VL model and use a prompt to specify the layout, elements, and content for recognition. Its other features are the same as those of large model document parsing.
-
Audio/video parsing: Performs speech recognition, video frame extraction (for videos only), and plot analysis (for videos only) on the file, then structurally aligns all audio and visual information on a timeline.
- Speech recognition: The subtitle content parser uses Speech File Transcription to convert human speech into text. It cannot recognize music or environmental sounds, such as horns, bells, or thunder.
- Video frame extraction: Extracts representative visual frames from the original video and generates corresponding text descriptions.
- Plot analysis (must be enabled manually): Analyzes video content to identify specific events, marks them with timestamps, and generates corresponding text descriptions.
-
-
(Optional) Configure Tags for the file.
When you call an application by using an API, you can specify tags in the
tagsrequest parameter. When searching the knowledge base, the application first filters relevant files based on the tags to improve retrieval efficiency. For an agent application (Agent 1.0), you can set tags in the console when you debug the knowledge base. -
Click Confirm. The system starts parsing and importing the file. You can track the task progress on the page.
The file will be converted into a format that Alibaba Cloud Model Studio can process. Processing may take several hours during peak times. Please be patient.
During peak traffic or high concurrency, file parsing may take longer due to resource queuing, and occasional parsing timeouts may occur. Please wait patiently or try again later.
-
After the import is complete, click Details next to the file to view it.
Once imported into Alibaba Cloud Model Studio, files are stored as independent copies, unlinked from the original data, in the free storage space provided by the platform. This space currently has no capacity limit.
You can only view files imported within the last 90 days. Files older than this period cannot be viewed, but they will not be deleted.
Imported files can be used only by users in the current workspace. Alibaba Cloud Bailian will not use the files for any commercial purposes or disclose them publicly.
Import tables
Click Details on the table dataset card to open the data management page.
Under data table management on the left, select an existing data table or click the + icon to create a new one.
Alibaba Cloud Model Studio uses data tables to manage imported data.
New data table
-
Enter a Table Name. Then, configure the data table by selecting either Upload excel directly or Custom Header.
-
Upload excel directly: Alibaba Cloud Model Studio automatically detects the table header in your uploaded file to create the data table structure. Alibaba Cloud Model Studio then imports the remaining content as data records.
-
Custom table header: The Column Name and Type parameters are required, while the Description parameter is optional.
Important
-
The structure of a data table, including its column names, description, and type, cannot be modified after creation.
-
The structure of the uploaded file must exactly match the structure of the target data table, including the number of columns and column names, or the import will fail. For example, if the target data table has two columns, you must configure two fields with matching column names. You can add or remove fields by clicking Add field or Delete in the Actions column.
-
To help the model understand the meaning of each field (for example, that
ageindicates age), provide a clear natural language description in the Description field. -
If a field type is set to
image_url, ensure the link is a publicly accessible image URL. The knowledge base uses this link to fetch the image and generate a vector index for it, to support scenarios such as image search.Example
image_urlformat:https://example.com/downloads/pic.jpgWhen you create a knowledge base, fields of the
image_urltype are used to generate an image index. Alibaba Cloud Model Studio accesses the target image, extracts its features, and then converts them into a vector using image embedding and stores it. When a user searches the knowledge base, this vector is compared with the vector of their uploaded image to determine similarity.
-
-
-
Click the Upload icon to select and upload a file in XLSX or XLS format.
The file must contain a table header, or the import will fail.
The platform does not currently support the direct import of JSON, CSV, or YAML files. Please use an appropriate tool to convert them to XLSX or XLS format before importing.
-
Click OK to begin the import. After the import is complete, the new data table appears in the Table navigation tree on the left.
Existing data table
-
In the Table list on the left, select the target data table, and then click Import Data.
-
For the import type, select either Upload and Overwrite or Incremental Upload.
Click Download Template to obtain a blank file that contains only the table header. You can add new data directly to this file and then use it for an overwrite or incremental upload.
-
Click the Upload icon to select and upload a file in XLSX or XLS format.
The file must contain a table header, and its structure must match that of the current data table, or the import will fail.
The platform does not support importing JSON, CSV, or YAML files directly. Please convert them to XLSX or XLS format using a suitable tool before importing.
Import files from OSS
-
File dataset or table dataset: Click Details on the card to open the file or table management page.
-
In the Category pane on the left, select an existing category or click the + icon to create a new one.
Model Studio (Bailian) uses categories to manage imported files.
NoteEach workspace supports a maximum of 500 categories. To request a higher category limit, submit a ticket.
-
Click Import Data to open the Import Data page. For Import Method, select OSS.
When you import data from OSS into Model Studio (Bailian) for the first time, you must follow the on-screen instructions to grant the required permissions. Also, add the
bailian-datahub-accesstag to the target bucket to grant access to Model Studio (Bailian).Buckets that use the Archive, Cold Archive, or Deep Cold Archive storage classes are not supported.
Model Studio (Bailian) cannot access files in the root directory of a bucket. Select an existing subdirectory or create a new one for Model Studio (Bailian) to access.
Buckets with content encryption enabled are supported. Private buckets are supported.
If you use a bucket with Referer-based hotlink protection enabled, you must add the
*.console.aliyun.comdomain to the Referer allowlist. For more information, see Hotlink Protection. -
For Parsing Method, select Default Settings or Custom Settings. With Custom Settings, you can configure parsing rules for different formats to improve parsing performance.
Parsing methods
Configure the parsing strategy based on your needs. If you are unsure, we recommend using the default settings. For detailed information about Intelligent Document Parsing, LLM Parsing, and Digital Parsing, see document understanding.
-
Digital Parsing: This method does not parse illustrations or charts in files.
-
Intelligent Document Parsing: The parser identifies and extracts text from illustrations in a file and then generates text summaries. These summaries, along with other non-image content, are chunked and converted into vectors for knowledge base retrieval.
-
Large model document parsing: Applications that use the model specified in Select Model allow users to ask questions about the content of illustrations and charts in files. To recognize and understand illustrations and charts in files, select LLM Parsing.
-
Qwen-VL Parsing: Supports only image formats. You can select a Qwen-VL model and use a prompt to specify the layout, elements, and content for the model to recognize. In other respects, it is the same as large model-based document parsing.
-
Audio and Video Parsing: Performs speech recognition, video frame extraction (for videos only), and scene analysis (for videos only) on the file, and then aligns all audio and visual information structurally on a timeline.
- Speech Recognition: The parser uses Speech File Transcription to convert human speech into text. It does not currently support the recognition of music or environmental sounds, such as horns, bells, or thunder.
- Video Frame Extraction: Extracts representative visual frames from the original video and generates corresponding text descriptions.
- Scene Analysis (must be enabled manually): Analyzes the video content to identify specific events, marks them with timestamps, and generates corresponding text descriptions.
-
-
(Optional) Configure Tags for the file.
When you call an application by using an API, you can specify tags in the
tagsrequest parameter. The application then filters files by these tags during knowledge base searches, improving retrieval efficiency. For an agent application (Agent 1.0), you can set tags when you edit the application in the console (by enabling Knowledge Base>Advanced ConfigurationFilter by Tag). -
Click Confirm. The system begins to parse and import the files. You can monitor the progress on the page.
The files are converted into a format that Model Studio (Bailian) can process. This process might take several hours during peak times, so please be patient.
-
After the import is complete, click Details next to a file to view its contents.
After a file is imported, Model Studio (Bailian) stores it as a standalone copy unlinked from the original data. The platform saves this copy in free storage space, which currently has no capacity limit.
Imported files are accessible only to users within the current workspace. Model Studio (Bailian) does not use your data for any commercial purposes or make it publicly available.
-
Import RDS MySQL data
Important
- Before you create a data source, you must enable the EventBridge service.
- Model Studio (Bailian) and the RDS instance must belong to the same Alibaba Cloud account. Otherwise, follow the steps in Import data from a self-managed MySQL database.
- When importing a large table (over 1,000,000 rows), the process may take longer than the database's log retention period. This can lead to duplicate data imports. Learn how to resolve this.
RDS instance limitations: Only the MySQL engine is supported, with no version restrictions. Other engines, such as PostgreSQL, are not supported. The instance can be in any region. Only basic edition and high-availability edition instances are supported. When you create an RDS instance, set the network type to VPC and select Yes for the whitelist option to add the VPC network segment to the instance's whitelist.
Database and table limitations: A knowledge base can be associated with only a single table in a database; multi-table joins are not supported. The associated table can contain a maximum of 10,000,000 rows, and each row cannot exceed 100 KB. Data in rows exceeding this size limit will be truncated.
For Network Type, select Public Network or Private Network.
Private network data sources are supported only for RDS instances in specific regions. For other regions, select a public network data source. Private network data sources offer better security and performance.
Public network
To allow your knowledge base to receive data from the RDS instance, add the EventBridge public IP addresses to the instance's whitelist.
If the whitelist is not configured correctly, a
Communications link failureerror is displayed when you create the data source.
How to configure the EventBridge whitelist
-
Go to the RDS console. In the navigation pane on the left, click Instance List, and then click the target RDS instance. In the navigation pane on the left, click Database Connection, and then click Configure Whitelist next to the public endpoint.
-
Click Add Whitelist Group and add all of the following EventBridge public IP addresses to the group.
- 39.105.55.188,39.105.110.43,47.95.35.213,47.95.33.100,39.106.255.198,47.93.177.159,47.95.32.154,39.107.99.72
-
Click OK. The allowlist takes effect.
-
Configure the following parameters for the data source:
Parameter Description Data Source Name The data source name must be unique within a workspace. This name cannot be reused, even if the data source creation fails.
Database Instance Enter the ID of the RDS instance. To find the ID, go to the RDS console and click Instance List in the navigation pane on the left.
Database Endpoint Enter the public endpoint of the RDS instance. You can obtain this information from the Database Connection page of the RDS instance: Go to the RDS console, click Instances in the left navigation bar, and then click the RDS instance that contains the data table. Then, click Database Connection in the left navigation bar to view the public endpoint for the instance.
If a public endpoint is not enabled for the RDS instance, follow the on-screen instructions to enable it.
For high-availability edition RDS instances, do not use the proxy endpoint or internal endpoint from the database proxy connection section.
Database Port Enter the public port for the RDS instance. This information is also available on the Database Connection page.
Database Username We recommend using a privileged account. You can also use a standard account that has DML and DDL permissions on the target database. For information on account requirements and creation instructions, see Create an account.
-
Click Create Data Source. The system will then automatically configure the RDS data source. During this time, the workspace is locked, and you cannot create other data sources simultaneously.
When you submit the task for the first time, you may be prompted to authorize the EventBridge service-linked role. A root account must perform this action. If you need to use a RAM user, the root account must first grant the necessary permissions to the RAM user.
Creating a data source may take several minutes during peak hours.
Status
Description
Creation Successful
The data source was created successfully. Select the data source and proceed to thenext step.
Creation Failed
The data source creation failed. Verify your parameters, correct them if necessary, and then clickRetry. You can also click Delete to remove the failed data source.
Private network
-
Configure the following parameters for the data source:
Parameter Description Data Source Name The data source name must be unique within a workspace. This name cannot be reused, even if the data source creation fails.
Region Select the region where the RDS instance is located. To find this, go to the RDS console and click Instance List in the navigation pane on the left.
Database Instance Enter the ID of the RDS instance. To find the ID, go to the RDS console and click Instance List in the navigation pane on the left.
Database Endpoint Enter the internal endpoint of the RDS instance. You can obtain this information from the Database Connection page of the RDS instance: Go to the RDS console, click Instance List in the left navigation bar, and then click the RDS instance that contains the data table. Next, click Database Connection in the left navigation pane to view the internal endpoint for the instance.
For high-availability edition RDS instances, do not use the proxy endpoint or internal endpoint from the database proxy connection section.
Database Port Enter the internal port for the RDS instance. This information is also available on the Database Connection page.
Database Username We recommend using a privileged account. You can also use a standard account that has DML and DDL permissions on the target database. For information on account requirements and creation instructions, see Create an account.
-
Run a connectivity test: Click Start Test to verify the connection between Model Studio (Bailian) and your data source.
When you run the test for the first time, you may be prompted to authorize the EventBridge service-linked role. A root account must perform this action. If you need to use a RAM user, the root account must first grant the necessary permissions to the RAM user.
VPC ID Enter the VPC ID of the RDS instance. You can find this on the Database Connection page of the instance.
The VPC ID is displayed in the Network Type section of that page.
VSwitch ID Hover over the VPC ID on the Database Connection page to view the VSwitch ID.
RDS for MySQL high-availability edition instances may have multiple VSwitch IDs. Ensure that you enter all VSwitch IDs associated with the instance.
In the RDS console, select Database Connection from the navigation pane on the left. In the Network Type information area, hover over the VPC ID to view the associated VSwitch ID.
Security Group ID You can select the Use Managed Security Group option. If you use a custom security group, it must be one you created. Do not use a security group created by another service. You can create a security group in the ECS console on the Security Group page. The security group must meet the following requirements:
-
Its region must match the Region selected above.
-
When creating the security group, select the VPC where the RDS instance is located from the Network dropdown list.
-
Both basic and enterprise security groups are supported.
-
The security group must have no inbound rules.
-
Correct configuration:
On the security group details page, the Security Group ID starts with
sg(some information is redacted). The Intra-group Communication Policy is set to Allow, and the Security Group Type is Basic. In the Access Rules section, the Inbound tab shows no rules (0 entries). -
Incorrect configuration: The security group's inbound rules are configured with five allow rules (all with priority 1): All ICMP (IPv4) (port range -1/-1), custom TCP port RDP (3389), custom TCP port SSH (22), custom TCP port HTTPS (443), and custom TCP port HTTP (80), all with a source of
0.0.0.0/0. While this configuration allows inbound traffic from any IP address, it only opens specific ports.
-
Correct configuration:
-
-
After the connectivity test passes, click Confirm. The system will then automatically configure the RDS data source. During this time, the workspace is locked, and you cannot create other data sources simultaneously.
Creating a data source may take several minutes during peak hours.
Status
Description
Created
The data source was created successfully. Select the data source and proceed to thenext step.
Creation Failed
The data source creation failed. Verify your parameters, correct them if necessary, and then clickRetry. You can also click Delete to remove the failed data source.
Import self-hosted MySQL data
Important
- Before you create a data source, you must activate the EventBridge service.
- When you import a large table with over 1,000,000 rows, the import process might take longer than the log retention period of your database. This can cause duplicate data imports. Learn how to resolve this.
Self-hosted MySQL limitations: The database must be deployed on an Alibaba Cloud ECS instance in any region. Only MySQL versions 5.6, 5.7, and 8.0 are supported. MySQL Proxy is not supported.
Database and table limitations: A knowledge base can only be associated with a single table in a single database; multi-table joins are not supported. The associated table can contain a maximum of 10,000,000 rows, and each row must be smaller than 100 KB. Data exceeding this size limit will be truncated. If this row limit does not meet your business requirements, you can submit a ticket to request an adjustment.
For Network Type, select Public Network or Private Network.
Private network data sources are only supported for ECS instances in specific regions. For other regions, select a public network data source. Private network data sources provide better security and performance.
Public network
To ensure that the knowledge base can receive data, configure an EventBridge allowlist for your self-hosted MySQL database.
If the allowlist is not configured correctly, you will receive a
Communications link failureerror when you create a data source.
How to configure the EventBridge allowlist
-
Go to the ECS console. In the left-side navigation pane, choose Security Group. Find the security group associated with your self-hosted MySQL instance, and then click Manage Rules in the Actions column.
-
On the security group details page, click Add Rule. Add all of the following EventBridge public IP addresses to the security group and configure the rule to allow all traffic on all ports.
Do not use a security group that was created indirectly by a third-party product or service.
- 39.105.55.188,39.105.110.43,47.95.35.213,47.95.33.100,39.106.255.198,47.93.177.159,47.95.32.154,39.107.99.72
-
Click OK to save the rule.
-
In your MySQL database, create an account that allows traffic from all sources (or use an existing account), and then run the following GRANT commands.
Replace
user1in the following commands with your actual database username.
-- Create a user. Replace user1 with your actual database username.
CREATE USER 'user1'@'%' IDENTIFIED BY 'your_password_for_user1';
-- Grant privileges. Replace user1 with your actual database username.
GRANT ALL PRIVILEGES ON *.* TO 'user1'@'%' WITH GRANT OPTION;
-- Flush privileges (this only needs to be done once).
FLUSH PRIVILEGES;
- Enable binary logging (binlog) and Global Transaction Identifiers (GTID) by modifying the MySQL configuration file. On Linux systems, this file is typically located at
/etc/my.cnfor/etc/mysql/my.cnf.
[mysqld]
log-bin=mysql-bin
server-id=1
binlog_format=ROW
gtid_mode=ON
enforce_gtid_consistency=ON
- Restart the MySQL server for the changes to take effect.
-
Fill in the data source configuration details:
Parameter
Description
Data source name
The data source name must be unique within a workspace. This name cannot be reused, even if the data source creation fails.
Database host
Enter the public endpoint of your self-hosted MySQL database.
Database Port
Enter the port of your self-hosted MySQL database.
Database Username
Enter the database username that you granted privileges to in the previous step.
-
Click Create Data Source to submit the creation task. The system automatically configures the self-hosted MySQL data source. During this process, the current workspace is locked, and you cannot create other data sources simultaneously.
When you submit the task for the first time, follow the on-screen instructions to authorize the EventBridge service-linked role. Only a primary account can perform this action. To use a RAM user, the primary account must first grant the necessary permissions to that user.
Creating a data source can take several minutes during peak hours. Please wait for the process to complete.
Status
Description
Created
The data source was created successfully. Select the data source and proceed to the next step.
Failed
The data source creation failed. Verify that all parameters are correct, make the necessary changes, and click Retry. You can also click Delete to remove the failed data source.
Private network
To ensure that the knowledge base can receive data, configure an EventBridge allowlist for your self-hosted MySQL database.
If the allowlist is not configured correctly, you will receive a
Communications link failureerror when you create a data source.
How to configure the EventBridge allowlist
-
In your MySQL database, create an account that allows traffic from all sources (or use an existing account), and then run the following GRANT commands.
Replace
user1in the following commands with your actual database username.
-- Create a user. Replace user1 with your actual database username.
CREATE USER 'user1'@'%' IDENTIFIED BY 'your_password_for_user1';
-- Grant privileges. Replace user1 with your actual database username.
GRANT ALL PRIVILEGES ON *.* TO 'user1'@'%' WITH GRANT OPTION;
-- Flush privileges (this only needs to be done once).
FLUSH PRIVILEGES;
- Enable binary logging (binlog) and Global Transaction Identifiers (GTID) by modifying the MySQL configuration file. On Linux systems, this file is typically located at
/etc/my.cnfor/etc/mysql/my.cnf.
[mysqld]
log-bin=mysql-bin
server-id=1
binlog_format=ROW
gtid_mode=ON
enforce_gtid_consistency=ON
- Restart the MySQL server for the changes to take effect.
-
Fill in the data source configuration details:
Parameter
Description
Data source name
The data source name must be unique within a workspace. This name cannot be reused, even if the data source creation fails.
Region
Select the region where the ECS instance for your self-hosted MySQL database is deployed. You can find this information on the ECS console.
Database Endpoint
Enter the Private Address of your self-hosted MySQL database. You can find this on the Instances page on the ECS console. To view this page, go to the ECS console and choose Instances from the left-side navigation pane. The Private Address is listed for each instance.
Database Port
Enter the port of your self-hosted MySQL database.
Database Username
Enter the database username that you granted privileges to in the previous step.
-
Connectivity test: Click Start Test to check the network connectivity between Model Studio and your data source.
When you submit the task for the first time, follow the on-screen instructions to authorize the EventBridge service-linked role. Only a primary account can perform this action. To use a RAM user, the primary account must first grant the necessary permissions to that user.
VPC ID
Enter the Instance ID (for example, vpc-xxxxxx) of the VPC where your self-hosted MySQL ECS instance is deployed. You can find this information on the ECS console.
In the left-side navigation pane, choose Instances & Images > Instances. Find the target instance in the list. The corresponding VPC ID and VSwitch ID are shown in the VPC column.
VSwitch ID
The VSwitch ID (for example, vsw-xxxxxx) is displayed below the instance's VPC ID.
Security Group ID
You can use a managed security group. If you use a custom security group, it must be created directly by you, not indirectly by a third-party product or service. You can create a security group on the Security Group page of the ECS console. The security group must meet the following requirements:
The region of the security group must match the Region selected above.
The security group must be in the same VPC as the ECS instance.
Both basic and enterprise security groups are supported.
The inbound rules must not have any access restrictions.
-
After the connectivity test passes, click Create Data Source to submit the creation task. The system automatically configures the MySQL data source. During this process, the current workspace is locked, and you cannot create other data sources simultaneously.
Creating a data source can take several minutes during peak hours. Please wait for the process to complete.
Status
Description
Created
The data source was created successfully. Select the data source and proceed to the next step.
Failed
The data source creation failed. Verify that all parameters are correct, make the necessary changes, and click Retry. You can also click Delete to remove the failed data source.
Import data from self-hosted PostgreSQL
ImportantBefore you create a data source, you must activate Data Transmission Service (DTS).
Self-hosted PostgreSQL limitations:
Your database must be deployed on an Alibaba Cloud ECS instance in any region.
Database and table limitations:
A knowledge base connects to only one table in a single database. Joins across multiple tables are not supported. The associated table can contain up to 10,000,000 rows, with each row smaller than 100 KB. Data exceeding this limit is truncated. If this row limit is insufficient for your business needs, you can submit a ticket to request an adjustment.
For the network type, select Private Network.
Only ECS instances in select regions are supported. A private network data source offers better security and performance.
Dataset details
On the dataset list page, click the Details button for a dataset to view its details page. The details page contains the following tabs:
- Overview: Shows basic information about the dataset, such as its name, description, type, creation time, and storage quota, and lists its auto-generated tools.
- Files/Tables (platform-hosted type only): Manage the files or table data within the dataset.
- Tools: View the details of the dataset's auto-generated tools, including parameter descriptions and online testing.
On the dataset details page, you can expand a tool, fill in the parameters, and click the Run button to test the tool's response online.
Data synchronization rules
On the Files tab of a file dataset, click Sync Data Rules > Create Sync Rule in the upper-right corner to open the rule creation page.
-
Select a Category for the data synchronization.
-
Select a Sync Source:
OSS
Model Studio uses a service-linked role (SLR) to automatically synchronize data from OSS by accessing your buckets.
Important
- OSS synchronization uses a service-linked role (SLR) to access user buckets, eliminating the need to configure an AccessKey. Before first use, you must initialize the service-linked role and complete the authorization as prompted.
- The object path must include the bucket name, for example,
my-bucket/docs/ormy-bucket/docs/foo.md. - The current account must have read permissions for the target bucket. To grant access to Model Studio, you must also add the
bailian-datahub-accesstag with the valuereadto the target bucket. For more information, see Manage bucket tags.
Fill in the following OSS object information:
Parameter
Required
Description
OSS region
Yes
Select the region where the OSS bucket is located. For a list of supported regions, see OSS Regions Overview.
OSS object path
Yes
Enter the path of the OSS object to synchronize. The path must include the bucket name. For example,
my-bucket/docs/synchronizes all files in the directory, whilemy-bucket/docs/foo.mdsynchronizes a single file.Synchronization period
Yes
Select the frequency for automatic data synchronization, for example, every minute.
Connection test
Yes
Click Connection Test to verify that the configured OSS path is accessible. You can submit the rule only after the test passes.
Data tags
No
Configure tags for the synchronized data to help categorize it. Each tag can be up to 32 characters long and can contain Chinese characters, uppercase and lowercase letters, numbers, underscores (_), and hyphens (-). Press Enter after typing to add a tag.
Lark
Access Lark knowledge bases and documents through Lark application credentials to synchronize content to the Bailian platform. For instructions on creating a Lark custom app, see Lark custom app development process.
Important
- Before synchronizing Lark documents, you must create a custom app on the Lark Open Platform and obtain the App ID and App Secret.
- You must enable read-only permissions for knowledge base, cloud document, and spreadsheet features, as well as the contact user ID read permission for the app.
- You must fill in one of the following: Lark Knowledge Base ID, Lark Folder ID, or Lark Document ID.
- Synchronization is supported for documents (doc), spreadsheets (xls), bitable, PPT, and other nodes in Lark knowledge bases. It is not supported for locally uploaded files.
1. Create a Lark application and obtain credentials
- Log in to the Lark Open Platform and click Developer Console in the upper-right corner. In the console, click Create Custom App, fill in the App Name, App Description, and App Icon, and then click Create.
- On the app management page, find the Bot feature and click Add.
- In the left-side navigation pane, click Permission Management. On the tab that opens, click Bulk Import/Export Permissions. Copy the following JSON-formatted permission description code into the Import tab, click Next, Confirm New Permissions, and then click Request to Enable.
{ "scopes": { "tenant": [ "aily:file:read", "aily:file:write", "application:application.app_message_stats.overview:readonly", "application:application:self_manage", "application:bot.menu:write", "cardkit:card:write", "contact:contact.base:readonly", "contact:user.employee_id:readonly", "corehr:file:download", "docs:document.content:read", "event:ip_list", "im:chat", "im:chat.access_event.bot_p2p_chat:read", "im:chat.members:bot_access", "im:message", "im:message.group_at_msg:readonly", "im:message.group_msg", "im:message.p2p_msg:readonly", "im:message:readonly", "im:message:send_as_bot", "im:resource", "sheets:spreadsheet", "wiki:wiki:readonly" ], "user": [ "aily:file:read", "aily:file:write", "im:chat.access_event.bot_p2p_chat:read" ] } }- Go to the Credentials and Basic Information page and copy the App ID and App Secret for later use.
2. Configure knowledge base access permissions for the Lark application
- In the Lark client, create a group chat and add the application to it.
- As a knowledge base administrator, navigate to Knowledge Base Settings > Member Settings > Add Admin.
- Search for the group chat containing the bot and add the group as an administrator.
Fill in the following Lark document information:
Parameter
Required
Description
Lark App ID
Yes
The App ID of your Lark custom app. View instructions.
Lark App Secret
Yes
The App Secret of your Lark custom app. Obtain it from the Credentials and Basic Information page on the Lark Open Platform.
Lark Knowledge Base ID
One of three
You must fill in one of the following: Lark Knowledge Base ID, Lark Folder ID, or Lark Document ID. Obtain it from the Lark knowledge base URL.
Lark Folder ID
One of three
You must fill in one of the following: Lark Knowledge Base ID, Lark Folder ID, or Lark Document ID. Obtain it from the Lark folder URL.
Lark Document ID
One of three
You must fill in one of the following: Lark Knowledge Base ID, Lark Folder ID, or Lark Document ID. Obtain it from the Lark document URL.
Exclude Document IDs
No
A list of Lark document IDs that you do not want to synchronize.
Lark Document Domain
No
If your document domain is xxx.feishu.cn/wiki/..., enter xxx. This is used to populate the document source URL during upload.
Sync Period
Yes
Select the frequency for automatic data synchronization. Options: 1 minute, 1 hour (default), and 1 day.
Connection Test
Yes
Click Connection Test to verify that the Lark application credentials and knowledge base access are working properly. You can submit the rule only after the test passes.
Data Tags
No
Configure tags for the synchronized data for easier categorization. Each tag can be up to 32 characters and supports Chinese, English letters (upper and lower case), numbers, underscores (_), and hyphens (-). Press Enter to confirm after typing.
After filling in the form, click Connection Test to verify connectivity. Once the test passes, configure data tags.
Important
- You must set export permissions for Lark.
- Lark does not support exporting MindNote documents.
DingTalk
To create a DingTalk document synchronization rule, obtain the necessary credentials by following these steps.
1. Create a DingTalk application
- Log in to the DingTalk Open Platform. Select an organization for which you have developer permissions, or select an organization and then obtain developer permissions.
- In the top menu bar, select App Development.
- On the right side of the page, click Create App, fill in the application name and description, and then click Save. You are automatically taken to the application details page.
2. Add permissions to the DingTalk application
Before synchronizing data, on the application details page, navigate to Development Configuration > Permission Management, then search for and enable the following permissions:
Contact.User.ReadWiki.Workspace.ReadWiki.Node.ReadDocument.Workbook.ReadNotable.Base.Read_Allqyapi_get_member
3. Publish the application
- In the left-side navigation pane of the application details page, click Version Management & Release.
- On the right side of the page, click Create New Version and enter a version number (for example, 1.0.0) and a version description.
- Set the visibility range, for example, to All Employees.
- Click Save, and then confirm the publication.
4. Obtain the application Client ID and Client Secret
- In the left-side navigation pane, click Credentials and Basic Information.
- Obtain the Client ID and Client Secret.
5. Obtain the DingTalk User ID
- Go to the DingTalk Admin Console and log in as an organization administrator.
- In the left-side navigation pane, click Contacts > Member Management.
- In the member list, find the Employee UserID column and copy the UserID of the target user.
NoteYou must have administrative permissions for the organization to view employee UserIDs.
6. Enable DingTalk MCP
Before creating a DingTalk synchronization rule, you must enable the following MCP services in the DingTalk MCP Marketplace:
- DingTalk Docs MCP: Required to synchronize DingTalk documents.
- DingTalk Sheets MCP: Required to synchronize DingTalk spreadsheets.
Steps to obtain an MCP Endpoint:
- Go to the DingTalk MCP Marketplace, find DingTalk Docs and DingTalk Sheets, and click to open their details pages.
- On the details page, click to get the MCP server configuration and copy the corresponding MCP Endpoint link.
- Paste the copied links into the DingTalk Docs MCP Link and DingTalk Sheets MCP Link fields in the form.
7. Obtain the DingTalk Knowledge Base ID, Folder ID, or Document ID
You must fill in one of the following three IDs in the form to specify which content to synchronize: DingTalk Knowledge Base ID, DingTalk Folder ID, or DingTalk Document ID. You can obtain them directly from the URL:
- DingTalk Knowledge Base ID: Go to the DingTalk knowledge base homepage, click the knowledge base you want to synchronize, and find the ID at the end of the URL in your browser's address bar.
- DingTalk Folder ID: In the knowledge base, click the corresponding folder. The ID is at the end of the URL.
- DingTalk Document ID: In the knowledge base, click the corresponding document. The ID is at the end of the URL.
NoteThese three IDs determine the synchronization scope. Providing the knowledge base ID synchronizes the entire knowledge base. Providing the folder ID synchronizes that folder and its sub-documents. Providing the document ID synchronizes only that single document.
After completing the preceding steps, fill in the DingTalk Document Information:
Parameter
Required
Description
DingTalk user ID
Yes
Obtain this from Contacts > Member Management in the DingTalk Admin Console.
DingTalk application ID
Yes
Obtain this from the app management page on the DingTalk Open Platform.
DingTalk application secret
Yes
Obtain this from the app management page on the DingTalk Open Platform.
DingTalk knowledge base ID
One of three
You must enter one of the following: DingTalk Knowledge Base ID, DingTalk Folder ID, or DingTalk Document ID.
DingTalk folder ID
One of three
You must enter one of the following: DingTalk Knowledge Base ID, DingTalk Folder ID, or DingTalk Document ID.
DingTalk document ID
One of three
You must enter one of the following: DingTalk Knowledge Base ID, DingTalk Folder ID, or DingTalk Document ID.
DingTalk Docs MCP link
Conditionally required
This value is required if you need to synchronize DingTalk documents.
DingTalk Sheets MCP link
Conditionally required
This value is required if you need to synchronize DingTalk spreadsheets.
Synchronization period
Yes
Select the frequency for automatic data synchronization.
After filling in the information, click Connection Test to verify connectivity. After the test passes, configure the data tags.
Important
- DingTalk document synchronization consumes DingTalk development resources. View DingTalk development resource consumption and expansion options.
- Synchronization is supported for DingTalk documents, spreadsheets, and AI sheets created in a DingTalk knowledge base. It is not supported for documents and spreadsheets uploaded from local files.
DingTalk API call consumption
Each synchronization consumes the API quota of the DingTalk Open Platform. We recommend that you assess your API quota in advance to ensure it is sufficient. Consumption occurs in two phases: pre-synchronization check and synchronization execution.
Pre-synchronization check (checks connectivity, permissions, and resource existence when a task starts):
- Account authentication: 1 call.
- Batch document check: 1 call for every 30 documents (rounded up), plus 1 additional call.
- AI sheet existence check: 1 call per AI sheet.
- Knowledge base existence check: 1 call per knowledge base.
Synchronization execution (pulls content into Model Studio):
- Account authentication: 1 call.
- Knowledge base content retrieval: 1 call per knowledge base.
- AI sheet content retrieval: (Number of sheets + Number of unidirectional/bidirectional linked fields) calls per AI sheet.
To synchronize 1 knowledge base (containing 50 documents) and 2 AI sheets (each with 3 sheets and 2 linked fields), the total API calls are calculated as follows:
- Pre-synchronization check: 1 + (50/30 + 1) + 2 + 1 = 7 calls.
- Synchronization execution: 1 + 1 + 2 * (3 + 2) = 12 calls.
- Total: approximately 19 calls.
NoteThis is a typical estimate. The actual consumption may fluctuate slightly due to factors such as API retries and error rollbacks.
Yuque Sync
Access Yuque documents and knowledge bases through a Yuque Token to synchronize content to the Bailian platform.
Obtain a Yuque Token
- Personal Token: Log in to the Yuque settings page, create a new token, and copy it.
- Team Token: Navigate to Team Space -> Team Settings -> Developer -> Tokens, create a new token, and copy it.
Fill in the following Yuque document information:
Parameter
Required
Description
Yuque Document/Knowledge Base URL
Yes
A list of complete Yuque document or knowledge base URLs. Separate multiple URLs with commas (
,). Example:https://www.yuque.com/xionghuyi/xr0xqi,https://www.yuque.com/xionghuyi/xr0aax.Yuque Token
Yes
A Yuque access token. Both personal tokens and team tokens are supported. See the instructions above for how to obtain a token.
Document Permission Level
No
The permission levels of Yuque documents to synchronize. Multiple values are supported.
0: Private,1: Public,2: Public within the organization. Example: to sync private and organization-public documents, enter0,2. Default:0,1,2(this setting does not apply when the URL list specifies a specific document).Sync Period
Yes
Select the frequency for automatic data synchronization. Options: 1 minute, 1 hour (default), and 1 day.
Connection Test
Yes
Click Connection Test to verify that the Yuque Token and URLs are accessible. You can submit the rule only after the test passes.
Data Tags
No
Configure tags for the synchronized data for easier categorization. Each tag can be up to 32 characters and supports Chinese, English letters (upper and lower case), numbers, underscores (_), and hyphens (-). Press Enter to confirm after typing.
After filling in the form, click Connection Test to verify connectivity. Once the test passes, configure data tags.
-
Configure the data tags, and then click Confirm to complete the creation.
After creation, the rule is displayed on the synchronization rule list page, where you can Enable or Disable it in the Actions column.
File dataset tools
After a file dataset is created, the system automatically generates the following two tools:
Tool name | Description | Parameters |
|---|---|---|
| Searches for files by title keywords and returns their download links. |
|
| Retrieves a file by using its ID and returns its download link. |
|
Manage datasets
-
Edit: Click a dataset's card to open its details page. Click the Edit button in the upper-right corner to modify the dataset's name and description. You cannot change the dataset type or storage method after creation. For database datasets, the connection information (database address, port, username, and password) also cannot be changed after creation. If the database password is changed, delete the original dataset and create a new one.
-
Copy: On the dataset list page or its details page, click the Copy button to create a new dataset with the same configuration.
-
Delete: On the dataset list page, click the More icon (
···) on the target dataset card and select Delete, or click the Delete button on the dataset details page.ImportantDeletion requires confirmation. You cannot undo this action.
NoteOnce a knowledge base is created, you cannot change its associated dataset. The Data source field on the knowledge base edit page is read-only. To use a different dataset, you must re-create the knowledge base.
Use a data connector in an agent
After you create a connector, add its tools to your agent. The agent can then automatically call these tools in conversations to query and reference external data.
-
On the agent configuration page, click Skills in the left pane and find the Data Connector section.
-
Click the + button in the Data Connector section. In the Select Data Connector dialog box:
- Browse or search for the target connector. You can filter by connector type.
- Click Add next to the target connector.
- Once added, the connector's tools automatically appear in the configuration list. You can click the settings button next to a tool to adjust its parameters.
- Publish the agent so it can automatically call these tools in conversations.
Use a data connector in a workflow
After you create a connector, you can add a data connector node to your workflow. This allows the workflow to call connector tools to query external data and pass the results to downstream nodes.
-
On the workflow canvas configuration page, expand the node library on the left. Under the tools category, find the data connector node and drag it onto the canvas.
-
In the Select data connector dialog box:
- Browse or search for the target connector. You can filter by connector type, such as File, Table, MySQL, PostgreSQL, Yuque, or OSS.
- Expand the connector, select the tool you want to use (such as searchFile or getFile), and then click OK.
-
Configure node input: In the Input section of the node configuration panel, configure the tool's input parameters. Map outputs from upstream nodes or built-in variables to the required parameters, such as fileId.
-
Connect nodes: Connect the data connector node to upstream and downstream nodes to ensure the correct data flow.
-
The node's output is a result object with two fields: content (Array<Object>, the returned content) and isError (Boolean, indicates whether an error occurred). Downstream nodes can reference this output.
NoteEach data connector node in a workflow can use only one tool. If you need to use multiple tools from the same connector, add multiple data connector nodes.
References
To create a knowledge base and import content from a data source for retrieval, see Create and use a knowledge base.
For guidance on configuring and using applications, see Application types.
FAQ
Permissions and security
What should I do if I receive a "permission for this module is missing" error when importing data?
The root account must grant the Administrator permission to the RAM user. For more information, see Page permissions.
Is it safe to upload confidential files through public network datasets when creating a knowledge base?
Datasets transmit data through public network links, but the entire transmission uses HTTPS/TLS encrypted channels. Data is in ciphertext during transmission and cannot be interpreted even if the link is intercepted. After data reaches the platform, it is written directly to Alibaba Cloud internal network secure storage, which cannot be accessed from the public network. The public network only serves as a transport medium—data is not persisted on the public network.
After import, files are stored as independent copies (unlinked from original data) in the platform's secure storage. Imported files are accessible only to users in the current workspace. Alibaba Cloud Model Studio does not use the data for any commercial purposes or make it publicly available.
If you still have concerns about public network transmission, you can choose the following options for enhanced security:
- Direct file upload: Upload local files through the file dataset. Data does not pass through public network links and is written directly to Alibaba Cloud internal network secure storage.
- Private network data source: For Alibaba Cloud RDS for MySQL or self-managed MySQL databases, you can select private network (VPC) connection. Data is transmitted through the internal network, offering better security and performance. See the Private network data source section above.
Model Studio Standard and Enterprise editions have identical data security mechanisms: both provide user-level isolation, workspace member-only access, and HTTPS/TLS encrypted transmission. The difference between the two editions is only in storage capacity and feature limits, not security.
File parsing
What should I do if file parsing takes a long time or occasionally times out?
During peak traffic or high concurrency, file parsing may take longer due to resource queuing, and occasional parsing timeouts may occur. We recommend retrying during off-peak hours or waiting patiently for the task to complete.
Import files from OSS
How do I configure permissions to import files from OSS?
The first time you import files from OSS, you must authorize Alibaba Cloud Bailian to access your OSS resources. The authorization process differs for a root account and a RAM user.
What should I do if I get error "10041495" when importing files from OSS?
This error is caused by the following reasons. Troubleshoot them in order:
- The root account has not activated the OSS service. The root account must go to the OSS console and activate OSS as prompted.
- The target OSS bucket does not have the
bailian-datahub-accesstag (with the valueread). Alibaba Cloud Bailian cannot access buckets without this tag. Go to the bucket tags page in the OSS console and add the tag to the target bucket. - After you complete the preceding operations, return to the Alibaba Cloud Bailian page and authorize again.
Import MySQL data
What do I do if knowledge base data stops being synchronized after I change the password of an RDS MySQL database?
When a dataset is created, it saves the database connection information, including the database password, which cannot be modified afterwards. After you change the database password in the RDS console, the password saved in the dataset becomes invalid. Data synchronization then stops due to an authentication failure, and the knowledge base data is no longer updated.
To resolve this issue, delete the original dataset, create a new dataset with the new password, and import the data again. Because a knowledge base cannot change its associated dataset, you must also re-create the knowledge base and associate it with the new dataset.
Which regions are supported for RDS and ECS instances used as private network data sources?
- China (Hangzhou)
- China (Shanghai)
- China (Shenzhen)
- China (Heyuan)
- China (Guangzhou)
- China (Qingdao)
- China (Beijing)
- China (Zhangjiakou)
- China (Hohhot)
- China (Ulanqab)
- China (Chengdu)
How do I grant a RAM user the permissions to create the EventBridge service-linked role?
-
As the root account, attach the following three system policies to the RAM user:
AliyunBailianFullAccess,AliyunEventBridgeFullAccess, andAliyunRDSReadOnlyAccess. For detailed instructions, see Manage permissions for a RAM user. -
Using the root account, grant the RAM user the permission to create service-linked roles.
- Sign in to the RAM console as the root account. In the left-side navigation pane, choose Permissions > Policies, and then click Create policy.
- In the Script Editor, enter the corresponding content from the following script into the
Effect,Action,Resource, andConditionfields, and then click OK.
{
"Version": "1",
"Statement": [
{
"Action": "ram:CreateServiceLinkedRole",
"Resource": "*",
"Effect": "Allow"
}
]
}
- Enter the policy name
CreateServiceLinkedRoleand click OK. - In the left-side navigation pane, choose Identities > Users. Find the target RAM user in the list and click Add permissions in the Actions column.
- From the Policies list, select the
CreateServiceLinkedRolepolicy that you just created, and then click OK. This grants the RAM user permission to create service-linked roles. - After completing these steps, return to the Create Data Source page as the RAM user and create the EventBridge service-linked role again.
What should I do if I get a "Database configuration check failed. The selected table contains a large amount of data" error?
ApsaraDB RDS for MySQL
The image is for illustration only. Recommended values vary based on your table's data volume. If an item is not mentioned, no change is required.
Perform these steps as your root account.
-
Configure the local log retention period
- Go to the RDS console. In the left-side navigation pane, click Instances, and then click the ID of the relevant RDS instance. In the left-side navigation pane, click Backup and recovery. On the Backup strategy tab, find the Retention period setting.
- Set the Retention period to the value recommended in the prompt.
-
Configure wait_timeout
- Go to the RDS console. In the left-side navigation pane, click Instances, and then click the ID of the relevant RDS instance. In the left-side navigation pane, click Parameter settings. On the Editable parameters tab, find the
wait_timeoutparameter. - Set the parameter to the value recommended in the prompt.
- Go to the RDS console. In the left-side navigation pane, click Instances, and then click the ID of the relevant RDS instance. In the left-side navigation pane, click Parameter settings. On the Editable parameters tab, find the
Self-managed MySQL
The image is for illustration only. Recommended values vary based on your table's data volume. If an item is not mentioned, no change is required.
-
Set the local log retention period
-
Method 1 (temporary): Modify
expire_logs_days(for MySQL 5.7 or earlier) orbinlog_expire_logs_seconds(for MySQL 8.0 or later) by running the SET GLOBAL command. This change is lost after the next MySQL restart.MySQL 5.7 and earlier
-
Run the statement:
Replace the value
15with the recommended value from the prompt.
SET GLOBAL expire_logs_days = 15;- To verify the change, run the following statement:
SHOW VARIABLES LIKE 'expire_logs_days';MySQL 8.0 and later
-
Run the statement:
Replace the value
1296000with the recommended value from the prompt.
SET GLOBAL binlog_expire_logs_seconds = 1296000;- To verify the change, run the following statement:
SHOW VARIABLES LIKE 'binlog_expire_logs_seconds'; -
-
Method 2 (Permanent): Set
expire_logs_days(for MySQL 5.7 and earlier versions) orbinlog_expire_logs_seconds(for MySQL 8.0 and later versions) in the MySQL configuration file, but this method requires a restart of the MySQL service.MySQL 5.7 and earlier
-
For example, on a Linux system, the MySQL configuration file is typically located at /etc/my.cnf or /etc/mysql/my.cnf. If the file already contains
expire_logs_days, you can modify it directly. If it does not exist, add it manually.Replace the value
15with the recommended value from the prompt.
[mysqld] expire_logs_days = 15- Save the configuration file, and then restart the MySQL service.
- To verify the change, run the following statement:
SHOW VARIABLES LIKE 'expire_logs_days';MySQL 8.0 and later
-
For example, on a Linux system, the MySQL configuration file is typically located at /etc/my.cnf or /etc/mysql/my.cnf. If the file already contains
binlog_expire_logs_seconds, you can modify it directly. If it does not exist, add it manually.Replace the value
1296000with the recommended value from the prompt.
[mysqld] binlog_expire_logs_seconds = 1296000- Save the configuration file, and then restart the MySQL service.
- To verify the change, run the following statement:
SHOW VARIABLES LIKE 'binlog_expire_logs_seconds'; -
-
-
Set wait_timeout
-
Method 1 (temporary): Execute the
SET GLOBALcommand to modify thewait_timeoutparameter (in seconds). This change will be reset after the next MySQL restart.-
Run the statement:
Replace the value
1159200with the recommended value from the prompt.This statement affects all new connections. Existing connections are not affected.
-
-
SET GLOBAL wait_timeout = 1159200;
- To verify the change, run the following statement:
SHOW VARIABLES LIKE 'wait_timeout';
-
Method 2 (Permanent): Set the
wait_timeoutparameter (in seconds) in the MySQL configuration file, but this method requires a restart of the MySQL service.-
For example, on a Linux system, the MySQL configuration file is typically located at /etc/my.cnf or /etc/mysql/my.cnf. If the file already contains
wait_timeout, you can modify it directly. If it does not exist, add it manually.Replace the value
1159200with the recommendedwait_timeoutvalue from the prompt.
-
[mysqld]
wait_timeout = 1159200
- Save the configuration file, and then restart the MySQL service.
- To verify the change, run the following statement:
SHOW VARIABLES LIKE 'wait_timeout';
What should I do if I get a CHECK_BINLOG_FORMAT, CHECK_ENFORCE_GTID_MODE, or CHECK_GTID_CONSISTENCY error when creating a data source?
These errors indicate that your MySQL database configuration does not meet the prerequisites of the dataset. When you create a data source, the system automatically validates the following configuration items:
Error code | Meaning | Expected value |
|---|---|---|
| The binlog format must be ROW |
|
| GTID mode must be enabled |
|
| GTID consistency enforcement must be enabled |
|
Alibaba Cloud RDS for MySQL
-
Go to the RDS console, click Instance List in the left-side navigation pane, and then click the target RDS instance.
-
Click Parameter settings in the left-side navigation pane. On the Editable parameters tab, change the following parameters to the expected values:
- Set
binlog_formattoROW - Set
gtid_modetoON - Set
enforce_gtid_consistencytoON
- Set
-
After you submit the parameter changes, restart the RDS instance as prompted for the changes to take effect.
Modifying
gtid_modeandenforce_gtid_consistencyrequires an instance restart. Perform this operation during off-peak hours to avoid affecting online services.
Self-managed MySQL
Modify the MySQL configuration file (on Linux systems, typically located at /etc/my.cnf or /etc/mysql/my.cnf), and add or modify the following configuration items in the [mysqld] section:
[mysqld]
binlog_format=ROW
gtid_mode=ON
enforce_gtid_consistency=ON
After you save the configuration file, restart the MySQL service for the changes to take effect:
sudo systemctl restart mysqld
After the restart, you can run the following command to verify that the configuration has taken effect:
SHOW VARIABLES WHERE Variable_name IN ('binlog_format', 'gtid_mode', 'enforce_gtid_consistency');