swarmauri.core.vector_stores.IVectorStore module

class swarmauri.core.vector_stores.IVectorStore.IVectorStore[source]

Bases: ABC

Interface for a vector store responsible for storing, indexing, and retrieving documents.

abstract add_document(document)[source]

Stores a single document in the vector store.

Parameters: - document (IDocument): The document to store.

Return type:

None

abstract add_documents(documents)[source]

Stores multiple documents in the vector store.

Parameters: - documents (List[IDocument]): The list of documents to store.

Return type:

None

abstract clear_documents()[source]

Deletes all documents from the vector store

Return type:

None

abstract delete_document(doc_id)[source]

Deletes a document from the vector store by its ID.

Parameters: - doc_id (str): The unique identifier of the document to delete.

Return type:

None

abstract document_count()[source]
Return type:

int

abstract get_all_documents()[source]

Retrieves all documents stored in the vector store.

Returns: - List[IDocument]: A list of all documents.

Return type:

List[IDocument]

abstract get_document(doc_id)[source]

Retrieves a document by its ID.

Parameters: - doc_id (str): The unique identifier for the document.

Returns: - Union[IDocument, None]: The requested document, or None if not found.

Return type:

Optional[IDocument]

abstract update_document(doc_id, updated_document)[source]

Updates a document in the vector store.

Parameters: - doc_id (str): The unique identifier for the document to update. - updated_document (IDocument): The updated document object.

Note: It’s assumed that the updated_document will retain the same doc_id but may have different content or metadata.

Return type:

None