Azure AI Search Adapter for Cognee
This adapter provides integration between Cognee and Azure AI Search (formerly Azure Cognitive Search) for vector storage and retrieval operations.
Features
- Full vector search capabilities using Azure AI Search
- Hybrid search (combining text and vector search)
- HNSW algorithm for efficient similarity search
- Async/await support for all operations
- Batch operations for improved performance
Installation
If published, the package can be simply installed via pip:
pip install cognee-community-vector-adapter-azure
In case it is not published yet, you can use poetry to locally build the adapter package:
pip install poetry
poetry install # run this command in the directory containing the pyproject.toml file
Configuration
The adapter requires the following credentials:
endpoint: Your Azure AI Search service endpoint (e.g.,https://your-service.search.windows.net)api_key: Your Azure AI Search API keyembedding_engine: An instance of EmbeddingEngine for text vectorization
Usage
from cognee.infrastructure.databases.vector.embeddings.EmbeddingEngine import EmbeddingEngine
from packages.vector.azureaisearch import AzureAISearchAdapter
# Initialize the adapter
embedding_engine = EmbeddingEngine(...) # Your embedding engine
adapter = AzureAISearchAdapter(
endpoint="https://your-service.search.windows.net",
api_key="your-api-key",
embedding_engine=embedding_engine,
)
# Create a collection (index)
await adapter.create_collection("my_collection")
# Add data points
await adapter.create_data_points("my_collection", data_points)
# Search
results = await adapter.search(collection_name="my_collection", query_text="search query", limit=10)
# Batch search
results = await adapter.batch_search(
collection_name="my_collection", query_texts=["query1", "query2"], limit=10
)
Key Differences from Other Vector Databases
- Collections as Indexes: In Azure AI Search, what other vector databases call "collections" are called "indexes"
- Document Structure: Documents in Azure AI Search have a specific schema with defined fields
- Batch Operations: Azure AI Search doesn't have native batch search, so batch operations are parallelized
- Scoring: Azure AI Search returns
@search.scorewhich is normalized differently than other vector databases
Vector Search Configuration
The adapter uses HNSW (Hierarchical Navigable Small World) algorithm with the following default parameters:
m: 4 (number of bi-directional links)efConstruction: 400 (size of the dynamic list)efSearch: 500 (size of the dynamic list for search)metric: cosine (similarity metric)
These parameters can be adjusted in the create_collection method if needed.
Metadata
Release files for cognee-community-vector-adapter-azure 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| cognee_community_vector_adapter_azure-0.1.0.tar.gz | 319.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cognee_community_vector_adapter_azure-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 327.7 kB
Release files / cognee_community_vector_adapter_azure-0.1.0.tar.gz
| Download URL | cognee_community_vector_adapter_azure-0.1.0.tar.gz |
|---|---|
| Size | 319.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b72207814736b4322d8ee2a1e3816252db9c3ffaec37a0dec035857c64e257f5
|
|
BLAKE2b-256 checksum How to use checksums |
2ca305b2f442a67dbd33d05eeea57e9ac1c8e7a5dec0629f08de1d2a869a2ad2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.10.18 Darwin/24.1.0
|
Release files / cognee_community_vector_adapter_azure-0.1.0-py3-none-any.whl
| Download URL | cognee_community_vector_adapter_azure-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9f4e155c5db6e80b1fc599bdca2d8eda81e2c6173de635cc325e0d1999e8a1fd
|
|
BLAKE2b-256 checksum How to use checksums |
b730fdbcb9245704e2b364b82f6f2f7a926b9d0cd96ac0717d1a8eaa3189816c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.10.18 Darwin/24.1.0
|
Security for cognee-community-vector-adapter-azure 0.1.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.