Skip to main content

Astra DB Loader

pip install llama-index-readers-astra-db

The Astra DB Loader returns a set of documents retrieved from Astra DB. The user initializes the loader with an Astra DB index. They then pass in a vector.

Usage

Here's an example usage of the AstraDBReader.

from openai import OpenAI


# Get the credentials for Astra DB
api_endpoint = "https://324<...>f1c.astra.datastax.com"
token = "AstraCS:<...>"

# EXAMPLE: OpenAI embeddings
client = OpenAI(api_key="sk-<...>")

# Call OpenAI (or generate embeddings another way)
response = client.embeddings.create(
    input="Your text string goes here", model="text-embedding-ada-002"
)

# Get the embedding
query_vector = response.data[0].embedding

# Initialize the Reader object
from llama_index.readers.astra_db import AstraDBReader

# Your Astra DB Account will provide you with the endpoint URL and Token
reader = AstraDBReader(
    collection_name="astra_v_table",
    token=token,
    api_endpoint=api_endpoint,
    embedding_dimension=len(query_vector),
)

# Fetch data from the reader
documents = reader.load_data(vector=query_vector, limit=5)

This loader is designed to be used as a way to load data into LlamaIndex.

Note: Please see the AstraDB documentation here.

Metadata

Release files for llama-index-readers-astra-db 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llama-index-readers-astra-db 0.6.0
File Size Uploaded Provenance Actions
llama_index_readers_astra_db-0.6.0.tar.gz 4.5 kB Without provenance Details for llama_index_readers_astra_db-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llama-index-readers-astra-db 0.6.0
File Interpreter ABI Platform Actions
llama_index_readers_astra_db-0.6.0-py3-none-any.whl Python 3 none any Details for llama_index_readers_astra_db-0.6.0-py3-none-any.whl

Total release size: 8.6 kB

Release files / llama_index_readers_astra_db-0.6.0.tar.gz

Download URL llama_index_readers_astra_db-0.6.0.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c6954e0293ea0b68f6e677df7e6aa713865214add7605496fb39bb80831d948d
BLAKE2b-256 checksum
How to use checksums
0efedb236e3a132bdf8a2c94efba14754fb1e2e554c9da71a3801fd3bd6851e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / llama_index_readers_astra_db-0.6.0-py3-none-any.whl

Download URL llama_index_readers_astra_db-0.6.0-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
76eaa458bc0b9341fedb6b0c4362039b34f8b5885452d872dca321715b58601f
BLAKE2b-256 checksum
How to use checksums
b6e20d94f3e63e2eef03956d189d9406dcbd7702a191b66c9a8dd928786b93f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for llama-index-readers-astra-db 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page