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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_readers_astra_db-0.6.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llama_index_readers_astra_db-0.6.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_readers_astra_db-0.6.0.tar.gz.

File metadata

  • Download URL: llama_index_readers_astra_db-0.6.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for llama_index_readers_astra_db-0.6.0.tar.gz
Algorithm Hash digest
SHA256 c6954e0293ea0b68f6e677df7e6aa713865214add7605496fb39bb80831d948d
MD5 ae4fd7e572cd429fddf5a77485240a5e
BLAKE2b-256 0efedb236e3a132bdf8a2c94efba14754fb1e2e554c9da71a3801fd3bd6851e8

See more details on using hashes here.

File details

Details for the file llama_index_readers_astra_db-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: llama_index_readers_astra_db-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for llama_index_readers_astra_db-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 76eaa458bc0b9341fedb6b0c4362039b34f8b5885452d872dca321715b58601f
MD5 52e32a56a9656ea93c8446b346d1b21b
BLAKE2b-256 b6e20d94f3e63e2eef03956d189d9406dcbd7702a191b66c9a8dd928786b93f9

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.1

2 files

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