Voyage AI provides a Python library (`voyageai`) that offers API endpoints for its state-of-the-art embedding and reranking models. These models convert unstructured data (text, images, video) into dense numerical vectors (embeddings), enabling advanced information retrieval tasks like semantic search and Retrieval-Augmented Generation (RAG). The library is actively maintained, with version 0.3.7 released recently, and it integrates seamlessly with various AI stacks.
pip install -U voyageaiVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the Voyage AI client and generate text embeddings and rerank documents using recommended models. It emphasizes setting the API key via an environment variable (`VOYAGE_API_KEY`) and configuring `max_retries` for robustness.
Upgrade your Python environment to version 3.9 or newer.
Migrate to Voyage 4 series models (e.g., `voyage-4-large`, `voyage-4`) for new projects and consider updating existing ones. Refer to the official documentation for model migration guides.
When initializing the client, set `max_retries` to a positive integer (e.g., `Client(api_key=..., max_retries=3)`) to enable automatic retries with exponential backoff.
Monitor your usage, implement client-side rate limiting, configure `max_retries` in the client, or upgrade your usage tier by adding a payment method or requesting an increase.
Always include `input_type="query"` or `input_type="document"` in your `embed` calls, depending on the nature of the text being embedded.
No dependency data recorded yet.