Use enterprise knowledge spaces

更新时间:
复制 MD 格式

This topic describes how to create and manage knowledge spaces, create knowledge bases, upload documents, and test retrieval in the console.

Availability

The enterprise knowledge space engine is built on the integrated architecture of PolarDB. It includes an orchestration engine, an intelligent search engine PolarSearch (based on inverted indexes and vector database) , and PolarDB for PostgreSQL for metadata management. The supported regions and zones are as follows:

Region

Availability zone

China (Hangzhou)

Zone K, Zone J

China (Shanghai)

Zone E, Zone F, Zone L, Zone N

China (Shenzhen)

Zone C, Zone D, Zone F

China (Beijing)

Zone F, Zone L, Zone I, Zone K

China (Zhangjiakou)

Zone B

China (Ulanqab)

Zone B, Zone C

China (Hong Kong)

Zone B, Zone D

Singapore

Zone A, Zone B

Japan (Tokyo)

Zone A, Zone C

South Korea (Seoul)

Zone A, Zone B

Germany (Frankfurt)

Zone A

US (Silicon Valley)

Zone B

Philippines (Manila)

Zone A

Create a knowledge space

You can create a knowledge space in the PolarDB Agent Express console. Creating a knowledge space automatically creates and associates a PolarDB cluster. You can view the associated PolarDB cluster on the knowledge space details page.

Warning

Do not modify or delete the doc_search account or the polar_rag_meta database that the enterprise knowledge space automatically creates in the target PolarDB cluster.

  1. Log on to the PolarDB console.

  2. In the left-side navigation pane, choose PolarDB AI > PolarDB Enterprise Knowledge Space.

  3. Click Create Knowledge Space.

  4. In the dialog box, configure the following parameters.

    Parameter

    Required

    Description

    Knowledge Space Name

    Yes

    Enter a name for the knowledge space. Maximum length: 128 characters.

    Knowledge Space Notes

    No

    Enter a description for the knowledge space. Maximum length: 512 characters.

    Vector Model

    Yes

    Select a vector model. The default is text-embedding-v4. This setting cannot be changed after creation.

    Vector Dimensions

    Yes

    Set the vector dimension, which must match the selected vector model. The default value is 1024.

    Sorting Model

    No

    Select a reranker model to reorder the search results. The default is qwen3-rerank. You can also select gte-rerank-v2.

    Sharding Strategy

    Yes

    Select a document chunking strategy. By default, Intelligent Sharding is used.

    Chunk Size (tokens)

    No

    Set the maximum number of tokens for a single chunk. The default value is 512.

    OSS Bucket

    Yes

    Enter the name of the OSS bucket that stores the source documents.

    OSS AccessKey

    Yes

    The AccessKey ID for your OSS bucket.

    OSS Secret Key

    Yes

    The AccessKey Secret for your OSS bucket.

    VPC Network

    Yes

    Select a VPC.

    Zone and vSwitch

    Yes

    Select a zone and a vSwitch. The zone must be one of the supported zones listed in Availability.

  5. Click OK.

Configure network

  1. Create a Public NAT Gateway: Go to the NAT Gateway - Public NAT Gateway purchase page to create a gateway. During creation, select the same VPC and vSwitch as your enterprise knowledge space.

  2. Configure an SNAT entry: Go to the Public NAT Gateway page. In the Operation column for the target gateway, click Configure SNAT, and then click Create SNAT Entry. Configure the following parameters:

    • SNAT entry scope: VPC.

    • Select Elastic IP Address: Select an EIP from the drop-down list to provide public access.

Note

Enabling public access incurs fees for the Public NAT Gateway and public network traffic. For more information about billing, see NAT Gateway billing.

Manage knowledge spaces

After you create a knowledge space, you can view and manage existing knowledge spaces on the Enterprise Knowledge Space tab.

Edit a knowledge space

On the knowledge space card, click Edit to modify the name and description of the knowledge space.

Delete a knowledge space

Warning

Deleting a knowledge space also deletes all associated resources, including indexes, pipelines, models, and connectors. This action is irreversible. Proceed with caution.

On the knowledge space card, click Delete, and then click Delete in the confirmation dialog box.

View knowledge space details

On the knowledge space card, click View Details to go to the Storage Management page. This page shows the basic information of the knowledge space, such as the vector model, dimensions, reranker model, chunking strategy, and OSS bucket, as well as the list of knowledge bases in the space.

Create and manage knowledge bases

A knowledge base is a logical grouping unit within a knowledge space for organizing and managing documents. You can create multiple knowledge bases in a single knowledge space.

Create a knowledge base

  1. On the knowledge space details page, click Create Knowledge Base.

  2. In the dialog box, configure the following parameters.

    Parameter

    Required

    Description

    Knowledge Base Name

    Yes

    Enter a name for the knowledge base. Maximum length: 128 characters.

    Remarks

    No

    Enter a description for the knowledge base. Maximum length: 512 characters.

    Search Mode

    Yes

    Select a retrieval mode. Valid values:

    • Balanced Mode (default, BM25 50% + KNN 50%)

    • Precise Mode (BM25 70% + KNN 30%)

    • Semantic Mode (BM25 30% + KNN 70%)

    • KNN (pure vector search)

    • RRF Fusion (rank fusion)

  3. Click Create.

Edit a knowledge base

On the knowledge base card, click Edit to modify the name, retrieval mode, and description of the knowledge base.

Delete a knowledge base

On the knowledge base card, click Delete, and then click Delete in the confirmation dialog box.

Upload and manage documents

You can upload documents from the console or upload files to the OSS path of the knowledge base. After upload, the system automatically parses, chunks, and indexes the documents.

Upload from the console

  1. On the knowledge space details page, click the target knowledge base to go to the knowledge base details page.

  2. On the File Overview tab, click Upload File.

  3. In the upload dialog box, select a file and click OK. The maximum file size is 5 GB.

Upload from OSS

You can also upload files directly to the OSS path of the knowledge base. The path format is:

oss://<Bucket name>/<Knowledge space ID>/<Knowledge base ID>/

Example: oss://my-rag-bucket/space_001/kb_001/report.pdf

Synchronize documents

Files uploaded through OSS are automatically synchronized to the knowledge base on a regular basis. To synchronize immediately, on the knowledge base details page, click the File Overview tab and then click Trigger Sync.

Document processing statuses

Uploaded documents go through the following statuses during processing:

Status

Description

Pending

Submitted. Waiting for processing resources to be allocated.

Chunking

The document is being chunked.

Vectorizing

Vector indexes are being generated.

Completed

Processing is complete. The document is available for retrieval.

Failed

Processing failed. Check the file format or contact technical support.

View document chunks

In the row of the target document, click View Shards to view the chunk details of the document.

Delete a document

Warning

Deleting a document also deletes the document from your OSS bucket (<Bucket name>/<Knowledge space ID>/<Knowledge base ID>/). This action is irreversible. Proceed with caution.

In the row of the target document, click Delete, and then click Delete in the confirmation dialog box.

Test retrieval

After documents are processed, you can test retrieval on the knowledge base details page.

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

  2. Configure the retrieval parameters.

    Parameter

    Description

    Query Statement

    Enter the text to search for.

    Search Method

    Select AISearch or Keyword Search.

    Return Count (Top-K)

    Set the number of most relevant results to return.

    Similarity Threshold

    Set the minimum similarity score threshold. Results with scores below this threshold are excluded.

    Reranking

    Specifies whether to enable the reranker model to reorder the results. Valid values: Enabled - Use Sorting Model and Close.

  3. Click Start Retrieval. In the Search Results section, view the matched document chunks, including the source file, similarity score, and chunk content.