langchain-astradb
An integration package connecting Astra DB and LangChain
What it is and what it does
langchain-astradb is a LangChain integration package that connects to DataStax Astra DB, a serverless vector-capable database built on Apache Cassandra. It replaces deprecated community-maintained Astra DB classes and provides six main components: AstraDBVectorStore for vector similarity search (including hybrid search with BM25 and reranking), AstraDBChatMessageHistory for storing conversation state, AstraDBCache and AstraDBSemanticCache for LLM response caching, AstraDBLoader for retrieving documents, and AstraDBStore/AstraDBByteStore for key-value storage.
The package depends on langchain-core, astrapy, and numpy. It handles collection creation idempotently by default, meaning it will create the underlying Astra DB collection on first use if it doesn't exist, or verify configuration matches if it does. The documentation emphasizes configuration matching between your code and the database to avoid mismatch errors, particularly around hybrid search settings and indexing options. It supports autodetection of collection configuration and offers explicit setup modes for predictable behavior.
Use it for:
- Build RAG (retrieval-augmented generation) applications using AstraDBVectorStore for semantic search over document embeddings.
- Store and retrieve multi-turn conversation history in stateless LLM applications via AstraDBChatMessageHistory.
- Cache LLM responses to reduce API costs and latency using AstraDBCache or AstraDBSemanticCache for semantic deduplication.
- Load and index documents from Astra DB collections into LangChain workflows using AstraDBLoader.
- Implement hybrid search combining vector similarity, keyword matching (BM25), and reranking in a single query.
- Migrate from deprecated langchain_community Astra DB classes to get latest features and modern astrapy compatibility.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Integrates Astra DB (a serverless vector database built on Apache Cassandra) with LangChain, providing vector storage, chat history, caching, and document loading capabilities.
Yes. This is an actively maintained, low-friction integration with no known vulnerabilities and permissive licensing. Install it if you are building LangChain applications on Astra DB or migrating away from deprecated community plugins. Be aware that collection configuration must match your code's expectations to avoid mismatch errors, particularly around hybrid search and indexing settings.
Install
langchain-astradb on PyPI
pip
pip install langchain-astradbuv
uv add langchain-astradbpoetry
poetry add langchain-astradbInstalling langchain-astradb
Before you install
Low install friction with a pure-Python wheel distribution. Actively maintained with recent commits and no known vulnerabilities. Requires Python 3.10 or later.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install langchain-astradb
from langchain_astradb import AstraDBVectorStore
vector_store = AstraDBVectorStore(
embedding=my_embedding,
collection_name="my_collection",
api_endpoint="https://...",
token="AstraCS:...",
)
Requires an active Astra DB instance with API endpoint and application token; Python 3.10 or later.
Verify before relying
- Whether server-side embedding computation ('vectorize') requires additional setup or API keys beyond the Astra DB token.
- Performance characteristics and scaling limits for the vector store with large document collections.
- Compatibility guarantees with specific versions of langchain-core and astrapy beyond what the dependency pins enforce.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0.0,>=3.10.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — langchain-core, astrapy, numpy |
| Maintenance | actively maintained — 295 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 241,700/month — #8,871 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: langchain_astradb-1.0.0-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
astrapyAstraPy is a Python client library for DataStax…
permissive · top 15,000 on PyPI
langchain-postgresProvides LangChain abstractions for vector…
permissive · top 5,000 on PyPI
langchain-mongodbConnects MongoDB Atlas Vector Search to…
unclear · top 5,000 on PyPI
langchain-weaviateIntegrates Weaviate vector database with…
permissive · top 15,000 on PyPI
langchain-qdrantConnects LangChain applications to Qdrant…
permissive · top 5,000 on PyPI
langchain-pineconeConnects LangChain applications to Pinecone…
permissive · top 5,000 on PyPI
langchain-oracledbIntegrates Oracle Database with LangChain to…
unclear · top 15,000 on PyPI
langchain-milvusIntegrates LangChain with Milvus vector…
permissive · top 15,000 on PyPI
langchain-chromaConnects LangChain applications to Chroma, a…
permissive · top 5,000 on PyPI
cassiocassIO integrates Apache Cassandra with machine…
permissive · top 15,000 on PyPI