Class swarmauri_core.vector_stores.IVectorStore.IVectorStore
swarmauri_core.vector_stores.IVectorStore.IVectorStore
Bases: ABC
Interface for a vector store responsible for storing, indexing, and retrieving documents.
add_document
abstractmethod
add_document(document)
Stores a single document in the vector store.
Parameters: - document (IDocument): The document to store.
Source code in swarmauri_core/vector_stores/IVectorStore.py
11 12 13 14 15 16 17 18 19 | |
add_documents
abstractmethod
add_documents(documents)
Stores multiple documents in the vector store.
Parameters: - documents (List[IDocument]): The list of documents to store.
Source code in swarmauri_core/vector_stores/IVectorStore.py
21 22 23 24 25 26 27 28 29 | |
get_document
abstractmethod
get_document(doc_id)
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.
Source code in swarmauri_core/vector_stores/IVectorStore.py
31 32 33 34 35 36 37 38 39 40 41 42 | |
get_all_documents
abstractmethod
get_all_documents()
Retrieves all documents stored in the vector store.
Returns: - List[IDocument]: A list of all documents.
Source code in swarmauri_core/vector_stores/IVectorStore.py
44 45 46 47 48 49 50 51 52 | |
delete_document
abstractmethod
delete_document(doc_id)
Deletes a document from the vector store by its ID.
Parameters: - doc_id (str): The unique identifier of the document to delete.
Source code in swarmauri_core/vector_stores/IVectorStore.py
54 55 56 57 58 59 60 61 62 | |
clear_documents
abstractmethod
clear_documents()
Deletes all documents from the vector store
Source code in swarmauri_core/vector_stores/IVectorStore.py
64 65 66 67 68 69 70 | |
update_document
abstractmethod
update_document(doc_id, updated_document)
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.
Source code in swarmauri_core/vector_stores/IVectorStore.py
72 73 74 75 76 77 78 79 80 81 82 83 | |
document_count
abstractmethod
document_count()
Source code in swarmauri_core/vector_stores/IVectorStore.py
85 86 87 | |