Skip to main content

Data Connectors

Ingest files, spreadsheets, databases, and external sources into Knowledge Studio.

Data connectors are the unified entry point for managing external data sources. By creating connectors, applications can securely access enterprise databases, document systems, and object storage, querying and referencing data in real time during conversations.

Connector types

Connectors are divided into platform-managed and stream-processing types based on data storage and access patterns:
CategoryConnectorData storageUse case
Platform-managedFilePlatform storage or self-owned OSSUpload and manage unstructured documents (PDF, Word, Markdown, etc.)
Platform-managedSpreadsheetPlatform storage or self-owned OSSImport and query structured spreadsheet data (CSV, Excel, etc.)
Stream processingMySQLData stays in source database, real-time accessConnect to MySQL databases, execute SQL queries
Stream processingPostgreSQLData stays in source database, real-time accessConnect to PostgreSQL databases, execute SQL queries
Stream processingPolarDB-X 2.0Data stays in source database, real-time accessConnect to Alibaba Cloud PolarDB-X 2.0 distributed databases
OSS, Feishu, DingTalk, SharePoint, and Yuque are not standalone connector types. They serve as import and sync sources within file connectors — see Sync Rules.

Prerequisites

  • Account permissions: Primary account or RAM user with data connector management permissions.
  • Data source preparation (by connector type):
ConnectorRequirements
File / SpreadsheetFiles to upload, or an existing OSS Bucket
MySQLMySQL database instance (Alibaba Cloud RDS or self-hosted), network accessible
PostgreSQLPostgreSQL instance with wal_level set to logical
PolarDB-X 2.0Alibaba Cloud PolarDB-X 2.0 instance in a region supporting private network access

Create a connector

Go to Data Ingestion → Data Connectors in the console, click Create Connector, select a type, and configure as follows. The connector name must not exceed 20 characters, and the description must not exceed 200 characters.
  • File
  • Spreadsheet
  • MySQL
  • PostgreSQL
  • PolarDB-X 2.0
File connectors manage unstructured documents (PDF, Word, etc.).
  1. Select File as the connector type.
  2. Enter the Connector Name and Description. The description guides application accuracy — describe the data content and purpose.
  3. For Storage Location, choose Platform Storage (up to 200,000 files / 1 TB, free for a limited time) or Self-owned OSS (first-time use requires authorization; add the bailian-connector-access tag with value ReadAndWrite to the target Bucket).
Click Confirm to complete creation. Platform-managed file capacity (200,000 files / 1 TB) is separate from the knowledge base document limit, which remains 100,000 documents per knowledge base.
After a database connector is created, its address, port, username, and password cannot be modified. If the database password changes, the saved password becomes invalid, synchronization stops due to authentication failure, and knowledge base data is no longer updated. Delete the original connector and create a new one with the new password. A knowledge base cannot change its associated connector, so any bound knowledge base must also be recreated and linked to the new connector. Deletion is irreversible; review the impact first.

Import data

After creating a connector, import data into it.

File connector

  1. Click Details on the target connector in the data connector list to open the File Management page.
  2. Select an existing category from the left tree, or click + to create a new one.
  3. Click Import Data, select Local Upload to upload files, or select OSS to pull files from OSS.
  4. Select a parsing method (default or custom); the system handles parsing automatically.
Each workspace supports up to 500 categories. To request a higher limit, submit a ticket.

Choose a parsing method

Available methods depend on the file type. Use the default settings if you are unsure.
  • Digital Parsing: Does not parse illustrations or charts in files.
  • Intelligent Document Parsing: Extracts text from illustrations and generates summaries, which are chunked and vectorized with other text for retrieval.
  • LLM Parsing: For recognizing and understanding illustrations and charts in documents.
  • Qwen-VL Parsing: Supports images only. Select a Qwen-VL model and use a prompt to specify the content to recognize.
  • Audio/Video Parsing: Recognizes human speech, not music or environmental sounds. For videos, it can also extract representative frames and text descriptions. Plot analysis is video-only and must be enabled manually to identify events, add timestamps, and generate descriptions.
  • JSON, CSV, and YAML formats are not directly supported. Convert to XLSX or XLS before importing.
  • Imported files are stored as independent copies. Deleting a source file does not delete its platform copy; manually remove it on the File Management page.
  • Only files imported within the last 90 days can be viewed. Older files cannot be viewed, but are not automatically deleted.

