Help Center/ Huawei Cloud Astro Zero/ Best Practices/ Intelligence/ Using the AI Assistant Widget to Build a Knowledge Base
Updated on 2025-09-04 GMT+08:00

Using the AI Assistant Widget to Build a Knowledge Base

Application Scenarios

If you have a large number of documents that are hard to use and query efficiency is low, you can use the AI assistant widget to call the foundation model API to get answers. Additionally, RAG technology works with the knowledge base to provide a more intelligent and natural dialog experience, improving the accuracy and relevance of information retrieval.

Constraints

  • To enable the function of building a knowledge base, submit a service ticket.
  • The knowledge base directory structure should be: knowledge base > folder > file. You can create multiple knowledge bases, each containing multiple folders with files of various types. For professional edition instances, each tenant can create up to 40 folders. Free and standard editions support only one folder. Single files must be under 6 MB, and folders cannot exceed 50 MB in total. Supported file formats are TXT, DOCX, PDF, MD, and CSV.

Procedure

Figure 1 shows the process of building a knowledge base using the AI assistant widget.

Figure 1 Building a knowledge base using the AI assistant widget

Step 1: Create a Foundation Model Connector to Connect to an External Foundation Model

Create a connector to connect to the foundation model API.

  1. Create a low-code application.

    1. Apply for a free trial or purchase a commercial instance by referring to Authorization of Users for Huawei Cloud Astro Zero Usage and Instance Purchases.
    2. After you have an instance, click Access Homepage on Homepage. The application development page is displayed.
    3. In the navigation pane, choose Applications. On the displayed page, click Low-Code or .

      When you create an application for the first time, create a namespace as prompted. Once it is created, you cannot change or delete it, so check the details carefully. Use your company or team's abbreviation for the namespace.

    4. In the displayed dialog box, choose Standard Applications and click Confirm.
    5. Enter a label and name of the application, and click the confirm button. The application designer is displayed.
      Figure 2 Creating a blank application
      Table 1 Parameters for creating a blank application

      Parameter

      Description

      Example

      Label

      The label for the new application; Max. 80 characters. A label uniquely identifies an application in the system and cannot be modified after creation.

      My first application

      Name

      Name of the new application. After you enter the label value and click the text box of this parameter, the system automatically generates an application name and adds Namespace__ before the name. Naming rules:

      • Max. characters: 31, including the prefix namespace.

        To prevent duplicate data names among different tenants, each tenant must define a unique namespace when first creating an application. A tenant can only create one namespace, and once it is created, it cannot be modified.

      • Start with a letter and can contain only letters, digits, and underscores (_). It cannot end with an underscore (_).

      A

  2. Create a foundation model connector.

    1. In the application designer, choose Integrations > Connector > Connector Instance.
    2. Choose Foundation Model > Custom Model and click +. The page for creating a custom foundation model connector is displayed.
      Figure 3 Creating a custom foundation model connector
    3. Enter and save the configuration information of the foundation model connector.
      Figure 4 Setting foundation model connector information
      Table 2 Parameters for configuring the custom foundation model connector

      Parameter

      Description

      Example

      Label

      Custom foundation model connector label, which can be modified after being created.

      Value: 1–64 characters.

      DeepSeek-V3

      Name

      Custom connector name, which uniquely identifies the connector in the system and cannot be changed after the connector is created. Naming rules:

      • Max. 64 characters, including the prefix namespace.

        To prevent duplicate data names among different tenants, each tenant must define a unique namespace when first creating an application. A tenant can only create one namespace, and once it is created, it cannot be modified.

      • Start with a letter and can contain only letters, digits, and underscores (_). It cannot end with an underscore (_).

      SelfHostDeepSeek

      Model Name

      Model ID of the specific foundation model. When the connector is called, this field is passed to the model field in the foundation model API.

      DeepSeek-V3-0324-w8a8

      URL

      URL for accessing the foundation model API, provided by the model provider.

      https://*****

  3. Test the connectivity of the foundation model connector.

    1. On the custom foundation model details page, click Test. On the displayed dialog box, click Test. The foundation model connector test page is displayed.
    2. In the Input Content text box, enter the dialog content (for example, "Hello"), and click Test. Check whether the returned message is correct.
      If the returned message contains the streaming response packet, the foundation model connector is configured successfully. Otherwise, check whether the foundation model connector information is correct.
      Figure 5 Foundation model connector test page

Step 2: Call the Streaming Packet API to Build a Knowledge Base

