Skip to main content

Creating and Using Knowledge Bases

Knowledge bases supplement LLMs with proprietary data and up-to-date information. Based on RAG technology, the model first retrieves relevant content from the knowledge base before generating an answer, improving accuracy.

Knowledge base features are only available in the China (Beijing) region. Other regions such as Singapore and Germany (Frankfurt) do not support knowledge base features.
Application without a dedicated knowledge base Without a dedicated knowledge base, LLMs cannot accurately answer questions in specific domains. For example, when a user sends "Help me pick the best camera phone from Alibaba Cloud Bailian, under 3,000 CNY" in the chat interface, the AI assistant cannot provide accurate product recommendations due to lack of relevant knowledge. Application with a dedicated knowledge base With a dedicated knowledge base, the LLM can accurately answer domain-specific questions.

Supported Models

The following models support knowledge bases. Pre-built models (standard models supported by Alibaba Cloud Bailian)
  • Qwen QwQ/Long/Max/Plus/Turbo/Coder/Deep-Research
  • Qwen VL-Max/Plus/Flash/OCR
  • Qwen Open-source (Qwen3, Qwen2.5, Qwen2, etc.)
  • Third-party text generation models (DeepSeek-R1, DeepSeek-V3.1, abab6.5s, Llama3.1, Yi-Large, etc.)
Custom models (fine-tuned on Alibaba Cloud Bailian)
Refers to custom models fine-tuned from the following models.
  • Qwen-Plus/Turbo
  • Qwen VL-Max/Plus
  • Qwen Open-source (Qwen3, Qwen2.5, Qwen2, etc.)
The above list may be updated at any time. Please refer to the models actually available when creating an application on the Application Management page.

Creating a Knowledge Base

  1. Go to the Data Ingestion > Knowledge Management page and click Create Knowledge Base.
  2. Fill in Name and Description, select the knowledge base type (Document Search, Data Query, or Image Q&A), and click Next.
  3. Select the data source (Upload Files or Import from Dataset) and upload documents.
  4. Keep the default index settings, click Create Knowledge Base.
The system automatically performs parsing, chunking, vectorization, and index building. The knowledge base is ready for retrieval when its status becomes Ready.
Once a knowledge base is created, the data source cannot be changed. Metadata extraction must be configured at creation time; it cannot be added later.

Using the Knowledge Base in Applications

In Agent Applications

  1. Go to the Application Management page and open the application configuration.
  2. In the Knowledge Base section, find the Retrieval Strategy area. On first configuration, click Configure Now to open the service selection panel.
  3. In the Configure Retrieval Service panel, find the published retrieval service and click Link.
The new agent (Agent 2.0) uses knowledge bases via knowledge retrieval services. One retrieval service can contain one or more knowledge bases. The service must be created and published before it can be linked. See Knowledge Retrieval.

In Workflow Applications

In the workflow canvas, add a Knowledge Base node and configure the input variables and knowledge base selection.

Via API

Applications process files according to the saved configuration (pre-parse toggle, knowledge base association). See Knowledge Base API Guide for the complete API reference.

Optimizing Knowledge Base Performance

For knowledge bases with incomplete recall or inaccurate content:
  1. Content truncation: If file content is truncated by Token limits, adjust the max parse length and max assembly length parameters. For very long files, use the retrieval mode.
  2. Poor retrieval quality: Optimize your queries to be more specific. Adjust the chunk size to improve retrieval completeness.
  3. File quality: Parsers may struggle with low-clarity scans, complex tables, or poorly encoded text files. Provide clear, well-structured source files.
See Knowledge Base Optimization for details.

Quotas and Limits

CategoryLimit
Knowledge basesRDS: 100; others: unlimited
Files per business space100,000
Platform storageFlagship: 9,999 GB; Standard: 100 GB
See Quotas and Limits for the complete list.