AstraDBVectorStore
Defined in: packages/providers/storage/astra/src/AstraDBVectorStore.ts:26
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AstraDBVectorStore(
init?):AstraDBVectorStore
Defined in: 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”Properties
Section titled “Properties”storesText
Section titled “storesText”storesText:
boolean=true
Defined in: packages/providers/storage/astra/src/AstraDBVectorStore.ts:27
Overrides
Section titled “Overrides”flatMetadata
Section titled “flatMetadata”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
Section titled “contentKey”contentKey:
string
Defined in: packages/providers/storage/astra/src/AstraDBVectorStore.ts:31
embedModel
Section titled “embedModel”embedModel:
BaseEmbedding
Defined in: packages/core/src/vector-store/index.ts:128
Inherited from
Section titled “Inherited from”isEmbeddingQuery?
Section titled “isEmbeddingQuery?”
optionalisEmbeddingQuery:boolean
Defined in: packages/core/src/vector-store/index.ts:130
Inherited from
Section titled “Inherited from”BaseVectorStore.isEmbeddingQuery
Methods
Section titled “Methods”createAndConnect()
Section titled “createAndConnect()”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.
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: 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: 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”add(
nodes):Promise<string[]>
Defined in: packages/providers/storage/astra/src/AstraDBVectorStore.ts:116
Add your document(s) to your Astra DB collection.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<string[]>
an array of node ids which were added
Overrides
Section titled “Overrides”delete()
Section titled “delete()”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.
Parameters
Section titled “Parameters”refDocId
Section titled “refDocId”string
Reference document ID - all nodes with this ref_doc_id will be deleted.
deleteOptions?
Section titled “deleteOptions?”WithTimeout
DeleteManyOptions 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”query()
Section titled “query()”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.
Parameters
Section titled “Parameters”VectorStoreQuery
options?
Section titled “options?”FindOptions
FindOptions
Returns
Section titled “Returns”Promise<VectorStoreQueryResult>
Overrides
Section titled “Overrides”exists()
Section titled “exists()”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.
Parameters
Section titled “Parameters”refDocId
Section titled “refDocId”string
The reference document ID to check
Returns
Section titled “Returns”Promise<boolean>
true if any nodes with this ref_doc_id exist