Skip to main content
Data Ingestion

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:
TypeApplicable DataRetrieval MethodDescription
Document SearchPDF / Word / Markdown / HTML / ExcelHybrid Vector + KeywordBuilds a mixed-index for documents, files, images, and Excel sheets
Data QueryCSV / Excel / RDS TablesNatural Language to SQL (NL2SQL)Queries structured tables based on schema; supports NL2SQL for headers and column names
Image Q&AProduct Images / Design MockupsMultimodal EmbeddingPrimarily indexes images; supports image search and multimodal (image + text) Q&A
Audio/Video SearchScreen Recordings / Training VideosTranscription + Segment LocalizationIntegrates 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 CaseDescription
Basic Document Q&ARetrieves document chunks and directly generates answers using the LLM
Rich-Media ResponsesAutomatically 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&AOptimized for highly structured or simple documents, delivering ultra-low-latency Q&A
Other knowledge base types—Data Query, Image Q&A, and Audio/Video Search—do not offer use case options.
Knowledge Base Type and Use Case Selection
Above: Select the knowledge base type. When Document Search is selected, four use cases appear below. For other types, no use case selection is required.

Console-Based Creation

1

Navigate to Knowledge Management

Log in to the console and go to Data Ingestion → Knowledge Management, then click Create Knowledge Base in the top-right corner.
2

Enter Basic Information

FieldRequiredDescription
NameYes1–20 characters; unique within the business space
DescriptionYesUp to 200 characters; aids filtering
Knowledge Base TypeYesDocument Search / Data Query / Image Q&A / Audio/Video Search
Use CaseYesBasic Document Q&A / Rich-Media Responses / Visual Understanding / Ultra-Fast Q&A
3

Import Data

Choose a data source:
Data SourceDescription
Upload FilesUpload files directly via the UI; up to 50 files per batch, each ≤ 150 MB
Select CategoryImport from connector file categories; supports automatic synchronization
Select FilesChoose specific files under a connector category for import
Supported formats: PDF / DOCX / XLSX / PPTX / TXT / MD / HTML / CSV, etc.
4

Choose 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 MethodDescriptionApplicable Scenarios
Electronic Document ParsingStandard text extractionWell-formatted electronic documents
Intelligent Document ParsingLayout-level OCR + structural recoveryScanned documents, complex layouts
LLM-based Document ParsingUses large language models to understand document structureNon-standard or irregular document formats
Qwen-VL ParsingVision-language modelDocuments with mixed text and images
Audio/Video ParsingSpeech-to-text transcription + timestamped segment localizationAudio/video files
5

Configure Index Settings

ParameterDefault ValueDescription
Chunking MethodSmart ChunkingAlternatives: by length / by page / by heading / by regex / by delimiter
Maximum Chunk Length600Range: 10–6000
Embedding Modeltext-embedding-v4Semantic vector model supporting both Chinese and English
Vector StoragePlatform StorageAlternative: self-managed ADB-PG engine
See Chunking and Vectorization for details.
Index Settings
Retrieval parameters—including ranking model, TopK, and similarity threshold—are configured in the retrieval service. See Knowledge Retrieval for details.
6

Complete 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 Knowledge Base and Import Data API to create a knowledge base and submit an import task in one step:
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,
    "source_ids": ["cate_xxx"]
  }'
Chunking strategies can be adjusted after creation, but changing the embedding model triggers full index reconstruction. For complete capacity limits, see Capacity and Limits.
After creating your knowledge base, proceed to Upload Documents.