Create a standard page, add an AI assistant widget, and use a script to call the streaming API to build a knowledge base.

  1. In the navigation pane, choose Page.
  2. Click + to create a blank standard page.

    Figure 6 Setting basic information about the standard page
    Table 3 Parameters for creating a standard page

    Parameter

    Description

    Example

    Label

    Label of the standard page, which is displayed on the page and can be modified after being created.

    Value: 1–64 characters.

    Knowledge base

    Name

    Name of the standard page. The name is the unique identifier of the standard page in the system and cannot be changed after being created. Naming rules:

    • Max. 64 characters, including the prefix namespace.

      To prevent duplicate data names among different tenants, each tenant must define a unique namespace when first creating an application. A tenant can only create one namespace, and once it is created, it cannot be modified.

    • Start with a letter and can contain only letters, digits, and underscores (_). It cannot end with an underscore (_).

    knowledgebase

  3. Drag the AI Assistant widget from Basic > Smart to the canvas.

    Figure 7 Adding an AI assistant widget

  4. Enable the knowledge base and bind the big data model to the AI assistant widget.

    1. Click the AI assistant widget and enable the knowledge base in Properties > Advanced Properties.
      Figure 8 Enabling the knowledge base
    2. Enable Show Model and click Set Default Model. Select the connector created in Step 1: Create a Foundation Model Connector to Connect to an External Foundation Model to bind the model to the widget.
      Figure 9 Binding a model to the widget

Step 3: Verify if the AI Assistant Widget Can Build a Knowledge Base

  1. On the created standard page, click . The preview page is displayed. You can view the button for adding a knowledge base and the bound big data model.
  2. Click Add Knowledge Base. On the displayed page, click Manage.

    Groups: A knowledge base that can be shared among group members. When you create a group knowledge base, if you set it to be visible only to a specific department, only users in that department can view and use the knowledge base.

    Mine: An individual knowledge base is exclusive to a single user. Other users cannot access or use it.

  3. Click New, set the knowledge base name and visibility scope, and click OK. The knowledge base page is displayed, on which you can view the created knowledge base.

    Figure 10 Creating a knowledge base
    Table 4 Parameters for creating a knowledge base

    Parameter

    Description

    Example

    Name

    Name of the knowledge base to be created.

    FAQ_Knowledge_Base

    Visibility

    Select the visibility scope of the knowledge base. The options are Group and Public.

    • Group: Only users in the department can view and use the knowledge base.
    • Public: All users of the tenant can view and use the knowledge base.

    Public

  4. In the knowledge base list, click the knowledge base created in 3. On the knowledge base page that is displayed, click Create Folder.

    Figure 11 Clicking the button to create a folder

  5. Set the folder name, and select the knowledge base embedding model, splitter, and chunk length as required.

    Figure 12 Creating a folder
    Table 5 Parameters for creating a folder

    Parameter

    Description

    Example

    Name

    Name of the folder to be created.

    FAQs

    Embedding Model

    Select an embedding model as required.

    • m3e-base: text embedding model: A general-purpose model with 768 dimensions for both Chinese and English.
    • bge-large-zh-v1.5: text representation model: Better for retrieval, classification, clustering, and semantic matching tasks. Currently, this model is limited to Chinese text.
    • paraphrase-multilingual-MiniLM-L12-v2: vector space model: Excellent text similarity measurement with 364 dimensions for both Chinese and English text.
    • VESO-v1.3: Huawei's code model: Excellent code data vectorization and code search.

    m3e-base: text embedding model

    Splitter

    Converts text into units that can be understood by the model. The following types are supported:

    • By paragraph (default): Splits text by double line breaks (\n\n) or paragraph structure.
    • By line: Splits text by single line breaks (\n).
    • By sentence (English): Splits text by sentence boundaries.
    • By character: Splits text into individual characters (including whitespace characters).

    By paragraph

    Chunk Length

    Maximum length of a chunk. The value range is [50, 1200]. The default value is 1000.

    1000

    Chunk Overlap

    Overlap between sequential chunks: 0 to chunk length (default: 0).

    0

    Child Splitter

    Applied when a chunk exceeds the maximum allowed length. The following types are supported:

    • By character (Default): Splits text into individual characters (including whitespace characters).
    • By sentence (English): Splits text by sentence boundaries.
    • By word (English): Splits text by whitespace characters.

    By character

  6. After the setting is complete, click the confirm button to return to the knowledge base page.
  7. Click the created folder (for example, FAQs) and click Upload File.

    In this practice, the FAQs in the Huawei Cloud Astro Zero help center are used as an example. You can click Common FAQs to download the document.

    Figure 13 Clicking the button to upload a file
    Figure 14 Uploading an FAQ file

    After the file is uploaded, the status of the file shows that it is being imported. Click to refresh the status. If the status changes to Successfully, the file is ready to be used.

  8. Return to the knowledge base page and select one or more created knowledge bases.

    Figure 15 Selecting a knowledge base

  9. Ask the AI assistant questions about Huawei Cloud Astro Zero to locate the relevant documents.