Skip to main content

Cohere + Moorcheh

This integration uses Cohere to generate embeddings and Moorcheh vector namespaces to store and search them with ITS ranking. Use this approach when you want full control over the embedding model (for example, embed-v4.0) and upload pre-computed vectors directly to Moorcheh.

Architecture

Embedding Generation

Generate vectors with Cohere embed-v4.0

Vector Storage

Store vectors in Moorcheh vector namespaces

Semantic Retrieval

Search by vector query for high-relevance results

Model Flexibility

Keep your preferred embedding provider while using Moorcheh search

Prerequisites

Install dependencies:

End-to-end Example

Important Notes

The namespace vector_dimension must exactly match the dimension returned by your Cohere embedding configuration.
Use search_document when embedding stored documents and search_query for user queries.
Include text in each uploaded vector object. Moorcheh stores it as metadata, so search results can return the original content without refetching from another data source.
Use coherent chunks (typically 500-1000 characters) with overlap, keep query phrasing intent-rich, and tune kiosk_mode + threshold to filter weaker matches.
Use the same embedding model/version and parameters for both index-time and query-time embeddings.

Troubleshooting

  • No vector namespace found: Create the namespace first with type="vector".
  • Dimension mismatch: Recreate the namespace with the correct vector_dimension for your embedding output.
  • Low relevance: Re-check chunking strategy and ensure document/query input types are correct.