Metadata-Version: 2.5
Name: azure-documentdb-haystack
Version: 1.0.0
Summary: An integration of Azure DocumentDB with Haystack
Project-URL: Source, https://github.com/deepset-ai/haystack-core-integrations
Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/blob/main/integrations/azure_documentdb/README.md
Project-URL: Issues, https://github.com/deepset-ai/haystack-core-integrations/issues
Author-email: deepset GmbH <info@deepset.ai>
License-Expression: Apache-2.0
License-File: LICENSE.txt
Keywords: azure,documentdb,haystack,rag,vector-search
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.10
Requires-Dist: azure-identity>=1.15.0
Requires-Dist: haystack-ai>=2.28.0
Requires-Dist: pymongo[srv]>=4.13.0
Description-Content-Type: text/markdown

# azure-documentdb-haystack

[![PyPI - Version](https://img.shields.io/pypi/v/azure-documentdb-haystack.svg)](https://pypi.org/project/azure-documentdb-haystack)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/azure-documentdb-haystack.svg)](https://pypi.org/project/azure-documentdb-haystack)

Haystack document store and retrievers for [Azure DocumentDB](https://learn.microsoft.com/azure/documentdb/overview).

## Installation

```bash
pip install azure-documentdb-haystack
```

## Authentication

Microsoft Entra ID is the default and recommended authentication method. `DefaultAzureCredential` supports local Azure
CLI credentials, workload identity, and managed identity without changing application code. Assign the identity an
appropriate Azure DocumentDB data-plane role, then set the cluster name:

```bash
AZURE_DOCUMENTDB_CLUSTER_NAME=my-cluster
```

For local development and integration testing only, a connection string can be supplied through
`AZURE_DOCUMENTDB_CONNECTION_STRING`. The integration emits a warning whenever this fallback is used.

## Usage

```python
from haystack_integrations.document_stores.azure_documentdb import AzureDocumentDBDocumentStore

store = AzureDocumentDBDocumentStore(
    database_name="haystack",
    collection_name="documents",
)

# Create once. The collection must exist before initializing the store.
store.create_vector_index(dimensions=1536, kind="vector-hnsw", similarity="COS", m=16, efConstruction=64)
```

Use `AzureDocumentDBEmbeddingRetriever` for `cosmosSearch` vector queries. `AzureDocumentDBFullTextRetriever` supports
Azure DocumentDB BM25 full-text search, which is currently a gated preview and must be enabled on the cluster.

- [Azure DocumentDB vector search](https://learn.microsoft.com/azure/documentdb/vector-search)
- [Azure DocumentDB full-text search](https://learn.microsoft.com/azure/documentdb/full-text-search-overview)
- [Changelog](https://github.com/deepset-ai/haystack-core-integrations/blob/main/integrations/azure_documentdb/CHANGELOG.md)

## Contributing

Refer to the general [Contribution Guidelines](https://github.com/deepset-ai/haystack-core-integrations/blob/main/CONTRIBUTING.md).
