langchain_community.storage.astradb.AstraDBStore¶

class langchain_community.storage.astradb.AstraDBStore(collection_name: str, token: Optional[str] = None, api_endpoint: Optional[str] = None, astra_db_client: Optional[Any] = None, namespace: Optional[str] = None)[source]¶

BaseStore implementation using DataStax AstraDB as the underlying store. The value type can be any type serializable by json.dumps. Can be used to store embeddings with the CacheBackedEmbeddings. Documents in the AstraDB collection will have the format {

“_id”: “<key>”, “value”: <value>

}

Methods

__init__(collection_name[, token, ...])

decode_value(value)

Decodes value from Astra DB

encode_value(value)

Encodes value for Astra DB

mdelete(keys)

Delete the given keys.

mget(keys)

Get the values associated with the given keys.

mset(key_value_pairs)

Set the given key-value pairs.

yield_keys(*[, prefix])

Yield keys in the store.

__init__(collection_name: str, token: Optional[str] = None, api_endpoint: Optional[str] = None, astra_db_client: Optional[Any] = None, namespace: Optional[str] = None) None¶
decode_value(value: Any) Any[source]¶

Decodes value from Astra DB

encode_value(value: Any) Any[source]¶

Encodes value for Astra DB

mdelete(keys: Sequence[str]) None¶

Delete the given keys.

mget(keys: Sequence[str]) List[Optional[V]]¶

Get the values associated with the given keys.

mset(key_value_pairs: Sequence[Tuple[str, V]]) None¶

Set the given key-value pairs.

yield_keys(*, prefix: Optional[str] = None) Iterator[str]¶

Yield keys in the store.