Knowledge base

Updated at:
Copy as MD

This topic explains how to activate and try out a knowledge base in the Alibaba Cloud console. You will grant RAM permissions, create a resource, import data, inspect chunks, run retrieval tests, try chat, and publish a version. You can complete the entire process in the Vector Retrieval Service for Milvus console without writing code.

After completing this topic, you will have a knowledge base that can import enterprise documents, generate vector indexes, and return relevant chunks. You can then use APIs or SDKs to integrate it into customer service question answering, content search, developer assistants, and other applications.

What is a knowledge base?

A knowledge base organizes documents, spreadsheets, images, audio, and video by scenario or domain. The system parses the imported data, splits the content into chunks, and generates vectors. When you run a query, it retrieves chunks relevant to the question.

The console organizes the knowledge base workflow into four stages: Create, Upload Files, Retrieval Test, and API Call. For your first trial, we recommend completing an end-to-end test with a small resource before increasing the data volume and adjusting the processing strategy.

Typical use cases for a knowledge base include:

  • Semantic search across corporate policies, product manuals, and technical documentation.

  • RAG applications that answer questions based on imported content.

  • AI assistants for customer service, after-sales support, development, and operations.

  • Row-based chunking, vector retrieval, and conditional filtering of structured tabular data.

Knowledge base trial workflow

A complete knowledge base trial includes the following steps:

  1. Grant the RAM user access.

  2. Create a resource in the target region and business workspace, and configure the data type, embedding model, CU specification, and network.

  3. Import a test file into the knowledge base and wait for parsing, chunking, and index building to complete.

  4. Spot-check the chunks, and then use retrieval testing and chat to evaluate the results.

  5. After confirming the results, publish a version or integrate the service into your business application through APIs or SDKs.

Prepare a test file with clear content and explicit answers. Design three to five questions whose answers can be found in the source file. This makes it easier to determine whether the knowledge base retrieves the correct content.

Prerequisites and supported regions

  • You have registered an Alibaba Cloud account. If you use a RAM user, complete the authorization described below first.

  • You have a VPC and a vSwitch available. You can also go to the creation page to create them.

  • You have prepared a local test file that meets the requirements of the selected data type.

Important

The knowledge base is currently available in the China (Hangzhou), China (Beijing), China (Zhangjiakou), and China (Shenzhen) regions. We recommend trying it in China (Hangzhou). In other regions, the chat model and rerank model required for the chat experience may not yet be ready. For details, see the FAQ below.

Step 1: Grant a RAM user access to the knowledge base

If you use an Alibaba Cloud account (root account), you can skip this step. If you use a RAM user, grant the user access permissions.

  1. Log on to the RAM console.

  2. In the left-side navigation pane, choose Identity Management > Users.

  3. Find the target RAM user and click Add Permissions.

  4. Search for and select the system policy AliyunMilvusFullAccess, and then click OK.

Note

After you grant AliyunMilvusFullAccess to the RAM user, the user can create knowledge bases, import data, and run retrieval tests without an additional custom policy. If an operation fails because the user lacks permissions, the API typically returns 403 Permission denied by RAM authentication.

Step 2: Go to Knowledge Base and select a business workspace

  1. Log on to the Vector Retrieval Service for Milvus console.

  2. Switch to a supported region at the top of the console.

  3. In the left-side navigation pane, click Knowledge Base.

  4. At the top of the page, confirm the current business workspace. If you have not created another workspace, you can use the Default Workspace.

Note

The knowledge base list displays resources only in the current business workspace.

The list shows the name and ID, status, type, data type, number of data items, number of chunks, number of versions, and creation time. You can search by name, filter by status, and refresh the list. If the list already contains a resource, click Manage to open its details page.

Step 3: Create a knowledge base

  1. In the list, click Create Knowledge Base.

  2. Configure the parameters in the following table.

  3. Review the configuration overview on the right side of the page, and then click Create Knowledge Base.

Configuration item

Description

Name

The name must be 2 to 64 characters in length and unique within the same tenant. Follow the on-screen instructions and do not use Chinese characters.

Data type

The data type cannot be changed after creation. Omni-modal Knowledge Base parses documents into chunks based on page layout and supports mp4, mp3, png, pdf, ppt, txt, markdown, docs, xlsx, csv, jsonl, and faq. Structured Knowledge Base generates chunks by table row and supports only xls, xlsx, and csv. For your first trial, we recommend selecting the omni-modal type.

