AstraDBVectorStore
Defined in: .build/typescript/packages/providers/storage/astra/src/AstraDBVectorStore.ts:26
Extends
Section titled “Extends”BaseVectorStore
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AstraDBVectorStore(
init?
):AstraDBVectorStore
Defined in: .build/typescript/packages/providers/storage/astra/src/AstraDBVectorStore.ts:37
Parameters
Section titled “Parameters”Partial
<AstraDBVectorStore
> & object
& VectorStoreBaseParams
Returns
Section titled “Returns”AstraDBVectorStore
Overrides
Section titled “Overrides”BaseVectorStore.constructor
Properties
Section titled “Properties”storesText
Section titled “storesText”storesText:
boolean
=true
Defined in: .build/typescript/packages/providers/storage/astra/src/AstraDBVectorStore.ts:27
Overrides
Section titled “Overrides”BaseVectorStore.storesText
flatMetadata
Section titled “flatMetadata”flatMetadata:
boolean
=true
Defined in: .build/typescript/packages/providers/storage/astra/src/AstraDBVectorStore.ts:28
idKey:
string
Defined in: .build/typescript/packages/providers/storage/astra/src/AstraDBVectorStore.ts:30
contentKey
Section titled “contentKey”contentKey:
string
Defined in: .build/typescript/packages/providers/storage/astra/src/AstraDBVectorStore.ts:31
Methods
Section titled “Methods”createAndConnect()
Section titled “createAndConnect()”createAndConnect(
collection
,options?
):Promise
<void
>
Defined in: .build/typescript/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.
Parameters
Section titled “Parameters”collection
Section titled “collection”string
Your new collection’s name
options?
Section titled “options?”CreateCollectionOptions
<SomeDoc
>
CreateCollectionOptions used to set the number of vector dimensions and similarity metric
Returns
Section titled “Returns”Promise
<void
>
Promise that resolves if the creation did not throw an error.
connect()
Section titled “connect()”connect(
collection
):Promise
<void
>
Defined in: .build/typescript/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.
Parameters
Section titled “Parameters”collection
Section titled “collection”string
Your existing collection’s name
Returns
Section titled “Returns”Promise
<void
>
Promise that resolves if the connection did not throw an error.
client()
Section titled “client()”client():
DataAPIClient
Defined in: .build/typescript/packages/providers/storage/astra/src/AstraDBVectorStore.ts:107
Get an instance of your Astra DB client.
Returns
Section titled “Returns”DataAPIClient
the AstraDB client
Overrides
Section titled “Overrides”BaseVectorStore.client
add(
nodes
):Promise
<string
[]>
Defined in: .build/typescript/packages/providers/storage/astra/src/AstraDBVectorStore.ts:116
Add your document(s) to your Astra DB collection.
Parameters
Section titled “Parameters”BaseNode
<Metadata
>[]
Returns
Section titled “Returns”Promise
<string
[]>
an array of node ids which were added
Overrides
Section titled “Overrides”BaseVectorStore.add
delete()
Section titled “delete()”delete(
refDocId
,deleteOptions?
):Promise
<void
>
Defined in: .build/typescript/packages/providers/storage/astra/src/AstraDBVectorStore.ts:156
Delete a document from your Astra DB collection.
Parameters
Section titled “Parameters”refDocId
Section titled “refDocId”string
The id of the document to delete
deleteOptions?
Section titled “deleteOptions?”DeleteOneOptions
DeleteOneOptions to pass to the delete query
Returns
Section titled “Returns”Promise
<void
>
Promise that resolves if the delete query did not throw an error.
Overrides
Section titled “Overrides”BaseVectorStore.delete
query()
Section titled “query()”query(
query
,options?
):Promise
<VectorStoreQueryResult
>
Defined in: .build/typescript/packages/providers/storage/astra/src/AstraDBVectorStore.ts:181
Query documents from your Astra DB collection to get the closest match to your embedding.
Parameters
Section titled “Parameters”VectorStoreQuery
VectorStoreQuery
options?
Section titled “options?”FindOptions
FindOptions
Returns
Section titled “Returns”Promise
<VectorStoreQueryResult
>
Overrides
Section titled “Overrides”BaseVectorStore.query