SingleStoreVectorStore#

class llama_index.vector_stores.SingleStoreVectorStore(table_name: str = 'embeddings', content_field: str = 'content', metadata_field: str = 'metadata', vector_field: str = 'vector', pool_size: int = 5, max_overflow: int = 10, timeout: float = 30, **kwargs: Any)#

Bases: VectorStore

SingleStore vector store.

This vector store stores embeddings within a SingleStore database table.

During query time, the index uses SingleStore to query for the top k most similar nodes.

Parameters
  • table_name (str, optional) – Specifies the name of the table in use. Defaults to “embeddings”.

  • content_field (str, optional) – Specifies the field to store the content. Defaults to “content”.

  • metadata_field (str, optional) – Specifies the field to store metadata. Defaults to “metadata”.

  • vector_field (str, optional) – Specifies the field to store the vector. Defaults to “vector”.

  • pool (Following arguments pertain to the connection) –

  • pool_size (int, optional) – Determines the number of active connections in the pool. Defaults to 5.

  • max_overflow (int, optional) – Determines the maximum number of connections allowed beyond the pool_size. Defaults to 10.

  • timeout (float, optional) – Specifies the maximum wait time in seconds for establishing a connection. Defaults to 30.

  • connection (Following arguments pertain to the) –

  • host (str, optional) – Specifies the hostname, IP address, or URL for the database connection. The default scheme is “mysql”.

  • user (str, optional) – Database username.

  • password (str, optional) – Database password.

  • port (int, optional) – Database port. Defaults to 3306 for non-HTTP connections, 80 for HTTP connections, and 443 for HTTPS connections.

  • database (str, optional) – Database name.

Attributes Summary

client

Return SingleStoreDB client.

flat_metadata

stores_text

Methods Summary

add(nodes, **add_kwargs)

Add nodes to index.

class_name()

delete(ref_doc_id, **delete_kwargs)

Delete nodes using with ref_doc_id.

query(query[, filter])

Query index for top k most similar nodes.

Attributes Documentation

client#

Return SingleStoreDB client.

flat_metadata: bool = True#
stores_text: bool = True#

Methods Documentation

add(nodes: List[BaseNode], **add_kwargs: Any) List[str]#

Add nodes to index.

Parameters

nodes – List[BaseNode]: list of nodes with embeddings

classmethod class_name() str#
delete(ref_doc_id: str, **delete_kwargs: Any) None#

Delete nodes using with ref_doc_id.

Parameters

ref_doc_id (str) – The doc_id of the document to delete.

query(query: VectorStoreQuery, filter: Optional[dict] = None, **kwargs: Any) VectorStoreQueryResult#

Query index for top k most similar nodes.

Parameters
  • query (VectorStoreQuery) – Contains query_embedding and similarity_top_k attributes.

  • filter (Optional[dict]) – A dictionary of metadata fields and values to filter by. Defaults to None.

Returns

Contains nodes, similarities, and ids attributes.

Return type

VectorStoreQueryResult