RocksetVectorStore#
- class llama_index.vector_stores.RocksetVectorStore(collection: str, client: Any | None = None, text_key: str = 'text', embedding_col: str = 'embedding', metadata_col: str = 'metadata', workspace: str = 'commons', api_server: str | None = None, api_key: str | None = None, distance_func: DistanceFunc = DistanceFunc.COSINE_SIM)#
Bases:
VectorStore
Attributes Summary
Get client.
Methods Summary
add
(nodes, **add_kwargs)Stores vectors in the collection.
delete
(ref_doc_id, **delete_kwargs)Deletes nodes stored in the collection by their ref_doc_id.
query
(query, **kwargs)Gets nodes relevant to a query.
with_new_collection
([dimensions])Creates a new collection and returns its RocksetVectorStore.
Attributes Documentation
- client#
- flat_metadata: bool = False#
- is_embedding_query: bool = True#
- stores_text: bool = True#
Methods Documentation
- add(nodes: List[BaseNode], **add_kwargs: Any) List[str] #
Stores vectors in the collection.
- Parameters
nodes (List[BaseNode]) – List of nodes with embeddings
- Returns
Stored node IDs (List[str])
- delete(ref_doc_id: str, **delete_kwargs: Any) None #
Deletes nodes stored in the collection by their ref_doc_id.
- Parameters
ref_doc_id (str) – The ref_doc_id of the document whose nodes are to be deleted
- query(query: VectorStoreQuery, **kwargs: Any) VectorStoreQueryResult #
Gets nodes relevant to a query.
- Parameters
query (llama_index.vector_stores.types.VectorStoreQuery) – The query
similarity_col (Optional[str]) – The column to select the cosine similarity as (default: “_similarity”)
- Returns
query results (llama_index.vector_stores.types.VectorStoreQueryResult)
- classmethod with_new_collection(dimensions: int | None = None, **rockset_vector_store_args: Any) RocksetVectorStore #
Creates a new collection and returns its RocksetVectorStore.
- Parameters
dimensions (Optional[int]) – The length of the vectors to enforce in the collection’s ingest transformation. By default, the collection will do no vector enforcement.
collection (str) – The name of the collection to be created
client (Optional[Any]) – Rockset client object
workspace (str) – The workspace containing the collection to be created (default: “commons”)
text_key (str) – The key to the text of nodes (default: llama_index.vector_stores.utils.DEFAULT_TEXT_KEY)
embedding_col (str) – The DB column containing embeddings (default: llama_index.vector_stores.utils.DEFAULT_EMBEDDING_KEY))
metadata_col (str) – The DB column containing node metadata (default: “metadata”)
api_server (Optional[str]) – The Rockset API server to use
api_key (Optional[str]) – The Rockset API key to use
distance_func (RocksetVectorStore.DistanceFunc) – The metric to measure vector relationship (default: RocksetVectorStore.DistanceFunc.COSINE_SIM)