Skip to main content

Class: AzureCosmosDBNoSqlVectorStore

Extends

Constructors

new AzureCosmosDBNoSqlVectorStore()

new AzureCosmosDBNoSqlVectorStore(dbConfig): AzureCosmosDBNoSqlVectorStore

Parameters

dbConfig: AzureCosmosDBNoSQLConfig & VectorStoreBaseParams

Returns

AzureCosmosDBNoSqlVectorStore

Overrides

BaseVectorStore.constructor

Defined in

packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:171

Properties

cosmosClient

cosmosClient: CosmosClient

The CosmosDB client. This is either passed in or created.

Defined in

packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:138


embeddingKey

embeddingKey: string

The key to use for the vector embedding field in the CosmosDB container. Default: "embedding"

Defined in

packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:163


embedModel

embedModel: BaseEmbedding

Inherited from

BaseVectorStore.embedModel

Defined in

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


flatMetadata

flatMetadata: boolean = true

Defined in

packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:145


idKey

idKey: string

The key to use for the id field in the CosmosDB container. Default: "id"

Defined in

packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:151


isEmbeddingQuery?

optional isEmbeddingQuery: boolean

Inherited from

BaseVectorStore.isEmbeddingQuery

Defined in

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


metadataKey

metadataKey: string

The key to use for the metadata field in the CosmosDB container. Default: "metadata"

Defined in

packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:157


storesText

storesText: boolean = true

Overrides

BaseVectorStore.storesText

Defined in

packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:129


textKey

textKey: string

The key to use for the text field in the CosmosDB container. Default: "text"

Defined in

packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:143

Methods

add()

add(nodes): Promise<string[]>

Adds document to the CosmosDB container.

Parameters

nodes: BaseNode<Metadata>[]

Returns

Promise<string[]>

an array of document ids which were added

Overrides

BaseVectorStore.add

Defined in

packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:307


client()

client(): unknown

Returns

unknown

Overrides

BaseVectorStore.client

Defined in

packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:167


delete()

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

Delete a document from the CosmosDB container.

Parameters

refDocId: string

The id of the document to delete

deleteOptions?: object

Any options to pass to the container.item.delete function

Returns

Promise<void>

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

Overrides

BaseVectorStore.delete

Defined in

packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:350


query()

query(query, options): Promise<VectorStoreQueryResult>

Performs a vector similarity search query in the CosmosDB container.

Parameters

query: VectorStoreQuery

VectorStoreQuery

options: AzureCosmosQueryOptions = {}

Returns

Promise<VectorStoreQueryResult>

List of nodes along with similarityScore

Overrides

BaseVectorStore.query

Defined in

packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:361


fromAccountAndKey()

static fromAccountAndKey(config): AzureCosmosDBNoSqlVectorStore

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

config: object & AzureCosmosDBNoSQLConfig & VectorStoreBaseParams = {}

Returns

AzureCosmosDBNoSqlVectorStore

Instance of AzureCosmosDBNoSqlVectorStore

Defined in

packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:253


fromConnectionString()

static fromConnectionString(config): AzureCosmosDBNoSqlVectorStore

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

config: object & AzureCosmosDBNoSQLConfig & VectorStoreBaseParams = {}

Returns

AzureCosmosDBNoSqlVectorStore

Instance of AzureCosmosDBNoSqlVectorStore

Defined in

packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:229


fromUriAndManagedIdentity()

static fromUriAndManagedIdentity(config): AzureCosmosDBNoSqlVectorStore

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

config: object & AzureCosmosDBNoSQLConfig & VectorStoreBaseParams = {}

Returns

AzureCosmosDBNoSqlVectorStore

Instance of AzureCosmosDBNoSqlVectorStore

Defined in

packages/llamaindex/src/vector-store/AzureCosmosDBNoSqlVectorStore.ts:281