Create a knowledge base
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
gpdb:CreateDocumentCollection |
create |
*Collection
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| DBInstanceId |
string |
Yes |
The ID of the instance. Note
You can call the DescribeDBInstances operation to query the details of all AnalyticDB for PostgreSQL instances in the target region, including instance IDs. |
gp-xxxxxxxxx |
| ManagerAccount |
string |
Yes |
The name of the manager account that has Note
You can create an account in the console on the **Account Management** page or by calling the CreateAccount operation. |
testaccount |
| ManagerAccountPassword |
string |
Yes |
The password for the manager account. |
testpassword |
| Namespace |
string |
No |
The namespace. The default value is Note
You can call the CreateNamespace operation to create a namespace and the ListNamespaces operation to list namespaces. |
mynamespace |
| Collection |
string |
Yes |
The name of the document collection to create. Note
The name must comply with PostgreSQL object naming conventions. |
document |
| RegionId |
string |
Yes |
The region ID of the instance. |
cn-hangzhou |
| EmbeddingModel |
string |
No |
The embedding model. The default value is Note
Supported models:
|
text-embedding-v1 |
| Dimension |
integer |
No |
The vector dimension. If you omit this parameter, the system uses a default dimension for the selected |
1024 |
| FullTextRetrievalFields |
string |
No |
The metadata fields to use for full-text search. These fields must be keys defined in |
title,page |
| Metadata |
string |
No |
The metadata schema for the vector data, specified as a JSON map where keys are field names and values are data types. Note
Supported data types
Warning The following fields are reserved and cannot be used: id, vector, doc_name, content, loader_metadata, source, and to_tsvector. |
{"title":"text","page":"int"} |
| Parser |
string |
No |
The tokenizer for full-text search. The default value is |
zh_cn |
| Metrics |
string |
No |
The distance metric for the vector index. Valid values:
|
cosine |
| HnswM |
integer |
No |
The maximum number of neighbors (M) for the HNSW algorithm. You do not typically need to set this parameter, as the system automatically sets it based on the vector dimension. Note
Value range:
Note
We recommend that you set this parameter based on the vector dimension:
|
64 |
| HnswEfConstruction |
string |
No |
The size of the candidate set ( Note
Value range:
|
128 |
| PqEnable |
integer |
No |
Specifies whether to enable the PQ (product quantization) algorithm to accelerate indexing. This is recommended for datasets with over 500,000 entries. Valid values:
|
1 |
| ExternalStorage |
integer |
No |
Specifies whether to use memory-mapped files (mmap) to build the HNSW index. The default value is 0. Setting this to Valid values:
Important The ExternalStorage parameter is supported only by AnalyticDB for PostgreSQL V6.0 instances. It is not supported by V7.0 instances. |
0 |
| MetadataIndices |
string |
No |
The metadata fields on which to create scalar indexes. These fields must be keys defined in |
title |
| EnableGraph |
boolean |
No |
Specifies whether to build a knowledge graph. The default value is Note
To use this parameter, you must first upgrade your instance to a version that supports the graph engine. During the public preview period, submit a ticket to request an upgrade. |
true |
| LLMModel |
string |
No |
The name of the LLM model. Valid values:
Note
This parameter takes effect only when |
knowledge-extract-standard |
| Language |
string |
No |
The language used to build the knowledge graph. Valid values:
Note
This parameter takes effect only when |
Simplified Chinese |
| EntityTypes |
array |
No |
A list of entity types. Note
This parameter is required when |
|
|
string |
No |
An entity type. |
Location |
|
| RelationshipTypes |
array |
No |
A list of relationship types. Note
This parameter is required when |
|
|
string |
No |
A relationship type. |
Occurred |
|
| SupportSparse |
boolean |
No |
Specifies whether to support sparse vectors. The default value is |
true |
| SparseVectorIndexConfig |
object |
No |
Configuration for the sparse vector index. Specifying this parameter creates the index. |
|
| HnswM |
integer |
No |
The maximum number of neighbors (M) for the HNSW algorithm. You do not typically need to set this parameter, as the system automatically sets it based on the vector dimension. Note
Value range:
Note
We recommend that you set this parameter based on the vector dimension:
|
64 |
| HnswEfConstruction |
integer |
No |
The size of the candidate set ( Note
This parameter is applicable only to AnalyticDB for PostgreSQL V7.0 instances, and its value must be greater than or equal to |
128 |
| Algorithm |
string |
No |
The vector index algorithm. Valid values:
|
hnswflat |
| SparseRetrievalFields |
string |
No |
The metadata fields used to build the sparse vector. These fields must be keys defined in |
title,abstract |
| Algorithm |
string |
No |
The vector index algorithm. Valid values:
|
hnswflat |
| VectorIndexConfig |
object |
No |
Configuration for the dense vector index. |
|
| Nlist |
integer |
No |
The number of lists (partitions) for the novad algorithm. Valid values: [2, 1073741824]. The default value is 256. |
256 |
| RabitqBits |
integer |
No |
The number of bits used for rabitq compression. Valid values: [1, 8]. The default value is 3. |
3 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
ABB39CC3-4488-4857-905D-2E4A051D0521 |
| Message |
string |
The response message. |
Successful |
| Status |
string |
The status of the operation. Valid values:
|
successs |
Examples
Success response
JSON format
{
"RequestId": "ABB39CC3-4488-4857-905D-2E4A051D0521",
"Message": "Successful",
"Status": "successs"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.