AzureCosmosDBNoSqlVectorStore
Defined in: packages/providers/storage/azure/src/vectorStore/AzureCosmosDBNoSqlVectorStore.ts:131
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:174
Parameters
Section titled “Parameters”dbConfig
Section titled “dbConfig”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:132
Overrides
Section titled “Overrides”cosmosClient
Section titled “cosmosClient”cosmosClient:
CosmosClient
Defined in: packages/providers/storage/azure/src/vectorStore/AzureCosmosDBNoSqlVectorStore.ts:141
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:146
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:148
idKey:
string
Defined in: packages/providers/storage/azure/src/vectorStore/AzureCosmosDBNoSqlVectorStore.ts:154
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:160
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:166
The key to use for the vector embedding field in the CosmosDB container. Default: “embedding”
isEmbeddingQuery?
Section titled “isEmbeddingQuery?”
optionalisEmbeddingQuery:boolean
Defined in: packages/core/src/vector-store/index.ts:120
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:170
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:232
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 = {}
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:255
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 = {}
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:282
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 = {}
Returns
Section titled “Returns”AzureCosmosDBNoSqlVectorStore
Instance of AzureCosmosDBNoSqlVectorStore
add(
nodes):Promise<string[]>
Defined in: packages/providers/storage/azure/src/vectorStore/AzureCosmosDBNoSqlVectorStore.ts:307
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:350
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:375
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:459
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