Skip to main content

Vectordb API

The vectordb module of the @codebolt/plugin-sdk.

import plugin from '@codebolt/plugin-sdk';

Quick Reference

MethodDescription
addVectorItemAdds a new vector item to the vector database.
getVectorRetrieves a vector from the vector database based on the provided key.
queryVectorItemQueries a vector item from the vector database based on the provided key.
queryVectorItemsQueries a vector item from the vector database based on the provided key.

Methods


addVectorItem

plugin.vectordb.addVectorItem(item: any): Promise<AddVectorItemResponse>

Adds a new vector item to the vector database.

ParameterTypeRequiredDescription
itemanyYesThe item to add to the vector.

Returns: Promise<AddVectorItemResponse> — A promise that resolves when the item is successfully added.

Full reference →


getVector

plugin.vectordb.getVector(key: string): Promise<GetVectorResponse>

Retrieves a vector from the vector database based on the provided key.

ParameterTypeRequiredDescription
keystringYesThe key of the vector to retrieve.

Returns: Promise<GetVectorResponse> — A promise that resolves with the retrieved vector.

Full reference →


queryVectorItem

plugin.vectordb.queryVectorItem(key: string): Promise<QueryVectorItemResponse>

Queries a vector item from the vector database based on the provided key.

ParameterTypeRequiredDescription
keystringYesThe key of the vector to query the item from.

Returns: Promise<QueryVectorItemResponse> — A promise that resolves with the queried vector item.

Full reference →


queryVectorItems

plugin.vectordb.queryVectorItems(items: [], dbPath: string): Promise<QueryVectorItemResponse>

Queries a vector item from the vector database based on the provided key.

ParameterTypeRequiredDescription
items[]Yes
dbPathstringYes

Returns: Promise<QueryVectorItemResponse> — A promise that resolves with the queried vector item.

Full reference →