AzureCosmosDBNoSqlVectorStore
Defined in: packages/providers/storage/azure/src/vectorStore/AzureCosmosDBNoSqlVectorStore.ts:132
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AzureCosmosDBNoSqlVectorStore(
dbConfig):AzureCosmosDBNoSqlVectorStore
Defined in: packages/providers/storage/azure/src/vectorStore/AzureCosmosDBNoSqlVectorStore.ts:175
Parameters
Section titled “Parameters”dbConfig
Section titled “dbConfig”AzureCosmosDBNoSQLConfig & VectorStoreBaseParams
Returns
Section titled “Returns”AzureCosmosDBNoSqlVectorStore
Overrides
Section titled “Overrides”Properties
Section titled “Properties”storesText
Section titled “storesText”storesText:
boolean=true
Defined in: packages/providers/storage/azure/src/vectorStore/AzureCosmosDBNoSqlVectorStore.ts:133
Overrides
Section titled “Overrides”cosmosClient
Section titled “cosmosClient”cosmosClient:
CosmosClient
Defined in: packages/providers/storage/azure/src/vectorStore/AzureCosmosDBNoSqlVectorStore.ts:142
The CosmosDB client. This is either passed in or created.
textKey
Section titled “textKey”textKey:
string
Defined in: packages/providers/storage/azure/src/vectorStore/AzureCosmosDBNoSqlVectorStore.ts:147
The key to use for the text field in the CosmosDB container. Default: “text”
flatMetadata
Section titled “flatMetadata”flatMetadata:
boolean=true
Defined in: packages/providers/storage/azure/src/vectorStore/AzureCosmosDBNoSqlVectorStore.ts:149
idKey:
string
Defined in: packages/providers/storage/azure/src/vectorStore/AzureCosmosDBNoSqlVectorStore.ts:155
The key to use for the id field in the CosmosDB container. Default: “id”
metadataKey
Section titled “metadataKey”metadataKey:
string
Defined in: packages/providers/storage/azure/src/vectorStore/AzureCosmosDBNoSqlVectorStore.ts:161
The key to use for the metadata field in the CosmosDB container. Default: “metadata”
embeddingKey
Section titled “embeddingKey”embeddingKey:
string
Defined in: packages/providers/storage/azure/src/vectorStore/AzureCosmosDBNoSqlVectorStore.ts:167
The key to use for the vector embedding field in the CosmosDB container. Default: “embedding”
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”client()
Section titled “client()”client():
unknown
Defined in: packages/providers/storage/azure/src/vectorStore/AzureCosmosDBNoSqlVectorStore.ts:171
Returns
Section titled “Returns”unknown
Overrides
Section titled “Overrides”fromConnectionString()
Section titled “fromConnectionString()”
staticfromConnectionString(config):AzureCosmosDBNoSqlVectorStore
Defined in: packages/providers/storage/azure/src/vectorStore/AzureCosmosDBNoSqlVectorStore.ts:233
Static method for creating an instance using a connection string.
If no connection string is provided, it will attempt to use the env variable AZURE_COSMOSDB_NOSQL_CONNECTION_STRING as connection string.
Parameters
Section titled “Parameters”config
Section titled “config”object & AzureCosmosDBNoSQLConfig & VectorStoreBaseParams = {}
Returns
Section titled “Returns”AzureCosmosDBNoSqlVectorStore
Instance of AzureCosmosDBNoSqlVectorStore
fromAccountAndKey()
Section titled “fromAccountAndKey()”
staticfromAccountAndKey(config):AzureCosmosDBNoSqlVectorStore
Defined in: packages/providers/storage/azure/src/vectorStore/AzureCosmosDBNoSqlVectorStore.ts:257
Static method for creating an instance using a account endpoint and key.
If no endpoint and key is provided, it will attempt to use the env variable AZURE_COSMOSDB_NOSQL_ACCOUNT_ENDPOINT as enpoint and AZURE_COSMOSDB_NOSQL_ACCOUNT_KEY as key.
Parameters
Section titled “Parameters”config
Section titled “config”object & AzureCosmosDBNoSQLConfig & VectorStoreBaseParams = {}
Returns
Section titled “Returns”AzureCosmosDBNoSqlVectorStore
Instance of AzureCosmosDBNoSqlVectorStore
fromUriAndManagedIdentity()
Section titled “fromUriAndManagedIdentity()”
staticfromUriAndManagedIdentity(config):AzureCosmosDBNoSqlVectorStore
Defined in: packages/providers/storage/azure/src/vectorStore/AzureCosmosDBNoSqlVectorStore.ts:285
Static method for creating an instance using account endpoint and managed identity.
If no endpoint and credentials are provided, it will attempt to use the env variable AZURE_COSMOSDB_NOSQL_ACCOUNT_ENDPOINT as endpoint and use DefaultAzureCredential() as credentials.
Parameters
Section titled “Parameters”config
Section titled “config”object & AzureCosmosDBNoSQLConfig & VectorStoreBaseParams = {}
Returns
Section titled “Returns”AzureCosmosDBNoSqlVectorStore
Instance of AzureCosmosDBNoSqlVectorStore
add(
nodes):Promise<string[]>
Defined in: packages/providers/storage/azure/src/vectorStore/AzureCosmosDBNoSqlVectorStore.ts:311
Adds document to the CosmosDB container.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<string[]>
an array of document ids which were added
Overrides
Section titled “Overrides”delete()
Section titled “delete()”delete(
refDocId,deleteOptions?):Promise<void>
Defined in: packages/providers/storage/azure/src/vectorStore/AzureCosmosDBNoSqlVectorStore.ts:354
Delete all nodes from the CosmosDB container 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?”object
Any options to pass to the delete operations.
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/azure/src/vectorStore/AzureCosmosDBNoSqlVectorStore.ts:379
Performs a vector similarity search query in the CosmosDB container.
Parameters
Section titled “Parameters”VectorStoreQuery
options
Section titled “options”Returns
Section titled “Returns”Promise<VectorStoreQueryResult>
List of nodes along with similarityScore
Overrides
Section titled “Overrides”exists()
Section titled “exists()”exists(
refDocId):Promise<boolean>
Defined in: packages/providers/storage/azure/src/vectorStore/AzureCosmosDBNoSqlVectorStore.ts:463
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