Skip to main content

VectorDB

Abstract class for vector database. A vector database is responsible for storing and retrieving documents.
Parameters:

Class Attributes

active_collection



embedding_function



type



Instance Methods

create_collection

Create a collection in the vector database.
Case 1. if the collection does not exist, create the collection.
Case 2. the collection exists, if overwrite is True, it will overwrite the collection.
Case 3. the collection exists and overwrite is False, if get_or_create is True, it will get the collection, otherwise it raise a ValueError.
Parameters: Returns:

delete_collection

Delete the collection from the vector database.
Parameters: Returns:

delete_docs

Delete documents from the collection of the vector database.
Parameters: Returns:

get_collection

Get the collection from the vector database.
Parameters: Returns:

get_docs_by_ids

Retrieve documents from the collection of the vector database based on the ids.
Parameters: Returns:

insert_docs

Insert documents into the collection of the vector database.
Parameters: Returns:

retrieve_docs

Retrieve documents from the collection of the vector database based on the queries.
Parameters: Returns:

update_docs

Update documents in the collection of the vector database.
Parameters: Returns: