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.

LLM cache

Semantic LLM cache

Document loader

Learn more in the example notebook.

Self-querying retriever

Store

See the API Reference for the AstraDBStore.

Byte store

See the API reference for the AstraDBByteStore.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.