Skip to content

AstraDBVectorStore

Defined in: packages/providers/storage/astra/src/AstraDBVectorStore.ts:26

new AstraDBVectorStore(init?): AstraDBVectorStore

Defined in: packages/providers/storage/astra/src/AstraDBVectorStore.ts:37

Partial<AstraDBVectorStore> & object & VectorStoreBaseParams

AstraDBVectorStore

BaseVectorStore.constructor

storesText: boolean = true

Defined in: packages/providers/storage/astra/src/AstraDBVectorStore.ts:27

BaseVectorStore.storesText


flatMetadata: boolean = true

Defined in: packages/providers/storage/astra/src/AstraDBVectorStore.ts:28


idKey: string

Defined in: packages/providers/storage/astra/src/AstraDBVectorStore.ts:30


contentKey: string

Defined in: packages/providers/storage/astra/src/AstraDBVectorStore.ts:31


embedModel: BaseEmbedding

Defined in: packages/core/src/vector-store/index.ts:128

BaseVectorStore.embedModel


optional isEmbeddingQuery: boolean

Defined in: packages/core/src/vector-store/index.ts:130

BaseVectorStore.isEmbeddingQuery

createAndConnect(collection, options?): Promise<void>

Defined in: packages/providers/storage/astra/src/AstraDBVectorStore.ts:79

Create a new collection in your Astra DB vector database and connects to it. You must call this method or connect before adding, deleting, or querying.

string

Your new collection’s name

CreateCollectionOptions<SomeDoc>

CreateCollectionOptions used to set the number of vector dimensions and similarity metric

Promise<void>

Promise that resolves if the creation did not throw an error.


connect(collection): Promise<void>

Defined in: packages/providers/storage/astra/src/AstraDBVectorStore.ts:96

Connect to an existing collection in your Astra DB vector database. You must call this method or createAndConnect before adding, deleting, or querying.

string

Your existing collection’s name

Promise<void>

Promise that resolves if the connection did not throw an error.


client(): DataAPIClient

Defined in: packages/providers/storage/astra/src/AstraDBVectorStore.ts:107

Get an instance of your Astra DB client.

DataAPIClient

the AstraDB client

BaseVectorStore.client


add(nodes): Promise<string[]>

Defined in: packages/providers/storage/astra/src/AstraDBVectorStore.ts:116

Add your document(s) to your Astra DB collection.

BaseNode<Metadata>[]

Promise<string[]>

an array of node ids which were added

BaseVectorStore.add


delete(refDocId, deleteOptions?): Promise<void>

Defined in: packages/providers/storage/astra/src/AstraDBVectorStore.ts:156

Delete all nodes from your Astra DB collection that belong to the given document.

string

Reference document ID - all nodes with this ref_doc_id will be deleted.

WithTimeout

DeleteManyOptions to pass to the delete query

Promise<void>

Promise that resolves if the delete query did not throw an error.

BaseVectorStore.delete


query(query, options?): Promise<VectorStoreQueryResult>

Defined in: packages/providers/storage/astra/src/AstraDBVectorStore.ts:181

Query documents from your Astra DB collection to get the closest match to your embedding.

VectorStoreQuery

VectorStoreQuery

FindOptions

FindOptions

Promise<VectorStoreQueryResult>

BaseVectorStore.query


exists(refDocId): Promise<boolean>

Defined in: packages/providers/storage/astra/src/AstraDBVectorStore.ts:269

Check if any nodes exist for the given document reference ID. Used for de-duplication during ingestion.

string

The reference document ID to check

Promise<boolean>

true if any nodes with this ref_doc_id exist

BaseVectorStore.exists