Skip to main content

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 key
  • embedding_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

  1. Collections as Indexes: In Azure AI Search, what other vector databases call "collections" are called "indexes"
  2. Document Structure: Documents in Azure AI Search have a specific schema with defined fields
  3. Batch Operations: Azure AI Search doesn't have native batch search, so batch operations are parallelized
  4. Scoring: Azure AI Search returns @search.score which 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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cognee_community_vector_adapter_azure-0.1.0.tar.gz (319.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file cognee_community_vector_adapter_azure-0.1.0.tar.gz.

File metadata

File hashes

Hashes for cognee_community_vector_adapter_azure-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b72207814736b4322d8ee2a1e3816252db9c3ffaec37a0dec035857c64e257f5
MD5 80dd6fc656b3432e28853891a7039ed2
BLAKE2b-256 2ca305b2f442a67dbd33d05eeea57e9ac1c8e7a5dec0629f08de1d2a869a2ad2

See more details on using hashes here.

File details

Details for the file cognee_community_vector_adapter_azure-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cognee_community_vector_adapter_azure-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9f4e155c5db6e80b1fc599bdca2d8eda81e2c6173de635cc325e0d1999e8a1fd
MD5 015bed333214443b0b6c05cbdeb531a9
BLAKE2b-256 b730fdbcb9245704e2b364b82f6f2f7a926b9d0cd96ac0717d1a8eaa3189816c

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.0

2 files

This release

0.1.0 This release

2 files

0.0.2

2 files

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