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.

Overview

The Astra DB Document Loader returns a list of LangChain Document objects read from an Astra DB collection. The loader takes the following parameters:
  • api_endpoint: Astra DB API endpoint. Looks like https://01234567-89ab-cdef-0123-456789abcdef-us-east1.apps.astra.datastax.com
  • token: Astra DB token. Looks like AstraCS:aBcD0123...
  • collection_name : AstraDB collection name
  • namespace: (Optional) AstraDB namespace (called keyspace in Astra DB)
  • filter_criteria: (Optional) Filter used in the find query
  • projection: (Optional) Projection used in the find query
  • limit: (Optional) Maximum number of documents to retrieve
  • extraction_function: (Optional) A function to convert the AstraDB document to the LangChain page_content string. Defaults to json.dumps
The loader sets the following metadata for the documents it reads:

Setup

Load documents with the document loader

API Reference: AstraDBLoader