Skip to main content

Azure Cosmos DB for NoSQL Vector Store

This integration makes possible to use Azure Cosmos DB for NoSQL as a vector store in LlamaIndex.

Quick start

Install the integration with:

pip install llama-index-vector-stores-azurecosmosnosql

Create the CosmosDB client:

URI = "AZURE_COSMOSDB_URI"
KEY = "AZURE_COSMOSDB_KEY"
client = CosmosClient(URI, credential=KEY)

Specify the vector store properties:

indexing_policy = {
    "indexingMode": "consistent",
    "includedPaths": [{"path": "/*"}],
    "excludedPaths": [{"path": '/"_etag"/?'}],
    "vectorIndexes": [{"path": "/embedding", "type": "quantizedFlat"}],
}

vector_embedding_policy = {
    "vectorEmbeddings": [
        {
            "path": "/embedding",
            "dataType": "float32",
            "distanceFunction": "cosine",
            "dimensions": 3072,
        }
    ]
}

Create the vector store:

store = AzureCosmosDBNoSqlVectorSearch(
    cosmos_client=client,
    vector_embedding_policy=vector_embedding_policy,
    indexing_policy=indexing_policy,
    cosmos_container_properties={"partition_key": PartitionKey(path="/id")},
    cosmos_database_properties={},
    create_container=True,
)

Finally, create the index from a list containing documents:

storage_context = StorageContext.from_defaults(vector_store=store)

index = VectorStoreIndex.from_documents(
    documents, storage_context=storage_context
)

Metadata

Release files for llama-index-vector-stores-azurecosmosnosql 1.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llama-index-vector-stores-azurecosmosnosql 1.6.0
File Size Uploaded Provenance Actions
llama_index_vector_stores_azurecosmosnosql-1.6.0.tar.gz 6.3 kB Without provenance Details for llama_index_vector_stores_azurecosmosnosql-1.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llama-index-vector-stores-azurecosmosnosql 1.6.0
File Interpreter ABI Platform Actions
llama_index_vector_stores_azurecosmosnosql-1.6.0-py3-none-any.whl Python 3 none any Details for llama_index_vector_stores_azurecosmosnosql-1.6.0-py3-none-any.whl

Total release size: 12.4 kB

Release files / llama_index_vector_stores_azurecosmosnosql-1.6.0.tar.gz

Download URL llama_index_vector_stores_azurecosmosnosql-1.6.0.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
79ce4e7b8dd410452d0cd9c9244a25031223d152e4cbd1585c4587481032bb2b
BLAKE2b-256 checksum
How to use checksums
29daa0e3d588bdd5926c54083b51f4010b1814ada35861f7ca571a7ab907fd54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / llama_index_vector_stores_azurecosmosnosql-1.6.0-py3-none-any.whl

Download URL llama_index_vector_stores_azurecosmosnosql-1.6.0-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d85b25111fdbf6cba06c2f4223a82198de637f432c63fe6c4eefd6de46e3e69
BLAKE2b-256 checksum
How to use checksums
c380b0959af854ca94dfeda73af2eb66047a42502f84bb08458dffe8c5c9b8d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for llama-index-vector-stores-azurecosmosnosql 1.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page