Create a knowledge base
Select the knowledge base type and use case, then configure parsing and chunking strategies.
A knowledge base is the core entity of the RAG platform, organizing a set of documents, chunks, embeddings, and index configurations to provide retrieval and question-answering capabilities.
Knowledge base types
You must select a knowledge base type during creation. Each type corresponds to different data formats and retrieval methods:
| Type | Applicable Data | Retrieval Method | Description |
|---|---|---|---|
| Document Search | PDF / Word / Markdown / HTML / Excel | Hybrid Vector + Keyword | Builds a mixed-index for documents, files, images, and Excel sheets |
| Data Query | CSV / Excel / RDS Tables | Natural Language to SQL (NL2SQL) | Queries structured tables based on schema; supports NL2SQL for headers and column names |
| Image Q&A | Product Images / Design Mockups | Multimodal Embedding | Primarily indexes images; supports image search and multimodal (image + text) Q&A |
| Audio/Video Search | Screen Recordings / Training Videos | Transcription + Segment Localization | Integrates understanding and intelligent summarization of audio/video content |
Use cases
When selecting Document Search as the knowledge base type, you must further specify a use case. Different use cases determine distinct retrieval and response-generation strategies:
| Use Case | Description |
|---|---|
| Basic Document Q&A | Retrieves document chunks and directly generates answers using the LLM |
| Rich-Media Responses | Automatically formats responses with layout and relevant images, generating rich-media replies |
| Visual Understanding (Rich Text Documents) | No chunking required; the LLM directly interprets visually rich documents and images |
| Ultra-Fast Q&A | Optimized for highly structured or simple documents, delivering ultra-low-latency Q&A |
NoteOther knowledge base types—Data Query, Image Q&A, and Audio/Video Search—do not offer use case options.
Console-based creation
-
Navigate to Knowledge Management: Log on to the console and go to Data Ingestion → Knowledge Management, then click Create Knowledge Base in the top-right corner.
-
Enter basic information:
Field Required Description Name Yes 1–20 characters; unique within the workspace Description Yes Up to 200 characters; aids filtering Knowledge Base Type Yes Document Search / Data Query / Image Q&A / Audio/Video Search Use Case Yes Basic Document Q&A / Rich-Media Responses / Visual Understanding / Ultra-Fast Q&A -
Import data: Choose a data source.
Data Source Description Upload Files Upload files directly via the UI; up to 50 files per batch, each ≤ 150 MB Select Category Import from dataset file categories; supports automatic synchronization Select Files Choose specific files under a dataset category for import Supported formats: PDF / DOCX / XLSX / PPTX / TXT / MD / HTML / CSV, etc.
-
Choose a parsing method: By default, Default Settings are used—the system automatically selects an appropriate parser based on file type, requiring no manual adjustment in most scenarios.
To customize parsing per format, click Custom Settings. Available parsing methods include:
Parsing Method Description Applicable Scenarios Electronic Document Parsing Standard text extraction Well-formatted electronic documents Intelligent Document Parsing Layout-level OCR + structural recovery Scanned documents, complex layouts LLM-based Document Parsing Uses large language models to understand document structure Non-standard or irregular document formats Qwen-VL Parsing Vision-language model Documents with mixed text and images Audio/Video Parsing Speech-to-text transcription + timestamped segment localization Audio/video files -
Configure index settings:
Parameter Default Value Description Chunking Method Smart Chunking Alternatives: by length / by page / by heading / by regex / by delimiter Maximum Chunk Length 600 Range: 10–6000 Embedding Model text-embedding-v4 Semantic vector model supporting both Chinese and English Vector Storage Platform Storage Alternative: self-managed ADB-PG engine See Chunking and vectorization for details.
NoteRetrieval parameters—including ranking model, TopK, and similarity threshold—are configured in the retrieval service. See Knowledge retrieval for details.
-
Complete the creation: Click Create Knowledge Base. The system automatically performs parsing, chunking, vectorization, and index building. Once the knowledge base status changes to Ready, it becomes available for retrieval. Processing progress can be monitored in the document list.
API-based creation
Use the Create a knowledge base and import data API to create a knowledge base and submit an import task in one step:
curl -X POST https://{workspace_id}.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,
"source_ids": ["cate_xxx"]
}'
NoteChunking strategies can be adjusted after creation, but changing the embedding model triggers full index reconstruction. For complete capacity limits, see Capacity and limits.
ImportantAfter creating your knowledge base, proceed to Upload documents.