VoyageTextEmbedder

Compute text embeddings using models by Voyage. VoyageTextEmbedder is used in query pipelines to compute the user query embedding.

Basic Information

ℹ️

Third Party Integration

Voyage AI is a third party integration developed by an external provider and is not maintained by deepset. While we encourage you to explore it, we recommend reviewing it carefully to ensure it meets your needs.


  • Pipeline type: Query
  • Type: haystack_integrations.components.embedders.voyage_embedders.VoyageTextEmbedder
  • Components it typically connects with:
    • Query: VoyageTextEmbedderreceives the query to be embedded from the Query input component.
    • Retrievers: VoyageTextEmbedder can send the embedded query to a Retriever.

Inputs

NameTypeDescription
documentsList of Document objectsThe documents to embed.

Outputs

NameTypeDescription
documentsList of Document objectsDocuments with the calculated embeddings stored in their embedding metadata field.
metaDictionaryInformation about the usage of the model.

Overview

VoyageTextEmbedder calculates vector representations for strings. It's used in query pipelines to embed user query. It's typically used after Query and before Retrievers. VoyageTextEmbedder is an external integration, which means it was added by a Haystack community member and is maintained by them. For most recent information about this component, check the GitHub repository.

If you use VoyageTextEmbedder in your query pipeline, you must use VoyageDocumentEmbedder to embed the documents in your indexing pipeline, with the same model.

ℹ️

Embedding Models in Query and Indexing Pipelines

The embedding model you use to embed documents in your indexing pipeline must be the same as the embedding model you use to embed the query in your query pipeline.

This means the embedders for your indexing and query pipelines must match. For example, if you use CohereDocumentEmbedder to embed your documents, you should use CohereTextEmbedder with the same model to embed your queries.

Authorization

For details, check Use Voyage AI Models.

Usage Example

In this example, VoyageTextEmbedder receives the query from Query and then sends the output documents to DocumentWriter.

VoyageDocumentEmbedder connected to DocumentSplitter and DocumentWriter

And here is the YAML configuration:

components:
...
  OpenSearchEmbeddingRetriever:
    type: haystack_integrations.components.retrievers.opensearch.embedding_retriever.OpenSearchEmbeddingRetriever
    init_parameters:
      document_store: null
      filters: null
      top_k: 10
      filter_policy: replace
      custom_query: null
      raise_on_failure: true
      efficient_filtering: false
  VoyageTextEmbedder:
    type: haystack_integrations.components.embedders.voyage_embedders.voyage_text_embedder.VoyageTextEmbedder
    init_parameters:
      model: voyage-2
      input_type: query
      truncate: null
      prefix: ''
      suffix: ''
      ..
connections:
  - sender: VoyageTextEmbedder.embedding
    receiver: OpenSearchEmbeddingRetriever.query_embedding
max_runs_per_component: 100
metadata: {}
inputs:
  query:
    - VoyageTextEmbedder.text

Init Parameters

For the initialization parameters, check the init() method of the component in GitHub.