Creates 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 instance ID. Note
Call the DescribeDBInstances API to view details of all AnalyticDB PostgreSQL instances in the destination region, including their instance IDs. |
gp-xxxxxxxxx |
| ManagerAccount |
string |
Yes |
The name of the management account with rds_superuser permissions. Note
Create an account using the console > Account Management, or by calling the CreateAccount API. |
testaccount |
| ManagerAccountPassword |
string |
Yes |
The management account password. |
testpassword |
| Namespace |
string |
No |
The namespace. Default value: public. Note
Create a namespace by calling the CreateNamespace API. View the list by calling the ListNamespaces API. |
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 ID of the region where the instance resides. |
cn-hangzhou |
| EmbeddingModel |
string |
No |
The embedding algorithm. Default value: text-embedding-v3. Note
Supported algorithms:
|
text-embedding-v1 |
| Dimension |
integer |
No |
The vector dimensions. The default value is the dimensions supported by the embedding algorithm. |
1024 |
| FullTextRetrievalFields |
string |
No |
The fields for full-text index. Separate multiple fields with commas (,). The fields must be keys defined in Metadata. |
title,page |
| Metadata |
string |
No |
The metadata of vector data, a JSON string in MAP format. The key represents the field name, and the value represents the data type. Note
Supported data types
Warning id, vector, doc_name, content, loader_metadata, source, and to_tsvector are reserved words. Do not use them. |
{"title":"text","page":"int"} |
| Parser |
string |
No |
The tokenizer for full-text index. Default value: zh_cn. |
zh_cn |
| Metrics |
string |
No |
The method for vector index building. Value description:
|
cosine |
| HnswM |
integer |
No |
The maximum number of neighbors in the HNSW algorithm. The API automatically sets this value based on the vector dimensions. Manual setting is generally not required. Note
Value range:
Note
Set this value based on vector dimensions as follows:
|
64 |
| HnswEfConstruction |
string |
No |
The candidate set size when building an HNSW index. The value must be >= 2*HNSW_M. Note
Value range:
|
128 |
| PqEnable |
integer |
No |
Enable or disable Product Quantization (PQ) algorithm acceleration for the index. Enable it if the data volume exceeds 500,000. Value description:
|
1 |
| ExternalStorage |
integer |
No |
Use mmap to build the HNSW index. Default value: 0. If data deletion is not required and high data upload performance is needed, set this parameter to 1. Value description:
Important The ExternalStorage parameter is only supported for version 6.0. It is not supported for version 7.0. |
0 |
| MetadataIndices |
string |
No |
The scalar indexed fields. Separate multiple fields with commas (,). The fields must be keys defined in Metadata. |
title |
| EnableGraph |
boolean |
No |
Enable or disable knowledge graph building. Default value: false. Note
Before using this parameter, upgrade the instance to a version that supports the graph engine. (During public preview, submit a ticket to upgrade the version.) |
true |
| LLMModel |
string |
No |
The LLM model name. Value description:
Note
This parameter takes effect only when knowledge graph building is enabled. |
knowledge-extract-standard |
| Language |
string |
No |
The language used for knowledge graph building. Value description:
Note
This parameter takes effect only when knowledge graph building is enabled. |
Simplified Chinese |
| EntityTypes |
array |
No |
The list of entity types. Note
This parameter is required when knowledge graph building is enabled. |
|
|
string |
No |
The entity type. |
地点 |
|
| RelationshipTypes |
array |
No |
The list of relationship edge types. Note
This parameter is required when knowledge graph building is enabled. |
|
|
string |
No |
The relationship edge type. |
发生 |
|
| SupportSparse |
boolean |
No |
Enable or disable sparse vector support. Default value: false. |
true |
| SparseVectorIndexConfig |
object |
No |
The sparse vector index configuration. If provided, a sparse vector index is created. |
|
| HnswM |
integer |
No |
The maximum number of neighbors in the HNSW algorithm. The API automatically sets this value based on the vector dimensions. Manual setting is generally not required. Note
Value range:
Note
Set this value based on vector dimensions as follows:
|
64 |
| HnswEfConstruction |
integer |
No |
The candidate set size when building an HNSW index. Value range: 4–1000. Default value: 64. Note
This value is required only for AnalyticDB PostgreSQL 7.0 instances, and the value must be >= 2*HNSW_M. |
128 |
| SparseRetrievalFields |
string |
No |
The metadata fields used to build sparse vectors. Separate multiple fields with commas (,). The fields must be keys defined in Metadata. |
title,abstract |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
ABB39CC3-4488-4857-905D-2E4A051D0521 |
| Message |
string |
The message returned by the operation. |
Successful |
| Status |
string |
The API execution status. 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.