AstraDBVectorStore#

pydantic model llama_index.vector_stores.AstraDBVectorStore#

Astra DB Vector Store.

An abstraction of a Astra table with vector-similarity-search. Documents, and their embeddings, are stored in an Astra table and a vector-capable index is used for searches. The table does not need to exist beforehand: if necessary it will be created behind the scenes.

All Astra operations are done through the astrapy library.

Parameters
  • collection_name (str) – collection name to use. If not existing, it will be created.

  • token (str) – The Astra DB Application Token to use.

  • api_endpoint (str) – The Astra DB JSON API endpoint for your database.

  • embedding_dimension (int) – length of the embedding vectors in use.

  • namespace (Optional[str]) – The namespace to use. If not provided, ‘default_keyspace’

  • ttl_seconds (Optional[int]) – expiration time for inserted entries. Default is no expiration.

Show JSON schema
{
   "title": "AstraDBVectorStore",
   "description": "Astra DB Vector Store.\n\nAn abstraction of a Astra table with\nvector-similarity-search. Documents, and their embeddings, are stored\nin an Astra table and a vector-capable index is used for searches.\nThe table does not need to exist beforehand: if necessary it will\nbe created behind the scenes.\n\nAll Astra operations are done through the astrapy library.\n\nArgs:\n    collection_name (str): collection name to use. If not existing, it will be created.\n    token (str): The Astra DB Application Token to use.\n    api_endpoint (str): The Astra DB JSON API endpoint for your database.\n    embedding_dimension (int): length of the embedding vectors in use.\n    namespace (Optional[str]): The namespace to use. If not provided, 'default_keyspace'\n    ttl_seconds (Optional[int]): expiration time for inserted entries.\n        Default is no expiration.",
   "type": "object",
   "properties": {
      "stores_text": {
         "title": "Stores Text",
         "default": true,
         "type": "boolean"
      },
      "is_embedding_query": {
         "title": "Is Embedding Query",
         "default": true,
         "type": "boolean"
      },
      "flat_metadata": {
         "title": "Flat Metadata",
         "default": true,
         "type": "boolean"
      },
      "class_name": {
         "title": "Class Name",
         "type": "string",
         "default": "base_component"
      }
   }
}

Config
  • schema_extra: function = <function BaseComponent.Config.schema_extra at 0x7ff1e41e53a0>

Fields
  • flat_metadata (bool)

  • stores_text (bool)

field flat_metadata: bool = True#
field stores_text: bool = True#
add(nodes: List[BaseNode], **add_kwargs: Any) List[str]#

Add nodes to index.

Parameters

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

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

Delete nodes using with ref_doc_id.

Parameters

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

query(query: VectorStoreQuery, **kwargs: Any) VectorStoreQueryResult#

Query index for top k most similar nodes.

property client: Any#

Return the underlying Astra vector table object.