Skip to main content
DataStax Astra DB is a serverless AI-ready database built on Apache Cassandra® and made conveniently available through an easy-to-use JSON API.
See a tutorial provided by DataStax.

Installation and Setup

Install the following Python package:
Create a database (if needed) and get the connection secrets. Set the following variables:

Vector Store

A few typical initialization patterns are shown here:
Notable features of class AstraDBVectorStore:
  • native async API;
  • metadata filtering in search;
  • MMR (maximum marginal relevance) search;
  • server-side embedding computation (“vectorize” in Astra DB parlance);
  • auto-detect its settings from an existing, pre-populated Astra DB collection;
  • hybrid search (vector + BM25 and then a rerank step);
  • support for non-Astra Data API (e.g. self-hosted HCD deployments);
Learn more in the example notebook. See the example provided by DataStax.

Chat message history

See the usage example.

LLM Cache

Learn more in the example notebook (scroll to the Astra DB section).

Semantic LLM Cache

Learn more in the example notebook (scroll to the appropriate section).

Document loader

Learn more in the example notebook.

Self-querying retriever

Learn more in the example notebook.

Store

See the API Reference for the AstraDBStore.

Byte Store

See the API reference for the AstraDBByteStore.