Spreadsheet connector

Click Details for the target spreadsheet connector to open data management. Under Table Management on the left, select an existing table or click + to create one.

Import into a new table

  1. Enter a Table Name and choose how to define its structure:
    • Upload Excel Directly: Detect the file header, create the table structure, and import the remaining content as data records.
    • Custom Header: Enter the required Column Name and Type, plus an optional Description for each field. Use Add Field or Delete to adjust the fields. Describe field meanings in natural language.
  2. Upload an XLSX or XLS file with a header. The number of columns and column names must exactly match the target table, or the import fails.
  3. Click OK to start importing. The new table appears in the left-hand table tree when complete.
A table's structure (column names, descriptions, and types) cannot be changed after creation. An image_url field must contain a publicly accessible image URL, such as https://example.com/downloads/pic.jpg. The knowledge base fetches the image and builds an image vector index for scenarios such as image-to-image search.

Import into an existing table

  1. Select the target table in the left-hand list and click Import Data.
  2. Select Upload and Overwrite or Incremental Upload. Use Download Template to obtain a header-only file, then fill in your data.
  3. Upload an XLSX or XLS file with a header. Its column count and names must match the current table, or the import fails.
Table imports do not directly support JSON, CSV, or YAML. Convert these files to XLSX or XLS first.

OSS file import requirements

On the details page of a file or spreadsheet connector, select a category, click Import Data, choose OSS, then select a parsing method and confirm the import. Check these requirements first:
  • On first use, authorize the OSS Service Linked Role (SLR) as prompted. For a RAM user, the primary account must first grant ram:CreateServiceLinkedRole with the ram:ServiceName condition restricted to datahub.sfm.aliyuncs.com. Then return to the import page to authorize the role.
  • The current account needs read access to the target bucket, and the bucket must have the bailian-datahub-access tag with value read. This is for import/sync reads, not the bailian-connector-access=ReadAndWrite tag used for self-owned OSS storage.
  • Buckets using Archive, Cold Archive, or Deep Cold Archive storage classes are unsupported. Files in the bucket root are also unsupported; select a subdirectory.
  • Private buckets and buckets with content encryption are supported; making them public is not required.
  • If Referer-based hotlink protection is enabled, add *.console.aliyun.com to the Referer allowlist. See OSS hotlink protection.

Database connector

Database connectors (MySQL / PostgreSQL / PolarDB-X 2.0) keep data in the source database — no manual file upload is needed. Only connectors created by importing data sources from DMS support SQL queries in applications; custom data sources do not support direct SQL execution.

Legacy database-to-knowledge-base sync limits

The following applies only to the legacy path that imports and synchronizes database tables into a knowledge base, not to direct SQL queries through DMS data sources:
  • RDS MySQL: The platform and RDS instance must belong to the same Alibaba Cloud account. Activate EventBridge before creating a data source.
  • Self-hosted MySQL: Must run on Alibaba Cloud ECS. Only MySQL 5.6 / 5.7 / 8.0 are supported; MySQL Proxy is unsupported. Activate EventBridge first.
  • Self-hosted PostgreSQL: Must run on Alibaba Cloud ECS, use a private network, and be in a supported ECS region. Activate DTS and authorize its Service Linked Role before creating the data source. RAM users need the necessary permissions from the primary account first.
  • Shared limits for these table sync paths: A knowledge base can link to only one table in one database; multi-table joins are unsupported. The table can contain up to 10,000,000 rows, with 100 KB per row. Content beyond the row-size limit is truncated.
