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.
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). |
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
- Table
- MySQL
- PostgreSQL
- PolarDB-X 2.0
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 100,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.
- 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
- Click Confirm to complete the creation.
Import data
- Import files
- Import tables
- Import files from OSS
- Import RDS MySQL data
- Import self-hosted MySQL data
- Import data from self-hosted PostgreSQL
-
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.
Each 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, 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.
-
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.
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.
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
- Lark
- DingTalk
- Yuque Sync
Model Studio uses a service-linked role (SLR) to automatically synchronize data from OSS by accessing your buckets.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.
- Configure the data tags, and then click Confirm to complete the creation.
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.
- 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.
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 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.
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 Introduction to application types.
FAQ
Permissions and security
What should I do if I receive a "permission for this module is missing" error when importing data?
What should I do if I receive a "permission for this module is missing" error when importing data?
Administrator permission to the RAM user. For more information, see Page permissions.Is it safe to upload confidential files through public network data connectors when creating a knowledge base?
Is it safe to upload confidential files through public network data connectors when creating a knowledge base?
- Direct file upload: Upload local files through the file connector. 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.
Import files from OSS
How do I configure permissions to import files from OSS?
How do I configure permissions to import files from OSS?
- Authorize a root account
- Authorize a RAM user
- On the Import data page, click Authorize Now.
-
In the dialog box that appears, click Confirm Authorization. The system automatically creates an OSS service-linked role to allow Alibaba Cloud Bailian to access your OSS resources.
This change usually takes effect within seconds but can be delayed during peak hours.
-
Add the tag
bailian-datahub-accesswith the valuereadto the target OSS bucket.This tag identifies the buckets that Alibaba Cloud Bailian can access. Alibaba Cloud Bailian cannot access buckets without this tag.
- Go to the OSS console. In the left-side navigation pane, click Bucket list and find the target bucket.
- Hover over the Tag icon next to the bucket name and click Modify (if no tags have been set) or Go to edit.
- On the bucket tags page, click Create tag (if no tags have been set) or Settings.
- Click Tag, add a tag with the key
bailian-datahub-accessand the valueread, and then click Save.
-
Return to the Import Data page, reselect the target bucket, and try the import again.
Note: Alibaba Cloud Bailian does not support accessing files in the root directory of a bucket. You must select an existing subdirectory or create a new one for Alibaba Cloud Bailian to access.
What should I do if I get error "10041495" when importing files from OSS?
What should I do if I get error "10041495" when importing files from OSS?
- Sign in to the OSS console as the root account and activate OSS when prompted.
- Return to the Alibaba Cloud Bailian page and authorize again.
Import MySQL data
Which regions are supported for RDS and ECS instances used as private network data sources?
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?
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.
- 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?
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
- Self-managed MySQL
-
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