ractogateway.rag.embedders.voyage_embedder

Voyage AI embedding provider (Anthropic-aligned, best for Claude RAG).

Install with: pip install ractogateway[rag-voyage]

class ractogateway.rag.embedders.voyage_embedder.VoyageEmbedder(model='voyage-3', *, api_key=None, input_type='document', batch_size=128)[source]

Bases: BaseEmbedder

Embed texts using the Voyage AI API.

Voyage AI embeddings are optimised for Anthropic Claude RAG pipelines and are the recommended choice when using Claude as the generation LLM.

Parameters:
  • model (str) – Voyage model name (default "voyage-3").

  • api_key (str | None) – Voyage API key. Falls back to VOYAGE_API_KEY env var.

  • input_type (str | None) – "query" for queries, "document" for documents to index. Using the correct type improves retrieval quality.

  • batch_size (int) – Maximum texts per API call.

property dimension: int

Dimensionality of the embedding vectors.

Returns -1 if not known until after the first call.

embed(texts)[source]

Embed texts synchronously.

Parameters:

texts (list[str]) – Non-empty list of strings to embed.

Return type:

list[list[float]]

Returns:

list[list[float]] – One embedding vector per input text, in the same order.

async aembed(texts)[source]

Async variant of embed().

Return type:

list[list[float]]