For full setup steps, see the corresponding database tabs in the official Import data guide. MySQL checks and troubleshooting: For self-hosted MySQL sync, enable Binlog and GTID and check binlog_format=ROW, gtid_mode=ON, and enforce_gtid_consistency=ON. Importing large tables with more than 1,000,000 rows can cause repeated imports if log retention is insufficient. Evaluate log retention and wait_timeout only when validation prompts recommend adjustments; otherwise, no change is needed. See official MySQL import troubleshooting.
Database parameter changes can affect existing workloads, and some require a maintenance window. Have a database administrator assess permissions, resources, and how changes take effect, and schedule changes during off-peak maintenance. Do not troubleshoot by immediately restarting production instances, allowing unrestricted network access, or broadly increasing database permissions.

Sync rules

File-type connectors support sync rules for automatically syncing new or updated files from external sources.
  1. Click Details on the target file connector in the data connector list.
  2. Switch to the Scheduled Sync tab and click Create Sync Rule.
  3. Select the Category in which to store synced files, then choose a sync source and configure it as follows.
  • OSS
  • Feishu
  • DingTalk
  • SharePoint
  • Yuque
Syncs OSS bucket data to the platform via Alibaba Cloud Service Linked Role (SLR).
  • OSS sync uses SLR to access your Bucket — no AccessKey needed. First-time use requires authorization.
  • Object paths must include the Bucket name, e.g., my-bucket/docs/ or my-bucket/docs/foo.md.
  • The current account needs read access to the target Bucket, which must have the bailian-datahub-access tag (value read).
ParameterRequiredDescription
OSS RegionYesRegion of the OSS Bucket
OSS object pathYesPath including Bucket name (e.g., my-bucket/docs/ for a directory, or my-bucket/docs/foo.md for a single file)
Sync periodYesOne minute / One hour (default) / One day
Connection testYesVerify the OSS path is accessible
Data tagsNoClassification tags, max 64 characters each
After configuration, click Connection Test to verify connectivity. Once passed, configure data tags and click Confirm to create the rule. You can enable, disable, or delete the rule in the list on the Scheduled Sync tab. For OSS, Feishu, SharePoint, and Yuque sync, each data tag supports up to 64 characters: Chinese characters, uppercase and lowercase English letters, digits, underscores (_), and hyphens (-). Press Enter to add a tag.

Sync interval and file retention

  • Sync interval: Choose one minute, one hour (default), or one day. This controls how often source changes are checked, not when files finish parsing and become searchable. Parsing and vectorization after syncing, including the first sync, may take several hours during peak traffic.
  • Existing copies: Disabling or deleting a rule does not delete synced files. Deleting a source file does not automatically delete its platform copy either. Manually delete unwanted copies on the File Management page.
  • Viewing window: Only files imported within the last 90 days can be viewed. Files outside this window cannot be viewed, but are not deleted.

File connector tools

File connectors automatically generate the following tools, callable from Agent applications or workflows:
ToolDescription
searchFileSearch files by keyword, returns matching file list with download links
getFileRetrieve file by ID, returns a download link

Manage connectors

From the data connector list, you can perform the following operations on existing connectors:
OperationDescription
EditModify connector name and description only; database address, port, username, and password cannot be changed
DuplicateCopy connector configuration to create a new connector
DeleteDelete the connector — irreversible
Once a connector is bound to a knowledge base as a data source, the binding cannot be changed. To switch data sources, create a new knowledge base.

Use connectors in Agents

  1. In the Agent editor, go to Skills → Data Connectors.
  2. Click + and select the desired data connector.
  3. Click Publish — the Agent can now invoke the connector's tools in conversations.

Use connectors in workflows

  1. In the workflow editor, add a Data Connector node.
  2. Select a connector and the tool to use (one tool per node).
  3. The tool outputs a result object containing content (Array) and isError (Boolean) fields.

Data Import API

Beyond the console, you can manage ingestion through the API — see API Reference — Data Import.
Data Import endpoints (/api/v1/connector/dash/) share the same workspace URL and authentication as all other endpoints — see API Overview.
With a connector configured, move on to Create a Knowledge Base to build a searchable index from the connector's data.