Knowledge Base type and usage scenario
knowledgeType and knowledgeScene correspond to Knowledge Base Type and Usage Scenario in step 1 of the console creation wizard. They must be supplied together or omitted together — sending only one returns knowledgeType and knowledgeScene cannot be empty. When both are omitted, the system applies defaults based on structureType.
The console only offers a Usage Scenario choice for Document Search. The other three types have a fixed scenario that the console fills in automatically, but you must still send the pair explicitly when creating a Knowledge Base through the API.
| knowledgeType | Console label | structureType | Available knowledgeScene |
|---|---|---|---|
document | Document Search | unstructured | basic_document_qa (basic document Q&A)visual_perception_qa (visual understanding, rich text documents)lite_document_qa (express Q&A) |
table | Data Query | structured | basic_table_qa (fixed) |
image | Image Q&A | unstructured | image_qa (fixed) |
multimedia | Audio and Video Search | unstructured | basic_multimedia_qa (fixed) |
- An incompatible
knowledgeTypeandstructureTypepair returnsknowledgeType and structureType do not match. AknowledgeScenethat does not belong to the selected type returnsknowledgeType and knowledgeScene do not match. lite_document_qa(express Q&A) requiressinkTypeto beBUILT_IN. Using the defaultDEFAULTreturnsLite Rag only supports BUILT_IN sink type.visual_perception_qaandimage_qamust specify a multimodal embedding model throughmultimodalEmbeddingModelName(for exampleqwen3-vl-embedding), otherwise the request returnsinvalid multi embedding model.- The
documenttype also has avisual_document_qa(rich media answers) scenario. The API still accepts this value, but the console no longer exposes it, so avoid it for new Knowledge Bases.
Authorizations
DashScope API Key, obtained from the API Key page in the console.
Body
application/jsonKnowledge Base name. 1-20 characters.
Knowledge Base description. 1-200 characters.
Structure type — unstructured or structured.
Storage type. Defaults to DEFAULT. BUILT_IN uses the platform's built-in vector storage and is required when knowledgeScene is lite_document_qa (express Q&A).
Data source type, for example DATA_CENTER_FILE.
Required. File IDs to import at creation time. Values come from the fileId returned by addFile, or query existing files via listFile. Up to 10000 files recommended. The parameter name is docIds, not file_ids or fileIds; however, the validation error message uses the internal name file_ids.
Data source configuration list.
Knowledge Base type, matching the Knowledge Base Type option in the console: document (document search), table (data query), image (image Q&A), multimedia (audio and video search). The value must be compatible with structureType: use unstructured for document, image, and multimedia, and structured for table. Must be supplied together with knowledgeScene, or omitted together with it. When both are omitted, the system applies defaults based on structureType.
Usage scenario, matching the Usage Scenario option in the console. Valid values depend on knowledgeType: document supports basic_document_qa (basic document Q&A), visual_perception_qa (visual understanding, rich text documents), and lite_document_qa (express Q&A); table is fixed to basic_table_qa; image is fixed to image_qa; multimedia is fixed to basic_multimedia_qa. The console only offers a scenario choice for Document Search and fills in the fixed value for the other types, but you must still send it explicitly through the API. Must be supplied together with knowledgeType, or omitted together with it. Note: lite_document_qa requires sinkType to be BUILT_IN, and visual_perception_qa and image_qa require a multimodal embedding model set through multimodalEmbeddingModelName. The document type also accepts visual_document_qa (rich media answers), which the console no longer exposes.
Embedding model name, for example text-embedding-v4.
Multimodal embedding model name, for example qwen3-vl-embedding. Required when knowledgeScene is image_qa (image Q&A) or visual_perception_qa (visual understanding). A missing or invalid value returns invalid multi embedding model.
Document Chunk size, in characters. Recommended range 300-800.
Category ID list.