Skip to main content

Azure AI search vector database adapter for cognee

Reason this release was yanked:

bad versioning

Project description

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

pip install -r requirements.txt

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.

Project details


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-1.0.0.tar.gz (373.0 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-1.0.0.tar.gz.

File metadata

File hashes

Hashes for cognee_community_vector_adapter_azure-1.0.0.tar.gz
Algorithm Hash digest
SHA256 42245f1916e38ce21f5aa83e341f9a170817e4a95a3b2f4e17d2c8209747cc80
MD5 db8469e77366e8dc5736147d888ba0c0
BLAKE2b-256 6dc108cb111dc734d8ec92651916eaf1ba31184a78320ea3eedf64683c160a9d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cognee_community_vector_adapter_azure-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d21bb23738c46ba4d0ba8ef8c5ecc13a246cabc4362cb6659f7cfc2bead8af5
MD5 223fc74abad5ae445592b1de2f74dae3
BLAKE2b-256 692bb5c5ef8b129ec6644957fe5f6d6b32a94d0de7fa3b2a447bdacf376843a0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page