ALIYUN::Bailian::Index
ALIYUN::Bailian::Index is used to create an Alibaba Cloud Model Studio knowledge base.
Syntax
{
"Type": "ALIYUN::Bailian::Index",
"Properties": {
"Name": String,
"SourceType": String,
"StructureType": String,
"WorkspaceId": String,
"ChunkMode": String,
"CategoryIds": List,
"ConnectId": String,
"ChunkSize": Integer,
"Description": String,
"Database": String,
"DocumentIds": List,
"DenseSimilarityTopK": Integer,
"EnableRewrite": Boolean,
"EnableHeaders": Boolean,
"EmbeddingModelName": String,
"KnowledgeScene": String,
"KnowledgeType": String,
"MetaExtractColumns": List,
"OverlapSize": Integer,
"PipelineRetrieveRateLimitStrategy": String,
"PipelineCommercialCu": Integer,
"PipelineCommercialType": String,
"RerankMode": String,
"RerankModelName": String,
"RerankInstruct": String,
"RerankMinScore": Number,
"SinkInstanceId": String,
"SparseSimilarityTopK": Integer,
"SinkRegion": String,
"SinkType": String,
"Separator": String,
"TableIds": List,
"Table": String
}
}Properties
Property | Type | Required | Editable | Description | Constraints |
Name | String | Yes | Yes | The name of the knowledge base. | The name must be 1 to 20 characters in length. It can contain Chinese characters, English letters, digits, underscores (_), hyphens (-), periods (.), and colons (:). |
SourceType | String | Yes | No | The type of the data source. | Valid values:
|
StructureType | String | Yes | No | The type of the knowledge base. | Valid values:
|
WorkspaceId | String | Yes | No | The workspace ID. | The knowledge base is created in the specified workspace. |
CategoryIds | List | No | No | The IDs of the categories to import into the knowledge base. | Required when |
ChunkMode | String | No | No | The chunking strategy. | For more information, seeKnowledge base. If this parameter is not specified, intelligent chunking is used. Valid values (multiple values cannot be specified at the same time):
|
ChunkSize | Integer | No | No | The chunk size, which is the maximum number of characters in each text chunk. | Valid values: [1-6000]. Default value: 500. If |
ConnectId | String | No | No | The connection ID. | You can obtain this value from the data connector card on the Data Connections page. |
Database | String | No | No | The database name of the structured knowledge base. | None. |
DenseSimilarityTopK | Integer | No | Yes | The number of most similar text chunks to retrieve by vector similarity (top K). | Valid values: [0-100]. Default value: 100. The sum of |
Description | String | No | Yes | The description of the knowledge base. | The description must be 0 to 1,000 characters in length. |
DocumentIds | List | No | No | The IDs of the documents to import into the knowledge base. | Required when |
EmbeddingModelName | String | No | No | The embedding model used by the knowledge base. | The embedding model converts the original input prompt and knowledge text into numerical vectors so that their similarity can be compared. Compared with Valid values:
|
EnableHeaders | Boolean | No | No | Specifies whether to enable headings for document parsing. | Default value: |
EnableRewrite | Boolean | No | No | Specifies whether to enable multi-turn conversation rewriting. | Default value: |
KnowledgeScene | String | No | No | The knowledge base scenario. | The value of this parameter depends entirely on the value of Valid values and dependencies:
|
KnowledgeType | String | No | No | The knowledge base type category. | The value of this parameter must match the selected Valid values:
|
MetaExtractColumns | List | No | No | The metadata extraction configuration. | For more information, see MetaExtractColumns properties. |
OverlapSize | Integer | No | No | The overlap size, which is the number of characters that overlap between adjacent text chunks. | Valid values: [0-1024]. Default value: 100. The value must be less than |
PipelineCommercialCu | Integer | No | Yes | The number of RCUs in the Enterprise edition. | This parameter is required only when Valid values: [1-200]. |
PipelineCommercialType | String | No | Yes | The knowledge base edition type. | Valid values:
|
PipelineRetrieveRateLimitStrategy | String | No | No | The retrieval rate-limiting strategy for the Enterprise edition. | Default value: |
RerankInstruct | String | No | No | The custom reranking instruction. | Required when |
RerankMinScore | Number | No | Yes | The similarity threshold. | Only text chunks whose similarity score exceeds this value are recalled. Valid values: [0.01-1.00]. Default value: 0.01. |
RerankMode | String | No | No | The reranking mode. | Valid values:
|
RerankModelName | String | No | No | The reranking model used by the knowledge base. | The reranking model is a scoring system outside the knowledge base.It calculates the similarity score between the user question and each text chunk in the knowledge base, sorts the text chunks in descending order, and returns the top K text chunks with the highest scores. Default value:
|
Separator | String | No | No | The chunk separator. | This parameter takes effect only when |
SinkInstanceId | String | No | No | The vector storage instance ID. | Required when |
SinkRegion | String | No | No | The region to which the vector storage instance belongs. | Required when |
SinkType | String | No | No | The vector storage type. | For more information, seeKnowledge base. Valid values:
|
SparseSimilarityTopK | Integer | No | Yes | The number of text chunks to retrieve by exact keyword matching (top K). | Valid values: [0-100]. Default value: 100. The sum of |
Table | String | No | No | The table name of the structured knowledge base. | None. |
TableIds | List | No | No | The IDs of the tables to import into the knowledge base. | None. |
MetaExtractColumns syntax
"MetaExtractColumns": [
{
"EnableLlm": Boolean,
"Desc": String,
"Type": String,
"Value": String,
"EnableSearch": Boolean,
"Key": String
}
]MetaExtractColumns properties
Property | Type | Required | Editable | Description | Constraints |
Key | String | Yes | No | The metadata field name. | The name must be 1 to 50 characters in length, and can contain only letters and underscores. |
Type | String | Yes | No | The extraction method for the metadata field. | Valid values:
|
Desc | String | No | No | The description of the metadata field. | The description must be 0 to 1,000 characters in length. |
EnableLlm | Boolean | No | No | Specifies whether the metadata field participates in model response generation. | None. |
EnableSearch | Boolean | No | No | Specifies whether the metadata field participates in knowledge base retrieval. | None. |
Value | String | No | No | The value of the metadata field. | None. |
Return values
Fn::GetAtt
Id: The unique ID of the knowledge base index.
Examples
Scenario 1: Create a knowledge base index
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 在百炼平台创建一个简单的非结构化知识库索引,使用内置向量存储,从数据中心文件导入。
en: Create a simple unstructured knowledge base index on Bailian platform with built-in vector storage, importing from data center files.
Parameters:
WorkspaceId:
Type: String
Label:
zh-cn: 工作空间ID
en: Workspace ID
Description:
zh-cn: 百炼平台的工作空间ID,知识库将创建在此工作空间下。
en: The workspace ID of the Bailian platform. The knowledge base will be created in this workspace.
IndexName:
Type: String
Label:
zh-cn: 知识库名称
en: Index Name
Description:
zh-cn: 知识库名称,1-20个字符,支持中英文、数字、下划线、短划线、句号和冒号。
en: Knowledge base name, 1-20 characters. Supports Chinese, English, numbers, underscores, hyphens, periods and colons.
MinLength: 1
MaxLength: 20
Default: my-knowledge-base
DocumentIds:
Type: CommaDelimitedList
Label:
zh-cn: 文档ID列表
en: Document IDs
Description:
zh-cn: 数据中心中已上传的文件ID列表,用于导入到知识库。
en: List of file IDs already uploaded in the data center, to be imported into the knowledge base.
Resources:
Index:
Type: ALIYUN::Bailian::Index
Properties:
WorkspaceId:
Ref: WorkspaceId
Name:
Ref: IndexName
SourceType: DATA_CENTER_FILE
StructureType: unstructured
DocumentIds:
Ref: DocumentIds
SinkType: BUILT_IN
Description:
Ref: ALIYUN::StackName
Outputs:
IndexId:
Description:
zh-cn: 知识库索引ID。
en: Knowledge base index ID.
Label:
zh-cn: 知识库索引ID
en: Index ID
Value:
Fn::GetAtt:
- Index
- Id
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- WorkspaceId
- IndexName
- DocumentIds{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "在百炼平台创建一个简单的非结构化知识库索引,使用内置向量存储,从数据中心文件导入。",
"en": "Create a simple unstructured knowledge base index on Bailian platform with built-in vector storage, importing from data center files."
},
"Parameters": {
"WorkspaceId": {
"Type": "String",
"Label": {
"zh-cn": "工作空间ID",
"en": "Workspace ID"
},
"Description": {
"zh-cn": "百炼平台的工作空间ID,知识库将创建在此工作空间下。",
"en": "The workspace ID of the Bailian platform. The knowledge base will be created in this workspace."
}
},
"IndexName": {
"Type": "String",
"Label": {
"zh-cn": "知识库名称",
"en": "Index Name"
},
"Description": {
"zh-cn": "知识库名称,1-20个字符,支持中英文、数字、下划线、短划线、句号和冒号。",
"en": "Knowledge base name, 1-20 characters. Supports Chinese, English, numbers, underscores, hyphens, periods and colons."
},
"MinLength": 1,
"MaxLength": 20,
"Default": "my-knowledge-base"
},
"DocumentIds": {
"Type": "CommaDelimitedList",
"Label": {
"zh-cn": "文档ID列表",
"en": "Document IDs"
},
"Description": {
"zh-cn": "数据中心中已上传的文件ID列表,用于导入到知识库。",
"en": "List of file IDs already uploaded in the data center, to be imported into the knowledge base."
}
}
},
"Resources": {
"Index": {
"Type": "ALIYUN::Bailian::Index",
"Properties": {
"WorkspaceId": {
"Ref": "WorkspaceId"
},
"Name": {
"Ref": "IndexName"
},
"SourceType": "DATA_CENTER_FILE",
"StructureType": "unstructured",
"DocumentIds": {
"Ref": "DocumentIds"
},
"SinkType": "BUILT_IN",
"Description": {
"Ref": "ALIYUN::StackName"
}
}
}
},
"Outputs": {
"IndexId": {
"Description": {
"zh-cn": "知识库索引ID。",
"en": "Knowledge base index ID."
},
"Label": {
"zh-cn": "知识库索引ID",
"en": "Index ID"
},
"Value": {
"Fn::GetAtt": [
"Index",
"Id"
]
}
}
},
"Metadata": {
"ALIYUN::ROS::Interface": {
"ParameterGroups": [
{
"Parameters": [
"WorkspaceId",
"IndexName",
"DocumentIds"
]
}
]
}
}
}Scenario 2: Create a knowledge base index and configure a custom strategy and API key
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 在百炼平台创建知识库索引并配置自定义切分策略、Embedding模型、Rerank模型和元数据提取,同时创建API Key用于访问。
en: Create a knowledge base index on Bailian platform with custom chunking strategy, embedding model, rerank model, and metadata extraction, along with an API Key for access.
Parameters:
WorkspaceId:
Type: String
Label:
zh-cn: 工作空间ID
en: Workspace ID
Description:
zh-cn: 百炼平台的工作空间ID,知识库将创建在此工作空间下。
en: The workspace ID of the Bailian platform. The knowledge base will be created in this workspace.
IndexName:
Type: String
Label:
zh-cn: 知识库名称
en: Index Name
Description:
zh-cn: 知识库名称,1-20个字符。
en: Knowledge base name, 1-20 characters.
MinLength: 1
MaxLength: 20
Default: custom-kb
CategoryIds:
Type: CommaDelimitedList
Label:
zh-cn: 类目ID列表
en: Category IDs
Description:
zh-cn: 数据中心中的类目ID列表,将导入该类目下的所有文件。
en: List of category IDs in the data center. All files under these categories will be imported.
EmbeddingModelName:
Type: String
Label:
zh-cn: Embedding模型
en: Embedding Model
Description:
zh-cn: 知识库使用的Embedding模型。
en: The embedding model used by the knowledge base.
AllowedValues:
- text-embedding-v3
- text-embedding-v4
Default: text-embedding-v3
RerankModelName:
Type: String
Label:
zh-cn: Rerank模型
en: Rerank Model
Description:
zh-cn: 知识库使用的Rerank模型。
en: The rerank model used by the knowledge base.
AllowedValues:
- qwen3-rerank
- qwen3-rerank-hybrid
- gte-rerank
- gte-rerank-hybrid
Default: qwen3-rerank
ChunkSize:
Type: Number
Label:
zh-cn: 切分块大小
en: Chunk Size
Description:
zh-cn: 文本切片的最大字符数,范围1-6000。
en: Maximum number of characters per text chunk, range 1-6000.
Default: 500
MinValue: 1
MaxValue: 6000
OverlapSize:
Type: Number
Label:
zh-cn: 重叠大小
en: Overlap Size
Description:
zh-cn: 相邻文本切片之间的重叠字符数,范围0-1024,必须小于切分块大小。
en: Number of overlapping characters between adjacent text chunks, range 0-1024. Must be less than ChunkSize.
Default: 100
MinValue: 0
MaxValue: 1024
Resources:
Index:
Type: ALIYUN::Bailian::Index
Properties:
WorkspaceId:
Ref: WorkspaceId
Name:
Ref: IndexName
SourceType: DATA_CENTER_CATEGORY
StructureType: unstructured
CategoryIds:
Ref: CategoryIds
SinkType: BUILT_IN
Description: Knowledge base with custom configuration
EmbeddingModelName:
Ref: EmbeddingModelName
RerankModelName:
Ref: RerankModelName
RerankMode: qa
ChunkSize:
Ref: ChunkSize
OverlapSize:
Ref: OverlapSize
ChunkMode: length
EnableRewrite: true
EnableHeaders: true
MetaExtractColumns:
- Key: doc_source
Type: constant
Value: data-center
Desc: Document source
EnableSearch: true
EnableLlm: false
- Key: doc_keywords
Type: keywords
Desc: Extracted keywords
EnableSearch: true
EnableLlm: true
ApiKey:
Type: ALIYUN::Bailian::ApiKey
Properties:
Description:
Fn::Sub: API Key for ${IndexName}
Outputs:
IndexId:
Description:
zh-cn: 知识库索引ID。
en: Knowledge base index ID.
Label:
zh-cn: 知识库索引ID
en: Index ID
Value:
Fn::GetAtt:
- Index
- Id
ApiKeyValue:
Description:
zh-cn: API Key值,用于调用百炼服务。
en: API Key value for calling Bailian service.
Label:
zh-cn: API Key
en: API Key
Value:
Fn::GetAtt:
- ApiKey
- Key
ApiKeyId:
Description:
zh-cn: API Key ID。
en: API Key ID.
Label:
zh-cn: API Key ID
en: API Key ID
Value:
Fn::GetAtt:
- ApiKey
- ApiKeyId
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- WorkspaceId
- IndexName
- CategoryIds
- Parameters:
- EmbeddingModelName
- RerankModelName
- ChunkSize
- OverlapSize{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "在百炼平台创建知识库索引并配置自定义切分策略、Embedding模型、Rerank模型和元数据提取,同时创建API Key用于访问。",
"en": "Create a knowledge base index on Bailian platform with custom chunking strategy, embedding model, rerank model, and metadata extraction, along with an API Key for access."
},
"Parameters": {
"WorkspaceId": {
"Type": "String",
"Label": {
"zh-cn": "工作空间ID",
"en": "Workspace ID"
},
"Description": {
"zh-cn": "百炼平台的工作空间ID,知识库将创建在此工作空间下。",
"en": "The workspace ID of the Bailian platform. The knowledge base will be created in this workspace."
}
},
"IndexName": {
"Type": "String",
"Label": {
"zh-cn": "知识库名称",
"en": "Index Name"
},
"Description": {
"zh-cn": "知识库名称,1-20个字符。",
"en": "Knowledge base name, 1-20 characters."
},
"MinLength": 1,
"MaxLength": 20,
"Default": "custom-kb"
},
"CategoryIds": {
"Type": "CommaDelimitedList",
"Label": {
"zh-cn": "类目ID列表",
"en": "Category IDs"
},
"Description": {
"zh-cn": "数据中心中的类目ID列表,将导入该类目下的所有文件。",
"en": "List of category IDs in the data center. All files under these categories will be imported."
}
},
"EmbeddingModelName": {
"Type": "String",
"Label": {
"zh-cn": "Embedding模型",
"en": "Embedding Model"
},
"Description": {
"zh-cn": "知识库使用的Embedding模型。",
"en": "The embedding model used by the knowledge base."
},
"AllowedValues": [
"text-embedding-v3",
"text-embedding-v4"
],
"Default": "text-embedding-v3"
},
"RerankModelName": {
"Type": "String",
"Label": {
"zh-cn": "Rerank模型",
"en": "Rerank Model"
},
"Description": {
"zh-cn": "知识库使用的Rerank模型。",
"en": "The rerank model used by the knowledge base."
},
"AllowedValues": [
"qwen3-rerank",
"qwen3-rerank-hybrid",
"gte-rerank",
"gte-rerank-hybrid"
],
"Default": "qwen3-rerank"
},
"ChunkSize": {
"Type": "Number",
"Label": {
"zh-cn": "切分块大小",
"en": "Chunk Size"
},
"Description": {
"zh-cn": "文本切片的最大字符数,范围1-6000。",
"en": "Maximum number of characters per text chunk, range 1-6000."
},
"Default": 500,
"MinValue": 1,
"MaxValue": 6000
},
"OverlapSize": {
"Type": "Number",
"Label": {
"zh-cn": "重叠大小",
"en": "Overlap Size"
},
"Description": {
"zh-cn": "相邻文本切片之间的重叠字符数,范围0-1024,必须小于切分块大小。",
"en": "Number of overlapping characters between adjacent text chunks, range 0-1024. Must be less than ChunkSize."
},
"Default": 100,
"MinValue": 0,
"MaxValue": 1024
}
},
"Resources": {
"Index": {
"Type": "ALIYUN::Bailian::Index",
"Properties": {
"WorkspaceId": {
"Ref": "WorkspaceId"
},
"Name": {
"Ref": "IndexName"
},
"SourceType": "DATA_CENTER_CATEGORY",
"StructureType": "unstructured",
"CategoryIds": {
"Ref": "CategoryIds"
},
"SinkType": "BUILT_IN",
"Description": "Knowledge base with custom configuration",
"EmbeddingModelName": {
"Ref": "EmbeddingModelName"
},
"RerankModelName": {
"Ref": "RerankModelName"
},
"RerankMode": "qa",
"ChunkSize": {
"Ref": "ChunkSize"
},
"OverlapSize": {
"Ref": "OverlapSize"
},
"ChunkMode": "length",
"EnableRewrite": true,
"EnableHeaders": true,
"MetaExtractColumns": [
{
"Key": "doc_source",
"Type": "constant",
"Value": "data-center",
"Desc": "Document source",
"EnableSearch": true,
"EnableLlm": false
},
{
"Key": "doc_keywords",
"Type": "keywords",
"Desc": "Extracted keywords",
"EnableSearch": true,
"EnableLlm": true
}
]
}
},
"ApiKey": {
"Type": "ALIYUN::Bailian::ApiKey",
"Properties": {
"Description": {
"Fn::Sub": "API Key for ${IndexName}"
}
}
}
},
"Outputs": {
"IndexId": {
"Description": {
"zh-cn": "知识库索引ID。",
"en": "Knowledge base index ID."
},
"Label": {
"zh-cn": "知识库索引ID",
"en": "Index ID"
},
"Value": {
"Fn::GetAtt": [
"Index",
"Id"
]
}
},
"ApiKeyValue": {
"Description": {
"zh-cn": "API Key值,用于调用百炼服务。",
"en": "API Key value for calling Bailian service."
},
"Label": {
"zh-cn": "API Key",
"en": "API Key"
},
"Value": {
"Fn::GetAtt": [
"ApiKey",
"Key"
]
}
},
"ApiKeyId": {
"Description": {
"zh-cn": "API Key ID。",
"en": "API Key ID."
},
"Label": {
"zh-cn": "API Key ID",
"en": "API Key ID"
},
"Value": {
"Fn::GetAtt": [
"ApiKey",
"ApiKeyId"
]
}
}
},
"Metadata": {
"ALIYUN::ROS::Interface": {
"ParameterGroups": [
{
"Parameters": [
"WorkspaceId",
"IndexName",
"CategoryIds"
]
},
{
"Parameters": [
"EmbeddingModelName",
"RerankModelName",
"ChunkSize",
"OverlapSize"
]
}
]
}
}
}Scenario 3: Create an Enterprise knowledge base solution
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建完整的企业级百炼知识库方案,包含ADB向量存储实例、企业级知识库索引(高级检索配置)、API Key访问控制(IP白名单),实现高可用知识库服务。
en: Create a complete enterprise-level Bailian knowledge base solution including ADB vector storage instance, enterprise knowledge base index with advanced retrieval configuration, and API Key with IP whitelist access control.
Parameters:
WorkspaceId:
Type: String
Label:
zh-cn: 工作空间ID
en: Workspace ID
Description:
zh-cn: 百炼平台的工作空间ID。
en: The workspace ID of the Bailian platform.
IndexName:
Type: String
Label:
zh-cn: 知识库名称
en: Index Name
Description:
zh-cn: 知识库名称,1-20个字符。
en: Knowledge base name, 1-20 characters.
MinLength: 1
MaxLength: 20
Default: enterprise-kb
DocumentIds:
Type: CommaDelimitedList
Label:
zh-cn: 文档ID列表
en: Document IDs
Description:
zh-cn: 数据中心中已上传的文件ID列表。
en: List of file IDs already uploaded in the data center.
ZoneId:
Type: String
Label:
zh-cn: 可用区
en: Availability Zone
Description:
zh-cn: ADB实例所在的可用区。
en: The availability zone for the ADB instance.
AssociationProperty: ALIYUN::ECS::Instance::ZoneId
AssociationPropertyMetadata:
AutoSelectFirst: true
VpcId:
Type: String
Label:
zh-cn: VPC ID
en: VPC ID
Description:
zh-cn: ADB实例所属的VPC。
en: The VPC for the ADB instance.
AssociationProperty: ALIYUN::ECS::VPC::VPCId
VSwitchId:
Type: String
Label:
zh-cn: 交换机ID
en: VSwitch ID
Description:
zh-cn: ADB实例所属的交换机。
en: The VSwitch for the ADB instance.
AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
AssociationPropertyMetadata:
VpcId: ${VpcId}
ZoneId: ${ZoneId}
DenseSimilarityTopK:
Type: Number
Label:
zh-cn: 向量检索TopK
en: Dense Similarity Top K
Description:
zh-cn: 通过向量相似度检索最相似的K个文本切片,范围0-100。
en: Retrieve the K most similar text chunks by vector similarity, range 0-100.
Default: 80
MinValue: 0
MaxValue: 100
SparseSimilarityTopK:
Type: Number
Label:
zh-cn: 关键词检索TopK
en: Sparse Similarity Top K
Description:
zh-cn: 通过关键词精确匹配检索文本切片,范围0-100。DenseSimilarityTopK + SparseSimilarityTopK 必须 <= 200。
en: Retrieve text chunks by exact keyword matching, range 0-100. DenseSimilarityTopK + SparseSimilarityTopK must be <= 200.
Default: 60
MinValue: 0
MaxValue: 100
RerankMinScore:
Type: Number
Label:
zh-cn: 相似度阈值
en: Rerank Min Score
Description:
zh-cn: 仅召回相似度分数超过该值的文本切片,范围0.01-1.00。
en: Only recall text chunks with similarity score exceeding this value, range 0.01-1.00.
Default: 0.2
AllowedIpList:
Type: CommaDelimitedList
Label:
zh-cn: API Key允许的IP白名单
en: API Key Allowed IP List
Description:
zh-cn: 允许访问API的IP地址列表。
en: List of IP addresses allowed to access the API.
Default:
- 0.0.0.0/0
Resources:
ADBInstance:
Type: ALIYUN::ADB::DBCluster
Properties:
ZoneId:
Ref: ZoneId
VPCId:
Ref: VpcId
VSwitchId:
Ref: VSwitchId
DBClusterDescription:
Fn::Sub: Vector storage for ${IndexName}
DBClusterClass: T8
DBClusterCategory: Basic
DBClusterVersion: '3.0'
Mode: Reserved
PayType: Postpaid
DBNodeGroupCount: 1
DBNodeStorage: 100
Index:
Type: ALIYUN::Bailian::Index
DependsOn: ADBInstance
Properties:
WorkspaceId:
Ref: WorkspaceId
Name:
Ref: IndexName
SourceType: DATA_CENTER_FILE
StructureType: unstructured
DocumentIds:
Ref: DocumentIds
SinkType: ADB
SinkInstanceId:
Ref: ADBInstance
SinkRegion:
Ref: ALIYUN::Region
Description: Enterprise knowledge base with ADB vector storage
EmbeddingModelName: text-embedding-v3
RerankModelName: qwen3-rerank
RerankMode: custom
RerankInstruct: Rank documents by relevance to the user query, prioritizing accuracy and completeness of information.
RerankMinScore:
Ref: RerankMinScore
ChunkSize: 800
OverlapSize: 150
ChunkMode: length
EnableRewrite: true
EnableHeaders: true
PipelineCommercialType: enterprise
PipelineCommercialCu: 4
DenseSimilarityTopK:
Ref: DenseSimilarityTopK
SparseSimilarityTopK:
Ref: SparseSimilarityTopK
MetaExtractColumns:
- Key: doc_category
Type: constant
Value: enterprise-doc
Desc: Document category
EnableSearch: true
EnableLlm: false
- Key: doc_summary
Type: custom_prompt
Value: Please summarize the key points of this document in one sentence.
Desc: AI-generated document summary
EnableSearch: true
EnableLlm: true
- Key: doc_keywords
Type: keywords
Desc: Extracted keywords
EnableSearch: true
EnableLlm: true
ApiKey:
Type: ALIYUN::Bailian::ApiKey
Properties:
Description:
Fn::Sub: API Key for ${IndexName}
AuthSetModel:
AuthSetMode: Custom
AccessIps:
Ref: AllowedIpList
Outputs:
IndexId:
Description:
zh-cn: 知识库索引ID。
en: Knowledge base index ID.
Label:
zh-cn: 知识库索引ID
en: Index ID
Value:
Fn::GetAtt:
- Index
- Id
ADBInstanceId:
Description:
zh-cn: ADB向量存储实例ID。
en: ADB vector storage instance ID.
Label:
zh-cn: ADB实例ID
en: ADB Instance ID
Value:
Ref: ADBInstance
ApiKeyValue:
Description:
zh-cn: API Key值,用于调用百炼服务。
en: API Key value for calling Bailian service.
Label:
zh-cn: API Key
en: API Key
Value:
Fn::GetAtt:
- ApiKey
- Key
ApiKeyId:
Description:
zh-cn: API Key ID。
en: API Key ID.
Label:
zh-cn: API Key ID
en: API Key ID
Value:
Fn::GetAtt:
- ApiKey
- ApiKeyId
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- WorkspaceId
- IndexName
- DocumentIds
- Parameters:
- ZoneId
- VpcId
- VSwitchId
- Parameters:
- DenseSimilarityTopK
- SparseSimilarityTopK
- RerankMinScore
- AllowedIpList{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "创建完整的企业级百炼知识库方案,包含ADB向量存储实例、企业级知识库索引(高级检索配置)、API Key访问控制(IP白名单),实现高可用知识库服务。",
"en": "Create a complete enterprise-level Bailian knowledge base solution including ADB vector storage instance, enterprise knowledge base index with advanced retrieval configuration, and API Key with IP whitelist access control."
},
"Parameters": {
"WorkspaceId": {
"Type": "String",
"Label": {
"zh-cn": "工作空间ID",
"en": "Workspace ID"
},
"Description": {
"zh-cn": "百炼平台的工作空间ID。",
"en": "The workspace ID of the Bailian platform."
}
},
"IndexName": {
"Type": "String",
"Label": {
"zh-cn": "知识库名称",
"en": "Index Name"
},
"Description": {
"zh-cn": "知识库名称,1-20个字符。",
"en": "Knowledge base name, 1-20 characters."
},
"MinLength": 1,
"MaxLength": 20,
"Default": "enterprise-kb"
},
"DocumentIds": {
"Type": "CommaDelimitedList",
"Label": {
"zh-cn": "文档ID列表",
"en": "Document IDs"
},
"Description": {
"zh-cn": "数据中心中已上传的文件ID列表。",
"en": "List of file IDs already uploaded in the data center."
}
},
"ZoneId": {
"Type": "String",
"Label": {
"zh-cn": "可用区",
"en": "Availability Zone"
},
"Description": {
"zh-cn": "ADB实例所在的可用区。",
"en": "The availability zone for the ADB instance."
},
"AssociationProperty": "ALIYUN::ECS::Instance::ZoneId",
"AssociationPropertyMetadata": {
"AutoSelectFirst": true
}
},
"VpcId": {
"Type": "String",
"Label": {
"zh-cn": "VPC ID",
"en": "VPC ID"
},
"Description": {
"zh-cn": "ADB实例所属的VPC。",
"en": "The VPC for the ADB instance."
},
"AssociationProperty": "ALIYUN::ECS::VPC::VPCId"
},
"VSwitchId": {
"Type": "String",
"Label": {
"zh-cn": "交换机ID",
"en": "VSwitch ID"
},
"Description": {
"zh-cn": "ADB实例所属的交换机。",
"en": "The VSwitch for the ADB instance."
},
"AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
"AssociationPropertyMetadata": {
"VpcId": "${VpcId}",
"ZoneId": "${ZoneId}"
}
},
"DenseSimilarityTopK": {
"Type": "Number",
"Label": {
"zh-cn": "向量检索TopK",
"en": "Dense Similarity Top K"
},
"Description": {
"zh-cn": "通过向量相似度检索最相似的K个文本切片,范围0-100。",
"en": "Retrieve the K most similar text chunks by vector similarity, range 0-100."
},
"Default": 80,
"MinValue": 0,
"MaxValue": 100
},
"SparseSimilarityTopK": {
"Type": "Number",
"Label": {
"zh-cn": "关键词检索TopK",
"en": "Sparse Similarity Top K"
},
"Description": {
"zh-cn": "通过关键词精确匹配检索文本切片,范围0-100。DenseSimilarityTopK + SparseSimilarityTopK 必须 <= 200。",
"en": "Retrieve text chunks by exact keyword matching, range 0-100. DenseSimilarityTopK + SparseSimilarityTopK must be <= 200."
},
"Default": 60,
"MinValue": 0,
"MaxValue": 100
},
"RerankMinScore": {
"Type": "Number",
"Label": {
"zh-cn": "相似度阈值",
"en": "Rerank Min Score"
},
"Description": {
"zh-cn": "仅召回相似度分数超过该值的文本切片,范围0.01-1.00。",
"en": "Only recall text chunks with similarity score exceeding this value, range 0.01-1.00."
},
"Default": 0.2
},
"AllowedIpList": {
"Type": "CommaDelimitedList",
"Label": {
"zh-cn": "API Key允许的IP白名单",
"en": "API Key Allowed IP List"
},
"Description": {
"zh-cn": "允许访问API的IP地址列表。",
"en": "List of IP addresses allowed to access the API."
},
"Default": [
"0.0.0.0/0"
]
}
},
"Resources": {
"ADBInstance": {
"Type": "ALIYUN::ADB::DBCluster",
"Properties": {
"ZoneId": {
"Ref": "ZoneId"
},
"VPCId": {
"Ref": "VpcId"
},
"VSwitchId": {
"Ref": "VSwitchId"
},
"DBClusterDescription": {
"Fn::Sub": "Vector storage for ${IndexName}"
},
"DBClusterClass": "T8",
"DBClusterCategory": "Basic",
"DBClusterVersion": "3.0",
"Mode": "Reserved",
"PayType": "Postpaid",
"DBNodeGroupCount": 1,
"DBNodeStorage": 100
}
},
"Index": {
"Type": "ALIYUN::Bailian::Index",
"DependsOn": "ADBInstance",
"Properties": {
"WorkspaceId": {
"Ref": "WorkspaceId"
},
"Name": {
"Ref": "IndexName"
},
"SourceType": "DATA_CENTER_FILE",
"StructureType": "unstructured",
"DocumentIds": {
"Ref": "DocumentIds"
},
"SinkType": "ADB",
"SinkInstanceId": {
"Ref": "ADBInstance"
},
"SinkRegion": {
"Ref": "ALIYUN::Region"
},
"Description": "Enterprise knowledge base with ADB vector storage",
"EmbeddingModelName": "text-embedding-v3",
"RerankModelName": "qwen3-rerank",
"RerankMode": "custom",
"RerankInstruct": "Rank documents by relevance to the user query, prioritizing accuracy and completeness of information.",
"RerankMinScore": {
"Ref": "RerankMinScore"
},
"ChunkSize": 800,
"OverlapSize": 150,
"ChunkMode": "length",
"EnableRewrite": true,
"EnableHeaders": true,
"PipelineCommercialType": "enterprise",
"PipelineCommercialCu": 4,
"DenseSimilarityTopK": {
"Ref": "DenseSimilarityTopK"
},
"SparseSimilarityTopK": {
"Ref": "SparseSimilarityTopK"
},
"MetaExtractColumns": [
{
"Key": "doc_category",
"Type": "constant",
"Value": "enterprise-doc",
"Desc": "Document category",
"EnableSearch": true,
"EnableLlm": false
},
{
"Key": "doc_summary",
"Type": "custom_prompt",
"Value": "Please summarize the key points of this document in one sentence.",
"Desc": "AI-generated document summary",
"EnableSearch": true,
"EnableLlm": true
},
{
"Key": "doc_keywords",
"Type": "keywords",
"Desc": "Extracted keywords",
"EnableSearch": true,
"EnableLlm": true
}
]
}
},
"ApiKey": {
"Type": "ALIYUN::Bailian::ApiKey",
"Properties": {
"Description": {
"Fn::Sub": "API Key for ${IndexName}"
},
"AuthSetModel": {
"AuthSetMode": "Custom",
"AccessIps": {
"Ref": "AllowedIpList"
}
}
}
}
},
"Outputs": {
"IndexId": {
"Description": {
"zh-cn": "知识库索引ID。",
"en": "Knowledge base index ID."
},
"Label": {
"zh-cn": "知识库索引ID",
"en": "Index ID"
},
"Value": {
"Fn::GetAtt": [
"Index",
"Id"
]
}
},
"ADBInstanceId": {
"Description": {
"zh-cn": "ADB向量存储实例ID。",
"en": "ADB vector storage instance ID."
},
"Label": {
"zh-cn": "ADB实例ID",
"en": "ADB Instance ID"
},
"Value": {
"Ref": "ADBInstance"
}
},
"ApiKeyValue": {
"Description": {
"zh-cn": "API Key值,用于调用百炼服务。",
"en": "API Key value for calling Bailian service."
},
"Label": {
"zh-cn": "API Key",
"en": "API Key"
},
"Value": {
"Fn::GetAtt": [
"ApiKey",
"Key"
]
}
},
"ApiKeyId": {
"Description": {
"zh-cn": "API Key ID。",
"en": "API Key ID."
},
"Label": {
"zh-cn": "API Key ID",
"en": "API Key ID"
},
"Value": {
"Fn::GetAtt": [
"ApiKey",
"ApiKeyId"
]
}
}
},
"Metadata": {
"ALIYUN::ROS::Interface": {
"ParameterGroups": [
{
"Parameters": [
"WorkspaceId",
"IndexName",
"DocumentIds"
]
},
{
"Parameters": [
"ZoneId",
"VpcId",
"VSwitchId"
]
},
{
"Parameters": [
"DenseSimilarityTopK",
"SparseSimilarityTopK",
"RerankMinScore",
"AllowedIpList"
]
}
]
}
}
}