AzureAISearchEmbeddingRetriever
Retrieve documents from an Azure AI Search document store using vector similarity.
Basic Information
- Type:
haystack_integrations.components.retrievers.azure_ai_search.embedding_retriever.AzureAISearchEmbeddingRetriever - Components it can connect with:
TextEmbedder:AzureAISearchEmbeddingRetrieverreceives query embeddings from a text embedder.Ranker:AzureAISearchEmbeddingRetrieversends retrieved documents to aRankerfor reranking.
Inputs
| Parameter | Type | Default | Description |
|---|---|---|---|
| query_embedding | List[float] | A list of floats representing the query embedding. | |
| filters | Optional[Dict[str, Any]] | None | Filters applied to the retrieved documents. The way runtime filters are applied depends on the filter_policy chosen at retriever initialization. |
| top_k | Optional[int] | None | The maximum number of documents to retrieve. |
Outputs
| Parameter | Type | Default | Description |
|---|---|---|---|
| documents | List[Document] | A list of documents retrieved from the AzureAISearchDocumentStore. |
Overview
Use AzureAISearchEmbeddingRetriever to retrieve documents from an Azure AI Search document store using vector similarity. This retriever must be connected to an AzureAISearchDocumentStore to run.
Vector (embedding) retrieval is useful when you want to find semantically similar documents based on the meaning of the query rather than exact keyword matches.
Azure AI Search Setup
To use this retriever, you need an Azure AI Search service with a properly configured vector index. For more information, see the Azure AI Search documentation.
Usage Example
Initializing the Component
components:
AzureAISearchEmbeddingRetriever:
type: haystack_integrations.components.retrievers.azure_ai_search.embedding_retriever.AzureAISearchEmbeddingRetriever
init_parameters:
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_ENDPOINT
strict: false
index_name: my-index
top_k: 10
Parameters
Init Parameters
These are the parameters you can configure in Pipeline Builder:
| Parameter | Type | Default | Description |
|---|---|---|---|
| document_store | AzureAISearchDocumentStore | An instance of AzureAISearchDocumentStore to use with the retriever. | |
| filters | Optional[Dict[str, Any]] | None | Filters applied when fetching documents from the document store. |
| top_k | int | 10 | Maximum number of documents to return. |
| filter_policy | Union[str, FilterPolicy] | FilterPolicy.REPLACE | Policy to determine how filters are applied. Can be REPLACE (runtime filters replace initialization filters) or MERGE (runtime filters are merged with initialization filters). |
| query_type | Optional[str] | None | A string indicating the type of query to perform. Possible values are simple, full, and semantic. |
| semantic_configuration_name | Optional[str] | None | The name of semantic configuration to be used when processing semantic queries. |
Run Method Parameters
These are the parameters you can configure for the component's run() method. You can pass these parameters at query time through the API, in Playground, or when running a job.
| Parameter | Type | Default | Description |
|---|---|---|---|
| query_embedding | List[float] | A list of floats representing the query embedding. | |
| filters | Optional[Dict[str, Any]] | None | Filters applied to the retrieved documents. The way runtime filters are applied depends on the filter_policy chosen at retriever initialization. |
| top_k | Optional[int] | None | The maximum number of documents to retrieve. |
Was this page helpful?