Skip to main content

Jina + Moorcheh

This integration uses the Jina Embeddings API with jina-embeddings-v5-text-small and Moorcheh vector namespaces to store and search vectors with ITS ranking. The model produces 1024-dimensional vectors by default (Matryoshka truncation is available via the API if you need a smaller size and match vector_dimension accordingly).

Architecture

Embedding generation

Call POST https://api.jina.ai/v1/embeddings with task retrieval.passage (index) or retrieval.query (search)

Vector storage

Store vectors in Moorcheh vector namespaces

Semantic retrieval

Query with the same model and retrieval.query for asymmetric retrieval

Authentication

Authorization: Bearer your Jina API key

Prerequisites

.env file

Tasks

For asymmetric retrieval, use: Other tasks (for example text-matching, classification) are supported by the API for different workloads; keep task and model consistent between index and query for retrieval.

Vector dimensions

Default output for jina-embeddings-v5-text-small is 1024 dimensions. You can pass a dimensions field in the API request to truncate (Matryoshka); the Moorcheh namespace vector_dimension must match what you send at index and query time.

End-to-end example

The following example loads keys from .env via load_dotenv(), embeds passages and a query through the Jina API, uploads vectors to Moorcheh, and runs similarity search.

Runnable demo script

See integrations/jina/jina_moorcheh_demo.py.

Important notes

Default length is 1024 for jina-embeddings-v5-text-small. If you set dimensions in the Jina request, create the Moorcheh namespace with that same vector_dimension.
Use retrieval.passage for stored chunks and retrieval.query for search queries so the retrieval adapter matches training.
Include text on each uploaded vector so search results can return the original chunk.
Use the same model name and task pairing at index and query time.

Troubleshooting

  • 401 / auth errors: Check JINA_API_KEY and Authorization: Bearer format.
  • Dimension mismatch: Align Moorcheh vector_dimension with embedding length (default 1024).
  • Low relevance: Adjust chunking, threshold, and top_k.