AstraDB is a document database with a highly performant vector index powered by Apache Cassandra and available as a managed service.To use Astra as database -
Sign up for an AstraDB account. It is free to sign up and doesnβt require a credit card.
Create a database (this takes a couple of minutes to provision)
From the database overview page get the API Endpoint and generate an Application Token
import { RAGApplicationBuilder } from '@llm-tools/embedjs';import { OpenAiEmbeddings } from '@llm-tools/embedjs-openai';import { AstraDb } from '@llm-tools/embedjs-astradb';import { WebLoader } from '@llm-tools/embedjs-loader-web';// set OPENAI_API_KEY in your envprocess.env.OPENAI_API_KEY = "sk-xxx";const app = await new RAGApplicationBuilder().setEmbeddingModel(new OpenAiEmbeddings()).setModel(SIMPLE_MODELS.OPENAI_GPT4_O).setVectorDatabase( new AstraDb({ endpoint: "<ASTRA_DB_API_ENDPOINT>", apiKey: "<ASTRA_DB_APP_TOKEN>", collectionName: "documents" })).build();//add data source and start query itawait app.addLoader(new WebLoader({ urlOrContent: 'https://www.forbes.com/profile/elon-musk' }));await app.query('Tell me about Elon Musk');
If you can't find specific feature or run into issues, please feel free to reach out through the following channels.