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 usesvoyage-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 retrievalVector 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 setupPrerequisites
MOORCHEH_API_KEYfrom the Moorcheh ConsoleVOYAGE_API_KEYfrom Voyage AI- Python 3.9+
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 usesvoyage-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
Seeintegrations/voyage/voyage_moorcheh_demo.py.
Important notes
Vector dimension must match
Vector dimension must match
Default for
voyage-4 at default settings is 1024. If you change output_dimension or model, recreate or align the namespace dimension.Document vs query
Document vs query
For retrieval, use
input_type="document" for indexed text and input_type="query" for the query string.Store text on each vector
Store text on each vector
Include
text on each uploaded vector so search results can return the original chunk.