Embedding model

The embedding model cannot be changed after creation. For your first trial, we recommend using the built-in model. The default is text-embedding-v3, and the vector dimension is automatically displayed as 1024.

Specification

Required. The minimum specification is 4 CU (4 vCPUs / 16 GiB). After creation, you can adjust the resource in the Resource Configuration section on the details page.

Network configuration

Required. Select the VPC and vSwitch commonly used by your business, or create them from this page.

Tag field definitions

Optional. Under Advanced Settings, you can define up to 180 fields to tag imported data and filter retrieval results. You can skip this during your first trial.

After you submit the creation request, return to the list and wait for the status to change from Creating to Running. This usually takes a few minutes. Import test data only after the resource is running.

Important

No knowledge base service fees are charged during the free invitational preview stage. The unit price and estimated daily cost shown in the configuration overview on the creation page are 0. Pricing after commercialization is subject to the commercialization announcement.

Step 4: Review the knowledge base overview and processing strategies

In the knowledge base list, click Manage for the target resource to open its details page. The top of the details page shows the running status and pending changes and provides the Overview, Data Management, Chunk Management, Version Management, Retrieval Test and Chat tabs.

On the Overview tab, you can review the following information:

  • Basic Statistics: number of data items, chunks, and versions.

  • Basic Information: name, knowledge base ID, data type, type, embedding model, creation time, and description.

  • Resource Configuration: CU specification, CPU, memory, and tags. Click Modify CU Configuration to resize the resource.

  • Processing Strategy: The default strategy uses intelligent chunking with a maximum length of 512 characters. You can also click Create Strategy to add a custom strategy.

The processing strategy directly affects chunk size and retrieval quality. The maximum length is measured in characters, not tokens. For a long test file, first use the default strategy to establish a baseline, and then adjust the strategy based on the retrieval results.

Step 5: Import data into the knowledge base

  1. On the knowledge base details page, click the Data Management tab.

  2. Click Import Data, select a local file as prompted, and submit it.

  3. Return to the data list, check the status, and wait for parsing to finish.

  4. Confirm that the number of chunks in the list is greater than 0.

The Data Management list shows the data name, status, number of chunks, processing strategy, tags, import time, and import method. The system must register the file, parse its content, create chunks, and build an index, so processing a large file usually takes longer.

Before selecting a file, make sure its format matches the data type chosen when you created the knowledge base. The structured type accepts only xls, xlsx, csv; to import PDFs, images, Markdown files, audio, or video, use the omni-modal type.

Step 6: Inspect knowledge base chunks and parsing results

After the import finishes, inspect the parsing results before you test retrieval and chat.

  1. On the Data Management tab, confirm that the data status is normal and the number of chunks is greater than 0.

  2. Click the Chunk Management tab.

  3. Review the chunk ID, content, source data, and character count to confirm that the document body was extracted correctly.

  4. Spot-check a chunk that contains the answer to a test question. Confirm that its context is complete and that it has no obvious garbled text or incorrect sentence breaks.

  5. If needed, click Add Chunk to add content manually.

Image content is recognized as text by OCR before it is added to the knowledge base. The data status may show that processing is complete even if little text was recognized or the recognized text contains errors. After uploading images, always spot-check the chunk text.

Chunks that are too long may include irrelevant context in retrieval results. Chunks that are too short may split apart the information needed to answer a question. If this happens, create a more suitable processing strategy on the Overview tab and reimport the data for comparison.

Step 7: Run a knowledge base retrieval test

  1. On the details page, click the Retrieval Test tab.

  2. Under search parameters, confirm that Version is set to Draft.

  3. For your first test, keep the default parameters or adjust TopK, Semantic Search Weight, Rerank Model and Filter Scope.

  4. Enter a question whose answer can be found in the test file, and then click Search.

  5. Review the recall score, source data name, and chunk number, and confirm that the results are relevant to the question.

If a retrieved chunk contains the information needed to answer the question, the knowledge base import, vectorization, and retrieval pipeline is working. Also test questions that use source keywords, synonyms, and conversational wording to see whether retrieval remains stable across different phrasing.

