Skip to main content

Voyage AI + Moorcheh

This integration uses the Voyage AI Python client to generate embeddings and Moorcheh vector namespaces to store and search them with ITS ranking. The example below uses voyage-4 (default 1024 dimensions; other sizes and models are described in the Voyage embeddings docs).

Architecture

Embedding generation

voyageai.Client.embed() with input_type="document" or "query" for retrieval

Vector storage

Store vectors in Moorcheh vector namespaces

Semantic retrieval

Same model and dimension settings for indexed chunks and queries

Authentication

VOYAGE_API_KEY - see API key setup

Prerequisites

The PyPI package is voyageai. If you see ModuleNotFoundError: No module named 'voyageai', run the install line above with the same Python you use to run your script.

.env file

Model and dimensions

This example uses voyage-4 with the default 1024-dimensional float embeddings. Set Moorcheh vector_dimension to match. You can switch to another supported model (for example voyage-4-lite, voyage-3.5) and optional output_dimension - keep index and query settings aligned. For retrieval, pass input_type="document" when embedding stored chunks and input_type="query" when embedding the search query.

End-to-end example

Runnable demo script

See integrations/voyage/voyage_moorcheh_demo.py.

Important notes

Default for voyage-4 at default settings is 1024. If you change output_dimension or model, recreate or align the namespace dimension.
For retrieval, use input_type="document" for indexed text and input_type="query" for the query string.
Include text on each uploaded vector so search results can return the original chunk.