Skip to main content
For the complete documentation index for agents and LLMs, see llms.txt.

AzureAISearchEmbeddingRetriever

Retrieve documents from an AzureAISearchDocumentStore using vector similarity search.

Key Features​

  • Dense vector-based retrieval from Azure AI Search using vector similarity.
  • Configurable number of results with top_k.
  • Supports metadata filtering to narrow down the search space.
  • Supports advanced Azure AI Search query types including semantic search.
  • Configurable filter policy (replace or merge) for runtime filters.

Configuration​

  1. Drag the AzureAISearchEmbeddingRetriever component onto the canvas from the Component Library.
  2. Click on the component to open the configuration panel.
  3. On the General tab:
    • Configure the AzureAISearchDocumentStore with your Azure AI Search instance details.
    • Set top_k to control the maximum number of documents to retrieve.
  4. Go to the Advanced tab to configure filter_policy and additional Azure AI Search options.

Connections​

AzureAISearchEmbeddingRetriever receives query embeddings from a text embedder. It sends retrieved documents to downstream components such as PromptBuilder or a ranker.

Source Code​

To check this component's source code, open embedding_retriever.py in the Haystack Core Integrations repository.

Usage Examples​

Basic Configuration​

AzureAISearchEmbeddingRetriever:
type: haystack_integrations.components.retrievers.azure_ai_search.embedding_retriever.AzureAISearchEmbeddingRetriever
init_parameters:
top_k: 10
document_store:
type: haystack_integrations.document_stores.azure_ai_search.document_store.AzureAISearchDocumentStore
init_parameters:
api_key:
type: env_var
env_vars:
- AZURE_SEARCH_API_KEY
strict: false
azure_endpoint:
type: env_var
env_vars:
- AZURE_SEARCH_SERVICE_ENDPOINT
strict: false
index_name: my-index

Parameters​

Inputs​

ParameterTypeDescription
query_embeddingList[float]The embedding of the query.
filtersOptional[Dict[str, Any]]Filters to apply to the search results.
top_kOptional[int]The maximum number of documents to return.

Outputs​

ParameterTypeDescription
documentsList[Document]The retrieved documents.

Init Parameters​

These are the parameters you can configure in Pipeline Builder:

ParameterTypeDefaultDescription
document_storeAzureAISearchDocumentStoreAn instance of AzureAISearchDocumentStore.
filtersOptional[Dict[str, Any]]NoneDefault filters applied when running the retriever.
top_kint10The maximum number of documents to retrieve.
filter_policyUnion[str, FilterPolicy]FilterPolicy.REPLACEPolicy for how runtime filters are applied relative to init-time filters.

Run Method Parameters​

These are the parameters you can configure for the component's run() method. This means you can pass these parameters at query time through the API, in Playground, or when running a job. For details, see Modify Pipeline Parameters at Query Time.

ParameterTypeDefaultDescription
query_embeddingList[float]The embedding of the query.
filtersOptional[Dict[str, Any]]NoneFilters to apply at query time.
top_kOptional[int]NoneOverride the init-time top_k setting.