When you select Draft, retrieval runs against unpublished draft content, so you can check the results before publishing a version. After confirming that the results meet expectations, publish a version to provide a stable service externally.

Step 8: Try the knowledge base chat experience

The chat experience calls a large language model on top of retrieval to generate answers. You can use it to evaluate knowledge base question answering without integrating a model yourself.

  1. On the knowledge base details page, click the Chat tab, and then click New Conversation.

  2. For your first trial, you can keep the default parameters: the chat model uses the tenant's default model, the knowledge base version is DRAFT, and multi-turn query rewriting is enabled by default.

  3. Enter a question in the input box and press Enter to send it. Press Shift + Enter to insert a line break.

  4. View the answer and use its citation marks to expand References to confirm that the cited chunks come from the correct document.

  5. Expand Rewritten Query to see the query actually used for knowledge base retrieval in a multi-turn conversation.

To fine-tune the results, you can adjust the following chat parameters:

  • Chat Instructions: a custom system prompt of up to 16,384 characters.

  • Search Parameters: Result count, Candidate count, Min score, and Semantic weight.

  • Generation Parameters: Temperature, Top P, and Max tokens.

Changes to the parameters on the left side are saved to the current conversation when you send the next message. If retrieval testing works but chat fails, check whether the chat model and rerank model are available in the current region.

Step 9: Publish a knowledge base version and integrate it into your business

Importing, adding, modifying, or deleting knowledge base content creates pending changes. After verification, you can perform the following steps:

  1. At the top of the details page, click View Changes and review the added, modified, and deleted content.

  2. Click Publish Version to publish the current draft as a knowledge base version for stable retrieval.

  3. On the Version Management tab, view publishing records and compare versions when needed.

  4. Use APIs or SDKs to integrate the knowledge base into your business application for end-to-end knowledge question answering.

Drafts are suitable for ongoing editing and testing. Published versions are suitable for business calls and reproducible results. Before production integration, record the knowledge base ID, version, retrieval parameters, and test questions to help investigate differences in results later.

Knowledge base trial checklist

After completing the procedure, use the following checklist to validate the knowledge base:

  • The knowledge base is Running, and the numbers of data items and chunks meet expectations.

  • The data status is normal, and you can view the key content in Chunk Management.

  • A question using keywords from the source document retrieves the correct chunk.

  • A question rephrased with synonyms still returns relevant content from the knowledge base.

  • Chat answers display references, and the citations match the answer content.

  • You have reviewed pending changes and successfully published the target version.

Knowledge base FAQ

  1. What do I do if Knowledge Base is missing from the left-side navigation pane or the console overview page appears after I click it?

    The entry is visible in all regions, but the knowledge base is available only in China (Hangzhou), China (Beijing), China (Zhangjiakou), and China (Shenzhen). In other regions, clicking the entry returns you to the console overview page. Switch to a supported region and try again.

  2. Why does the resource remain in the Creating state after I create it?

    Creation requires computing, storage, and network resources. Wait a few minutes and click Refresh. If the resource does not enter the Running state after a long time, check the selected VPC, vSwitch, and resource quota, and contact technical support.

  3. What do I do if knowledge base data remains in the Processing state or the number of chunks is 0?

    Confirm that the file format matches the data type. A structured knowledge base supports only xls, xlsx, csv, so importing images or other file formats fails. If you use a private or external model, also confirm that the model service can be called.

  4. How can I improve inaccurate knowledge base retrieval results?

    First, use Chunk Management to check whether the content needed to answer the question was parsed correctly. Then compare different processing strategies and chunk lengths. Next, adjust TopK, Semantic Search Weight, the Rerank Model, and Filter Scope one parameter at a time so that you can identify which change affected the results.

  5. Why does chat report a 404 error or indicate that the model does not exist while retrieval testing works normally?

    This indicates that the knowledge base retrieval pipeline is working, but the chat model required for answer generation is unavailable in the current region. If the rerank model displays No Rerank and no other option is available, the models in that region are usually not ready. We recommend trying it in China (Hangzhou), or contacting technical support to confirm model availability.

  6. Are there any charges during the trial?

    No knowledge base service fees are charged during the free invitational preview stage. If you use a private or external model, the model service provider charges for calls to that model service.