haive.core.engine.retriever.providers.AzureAISearchRetrieverConfig

Azure AI Search Retriever implementation for the Haive framework.

from typing import Any This module provides a configuration class for the Azure AI Search (formerly Azure Cognitive Search) retriever, which retrieves documents from Azure’s cloud search service.

The AzureAISearchRetriever works by: 1. Connecting to an Azure AI Search service 2. Executing search queries against indexed documents 3. Returning ranked search results as documents

This retriever is particularly useful when: - Using Azure cloud infrastructure - Need enterprise-grade search capabilities - Working with large document collections in Azure - Combining with other Azure AI services

The implementation integrates with LangChain’s AzureAISearchRetriever while providing a consistent Haive configuration interface with secure credential management.

Classes

AzureAISearchRetrieverConfig

Configuration for Azure AI Search retriever in the Haive framework.

Module Contents

class haive.core.engine.retriever.providers.AzureAISearchRetrieverConfig.AzureAISearchRetrieverConfig[source]

Bases: haive.core.common.mixins.secure_config.SecureConfigMixin, haive.core.engine.retriever.retriever.BaseRetrieverConfig

Configuration for Azure AI Search retriever in the Haive framework.

This retriever searches documents in Azure AI Search service and returns ranked results. It requires Azure credentials and search service configuration.

retriever_type

The type of retriever (always AZURE_AI_SEARCH).

Type:

RetrieverType

api_key

Azure Search API key (auto-resolved from AZURE_SEARCH_API_KEY).

Type:

Optional[SecretStr]

azure_search_endpoint

Azure Search service endpoint URL.

Type:

str

azure_search_index

Name of the search index to query.

Type:

str

top_k

Number of documents to retrieve (default: 10).

Type:

int

search_type

Type of search to perform (default: “similarity”).

Type:

str

semantic_configuration_name

Name of semantic configuration to use.

Type:

Optional[str]

Examples

>>> from haive.core.engine.retriever import AzureAISearchRetrieverConfig
>>>
>>> # Create the azure ai search retriever config
>>> config = AzureAISearchRetrieverConfig(
...     name="azure_search_retriever",
...     azure_search_endpoint="https://my-search-service.search.windows.net",
...     azure_search_index="documents-index",
...     top_k=5,
...     search_type="semantic"
... )
>>>
>>> # Instantiate and use the retriever
>>> retriever = config.instantiate()
>>> docs = retriever.get_relevant_documents("cloud computing benefits")
get_input_fields()[source]

Return input field definitions for Azure AI Search retriever.

Return type:

dict[str, tuple[type, Any]]

get_output_fields()[source]

Return output field definitions for Azure AI Search retriever.

Return type:

dict[str, tuple[type, Any]]

instantiate()[source]

Create an Azure AI Search retriever from this configuration.

Returns:

Instantiated retriever ready for document retrieval.

Return type:

AzureAISearchRetriever

Raises:
  • ImportError – If required packages are not available.

  • ValueError – If API key or configuration is invalid.