add

Function

Adds a document index to a vector database. Specifically, this API first embeds a document chunk to obtain vectors, and then stores the vectors into a vector database.

Prototype

def add(ids: List[int], embeddings: np.ndarray, document_id)

Parameters

Parameter

Data Type

Required/Optional

Description

ids

List[int]

Required

Index ID list of vectors to be added. Its length range is [0, 10 million).

embeddings

ndarray

Required

NumPy array object.

document_id

Integer

Optional

ID of the document to which vectors to be added belong.

The shape of embeddings must be 2D. The number of vectors contained in embeddings must be equal to the length of ids. The total number of added vectors at a time must be less than 10 million.