Skip to main content

Create a Knowledge Base

Pick a Knowledge Base type and use case, then configure parsing and chunking.

A Knowledge Base is the core entity in the Knowledge platform. It groups documents, Chunks, embeddings, and index configuration together and exposes retrieval and Q&A capabilities.

Knowledge Base types

When you create a Knowledge Base, choose a type. Each type uses a different data format and retrieval method:
TypeDataRetrieval methodNotes
Unstructured DocumentsPDF / Word / Markdown / HTML / ExcelHybrid vector + keywordBuilds a mixed index for documents, files, images, and Excel sheets.
Structured dataCSV / Excel / RDS tablesNatural-language-to-SQLQueries tables by schema (NL2SQL).
Image libraryProduct photos / design filesMultimodal embeddingImage-first indexing; supports image search and visual Q&A.
Audio / video libraryScreen recordings / training videosTranscription + segment locatingFused understanding and summarization of audio/video content.

Use cases

When you choose Unstructured Documents, you must further pick a use case. The use case determines the retrieval and answering strategy:
Use caseDescription
Basic Document Q&ARetrieves document Chunks and generates answers directly with the LLM.
Visual Understanding (rich-text documents)No chunking; the LLM directly interprets visually rich documents and images.
Ultra-Fast Q&AFor highly structured or simple documents; ultra-low-latency Q&A.
Other types (Structured data, Image library, Audio / video library) have no use-case option. The console no longer offers the "Rich-Media Responses" use case. When you create a Knowledge Base through the API, knowledgeScene still accepts the corresponding value visual_document_qa, but it is not recommended for new Knowledge Bases.

Create from the console

1

Open Knowledge Management

Sign in to the console and go to Data Ingestion → Knowledge Management. Click Create Knowledge Base in the top right and choose an edition: Standard (0.03 yuan/hour, for quick experiments and business validation with shared compute) or Flagship (0.2 yuan/RCU/hour, for stable workloads with configurable compute and higher retrieval QPS).
2

Fill in basic info

FieldRequiredNotes
NameYes1–20 characters, unique within the workspace.
DescriptionYesUp to 200 characters, used in filtering.
TypeYesUnstructured Documents / Structured data / Image library / Audio / video library.
Use caseYesBasic Document Q&A / Visual Understanding / Ultra-Fast Q&A.
3

Import data

Choose a data source:
Data sourceDescription
Upload filesUpload via the UI, up to 50 files per batch; see Limits for sizes and formats.
Select categoryImport from a connector file category; supports automatic sync.
Select filesPick specific files under a connector category.
Supported formats: PDF / DOCX / XLSX / PPTX / TXT / MD / HTML / CSV, etc.For Structured data Knowledge Bases, Excel data tables (.xls / .xlsx) must not exceed 20 MB per file. For Audio / video libraries, each file must not exceed 512 MB; the total number of audio and video files is limited to 10 in Standard edition and is unlimited in Flagship edition.
4

Pick a parsing method

By default, Default settings lets the system choose a parser by file type; no adjustment is needed in most cases.To configure per format, click Custom settings. Available parsers:
Parsing methodDescriptionBest for
Native document parsingStandard text extraction.Clean electronic documents.
Document Intelligence ParsingLayout-aware OCR + structure recovery.Scans and complex layouts.
LLM-based parsingAn LLM interprets the document structure.Non-standard formats.
Qwen-VL parsingVisual language model.Documents that mix text and images.
Audio / video parsingSpeech-to-text with timestamp locating.Audio and video files.
5

Configure index settings

ParameterDefaultNotes
Chunking methodSmart ChunkingAlternatives: by length / by page / by heading / by regex / by delimiter.
Max chunk length600Range 10–6000.
Embedding modelqwen3.7-text-embeddingMultilingual text vector model; text-embedding-v4 is also available.
Vector storagePlatform storageAlternative: self-managed ADB-PG engine.
To filter documents by attributes such as product name, author, category, or date, enable Metadata Extraction during Knowledge Base creation and click Settings to configure the metadata template:
  • Add up to five fields. Field names can contain only English letters and underscores.
  • Available value methods are Constant (a fixed value), Variable (file_name or cat_name), LLM (extraction based on an entity description), RegEx (expression matching), and Keyword Search (matching preset keywords separated by English commas).
  • Used for Retrieval and Used for Model Reply have separate toggles. The former controls whether metadata fields and values participate in retrieval with the Chunk; the latter controls whether they are passed to the LLM as input for response generation.
  • Metadata extraction cannot be added after the Knowledge Base is created. Create a new Knowledge Base and reimport the documents to use this feature.
After the index is built, click Meta Info for a document in the document list to view its extracted values. This entry does not support manual editing.See Chunking and Embedding for details.
Retrieval parameters such as the rerank model, TopK, and similarity threshold are configured in the retrieval service. See Knowledge Retrieval.
6

Create

Click Create Knowledge Base. The system automatically parses, chunks, embeds, and builds the index. Once the status becomes Ready, the Knowledge Base can be retrieved. Track progress in the document list.

Create through the API

Use the Create Knowledge Base and Import endpoint to create a Knowledge Base and submit an import job in one call:
curl -X POST https://{workspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/indices/rag/index/create_v2 \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-knowledge-base",
    "structureType": "unstructured",
    "sinkType": "BUILT_IN",
    "sourceType": "DATA_CENTER_CATEGORY",
    "embeddingModelName": "text-embedding-v4",
    "chunkSize": 600,
    "categoryIds": ["cate_xxx"]
  }'
You can change the chunking strategy after creation, but changing the embedding model triggers a full index rebuild. For complete capacity limits, see Limits.
Once the Knowledge Base is created, move on to Upload Documents.
Flagship Knowledge Bases can enable Wiki and the ontology knowledge graph to organize documents into readable, retrievable topic pages. See Wiki and Ontology Knowledge Graph.