QdrantEmbeddingRetriever
A component for retrieving documents from an QdrantDocumentStore using dense vectors.
Basic Information
- Type:
haystack_integrations.components.retrievers.qdrant.retriever.QdrantEmbeddingRetriever
Inputs
| Parameter | Type | Default | Description |
|---|---|---|---|
| query_embedding | List[float] | Embedding of the query. | |
| filters | Optional[Union[Dict[str, Any], models.Filter]] | None | A dictionary with filters to narrow down the search space. |
| top_k | Optional[int] | None | The maximum number of documents to return. If using group_by parameters, maximum number of groups to return. |
| scale_score | Optional[bool] | None | Whether to scale the scores of the retrieved documents or not. |
| return_embedding | Optional[bool] | None | Whether to return the embedding of the retrieved Documents. |
| score_threshold | Optional[float] | None | A minimal score threshold for the result. |
| group_by | Optional[str] | None | Payload field to group by, must be a string or number field. If the field contains more than 1 value, all values will be used for grouping. One point can be in multiple groups. |
| group_size | Optional[int] | None | Maximum amount of points to return per group. Default is 3. |
Outputs
| Parameter | Type | Default | Description |
|---|---|---|---|
| documents | List[Document] | The retrieved documents. |
Overview
Work in Progress
Bear with us while we're working on adding pipeline examples and most common components connections.
A component for retrieving documents from an QdrantDocumentStore using dense vectors.
Usage example:
from haystack.dataclasses import Document
from haystack_integrations.components.retrievers.qdrant import QdrantEmbeddingRetriever
from haystack_integrations.document_stores.qdrant import QdrantDocumentStore
document_store = QdrantDocumentStore(
":memory:",
recreate_index=True,
return_embedding=True,
)
document_store.write_documents([Document(content="test", embedding=[0.5]*768)])
retriever = QdrantEmbeddingRetriever(document_store=document_store)
# using a fake vector to keep the example simple
retriever.run(query_embedding=[0.1]*768)
Usage Example
components:
QdrantEmbeddingRetriever:
type: qdrant.src.haystack_integrations.components.retrievers.qdrant.retriever.QdrantEmbeddingRetriever
init_parameters:
Parameters
Init Parameters
These are the parameters you can configure in Pipeline Builder:
| Parameter | Type | Default | Description |
|---|---|---|---|
| document_store | QdrantDocumentStore | An instance of QdrantDocumentStore. | |
| filters | Optional[Union[Dict[str, Any], models.Filter]] | None | A dictionary with filters to narrow down the search space. |
| top_k | int | 10 | The maximum number of documents to retrieve. If using group_by parameters, maximum number of groups to return. |
| scale_score | bool | False | Whether to scale the scores of the retrieved documents or not. |
| return_embedding | bool | False | Whether to return the embedding of the retrieved Documents. |
| filter_policy | Union[str, FilterPolicy] | FilterPolicy.REPLACE | Policy to determine how filters are applied. |
| score_threshold | Optional[float] | None | A minimal score threshold for the result. Score of the returned result might be higher or smaller than the threshold depending on the similarity function specified in the Document Store. E.g. for cosine similarity only higher scores will be returned. |
| group_by | Optional[str] | None | Payload field to group by, must be a string or number field. If the field contains more than 1 value, all values will be used for grouping. One point can be in multiple groups. |
| group_size | Optional[int] | None | Maximum amount of points to return per group. Default is 3. |
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.
| Parameter | Type | Default | Description |
|---|---|---|---|
| query_embedding | List[float] | Embedding of the query. | |
| filters | Optional[Union[Dict[str, Any], models.Filter]] | None | A dictionary with filters to narrow down the search space. |
| top_k | Optional[int] | None | The maximum number of documents to return. If using group_by parameters, maximum number of groups to return. |
| scale_score | Optional[bool] | None | Whether to scale the scores of the retrieved documents or not. |
| return_embedding | Optional[bool] | None | Whether to return the embedding of the retrieved Documents. |
| score_threshold | Optional[float] | None | A minimal score threshold for the result. |
| group_by | Optional[str] | None | Payload field to group by, must be a string or number field. If the field contains more than 1 value, all values will be used for grouping. One point can be in multiple groups. |
| group_size | Optional[int] | None | Maximum amount of points to return per group. Default is 3. |
Was this page helpful?