Skip to content

Collections API

Collections are the primary way to organize vectors in the database. Each collection can be configured for dense vectors, sparse vectors, and full-text search with different options.

Create Collection

Creates a new collection in the vector database.

Endpoint: POST /vectordb/collections

Request Body:

{
"name": "collection_name",
"description": "optional description",
"dense_vector": {
"enabled": true,
"dimension": 1024
},
"sparse_vector": {
"enabled": false
},
"tf_idf_options": {
"enabled": false
},
"config": {
"max_vectors": null,
"replication_factor": null
},
"store_raw_text": false
}

Request Parameters:

ParameterTypeRequiredDescription
namestringYesUnique name for the collection.
descriptionstringNoOptional description for the collection.
dense_vectorobjectYesConfiguration for dense vector support.
dense_vector.enabledbooleanYesWhether to enable dense vector operations.
dense_vector.dimensionintegerYesDimension of dense vectors to be stored.
sparse_vectorobjectYesConfiguration for sparse vector support.
sparse_vector.enabledbooleanYesWhether to enable sparse vector operations.
tf_idf_optionsobjectYesConfiguration for text search/BM25 support.
tf_idf_options.enabledbooleanYesWhether to enable text search operations.
configobjectYesCollection-level configuration options.
config.max_vectorsintegerNoMaximum number of vectors in the collection (null for unlimited).
config.replication_factorintegerNoReplication factor for the collection (null for default).
store_raw_textbooleanNoWhether to store raw text in addition to processed text.

Response:

{
"id": "collection_name",
"name": "collection_name",
"description": "optional description"
}

Response Fields:

FieldTypeDescription
idstringUnique identifier for the collection (same as name).
namestringName of the collection.
descriptionstringOptional description of the collection.

Status Codes:

CodeDescription
201Created. Collection created successfully.
400Bad Request. Invalid collection parameters.
409Conflict. Collection ID already exists.
500Server Error. Failed to create collection.

List Collections

Lists all collections in the database.

Endpoint: GET /vectordb/collections

Response:

{
"collections": [
{
"name": "collection_name_1",
"description": "optional description"
},
{
"name": "collection_name_2",
"description": "optional description"
}
]
}

Response Fields:

FieldTypeDescription
collectionsarrayList of collection summaries.
collections[].namestringName of the collection.
collections[].descriptionstringOptional description of the collection.

Status Codes:

CodeDescription
200Success. Collections list returned.
500Server Error. Failed to retrieve collections.

Get Collection

Retrieves a collection by ID or name.

Endpoint: GET /vectordb/collections/{collection_id}

URL Parameters:

ParameterTypeRequiredDescription
collection_idstringYesID of the collection to retrieve.

Response:

{
"name": "collection_name",
"description": "optional description",
"dense_vector": {
"enabled": true,
"dimension": 1024
},
"sparse_vector": {
"enabled": false
},
"tf_idf_options": {
"enabled": false
}
}

Status Codes:

CodeDescription
200Success. Collection details retrieved.
404Not Found. Collection not found.
500Server Error. Failed to retrieve collection details.

Delete Collection

Deletes a collection by ID or name.

Endpoint: DELETE /vectordb/collections/{collection_id}

URL Parameters:

ParameterTypeRequiredDescription
collection_idstringYesID (name) of the collection to delete.

Status Codes:

CodeDescription
204No Content. Collection deleted successfully.
400Bad Request. Collection not found.
500Server Error. Failed to delete collection.

Load Collection

Loads a collection into memory for faster access.

Endpoint: POST /vectordb/collections/{collection_id}/load

URL Parameters:

ParameterTypeRequiredDescription
collection_idstringYesID (name) of the collection to load.

Response:

{
"name": "collection_name",
"description": "optional description",
"dense_vector": {
"enabled": true,
"dimension": 1024
},
"sparse_vector": {
"enabled": false
},
"tf_idf_options": {
"enabled": false
}
}

Status Codes:

CodeDescription
200Success. Collection loaded successfully.
400Bad Request. Collection not found.
500Server Error. Failed to load collection.

Unload Collection

Unloads a collection from memory to free up resources.

Endpoint: POST /vectordb/collections/{collection_id}/unload

URL Parameters:

ParameterTypeRequiredDescription
collection_idstringYesID (name) of the collection to unload.

Response:

"Collection 'collection_name' successfully unloaded"

Status Codes:

CodeDescription
200Success. Collection unloaded successfully.
400Bad Request. Collection not found.
500Server Error. Failed to unload collection.

Get Loaded Collections

Retrieves a list of collections currently loaded in memory.

Endpoint: GET /vectordb/collections/loaded

Response:

[
"collection_name_1",
"collection_name_2"
]

Status Codes:

CodeDescription
200Success. List of loaded collections returned.
500Server Error. Failed to retrieve loaded collections.