Skip to main content

Class: AstraDBVectorStore

Extends

Implements

Constructors

new AstraDBVectorStore()

new AstraDBVectorStore(init?): AstraDBVectorStore

Parameters

init?: Partial<AstraDBVectorStore> & object & Partial<IEmbedModel>

Returns

AstraDBVectorStore

Overrides

VectorStoreBase.constructor

Defined in

packages/llamaindex/src/vector-store/AstraDBVectorStore.ts:33

Properties

contentKey

contentKey: string

Defined in

packages/llamaindex/src/vector-store/AstraDBVectorStore.ts:27


embedModel

embedModel: BaseEmbedding

Inherited from

VectorStoreBase.embedModel

Defined in

packages/llamaindex/src/vector-store/types.ts:104


flatMetadata

flatMetadata: boolean = true

Defined in

packages/llamaindex/src/vector-store/AstraDBVectorStore.ts:24


idKey

idKey: string

Defined in

packages/llamaindex/src/vector-store/AstraDBVectorStore.ts:26


storesText

storesText: boolean = true

Implementation of

VectorStoreNoEmbedModel.storesText

Defined in

packages/llamaindex/src/vector-store/AstraDBVectorStore.ts:23

Methods

add()

add(nodes): Promise<string[]>

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

Parameters

nodes: BaseNode<Metadata>[]

Returns

Promise<string[]>

and array of node ids which were added

Implementation of

VectorStoreNoEmbedModel.add

Defined in

packages/llamaindex/src/vector-store/AstraDBVectorStore.ts:112


client()

client(): DataAPIClient

Get an instance of your Astra DB client.

Returns

DataAPIClient

the AstraDB client

Implementation of

VectorStoreNoEmbedModel.client

Defined in

packages/llamaindex/src/vector-store/AstraDBVectorStore.ts:103


connect()

connect(collection): Promise<void>

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

Parameters

collection: string

Returns

Promise<void>

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

Defined in

packages/llamaindex/src/vector-store/AstraDBVectorStore.ts:92


createAndConnect()

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

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.

Parameters

collection: string

options?: CreateCollectionOptions<SomeDoc>

Returns

Promise<void>

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

Defined in

packages/llamaindex/src/vector-store/AstraDBVectorStore.ts:75


delete()

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

Delete a document from your Astra DB collection.

Parameters

refDocId: string

deleteOptions?: DeleteOneOptions

Returns

Promise<void>

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

Implementation of

VectorStoreNoEmbedModel.delete

Defined in

packages/llamaindex/src/vector-store/AstraDBVectorStore.ts:152


query()

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

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

Parameters

query: VectorStoreQuery

options?: FindOptions

Returns

Promise<VectorStoreQueryResult>

Implementation of

VectorStoreNoEmbedModel.query

Defined in

packages/llamaindex/src/vector-store/AstraDBVectorStore.ts:177