This guide will walk you through the process of setting up Meilisearch with Cloudflare Worker AI embeddings to enable semantic search capabilities.
baai/bge-base-en-v1.5
: 768 dimensionsbaai/bge-large-en-v1.5
: 1024 dimensionsbaai/bge-small-en-v1.5
: 384 dimensionssource
: Specifies the source of the embedder, which is set to “rest” for using a REST API.apiKey
: Replace <API Key>
with your actual Cloudflare API key.dimensions
: Specifies the dimensions of the embeddings. Set to 384 for baai/bge-small-en-v1.5
, 768 for baai/bge-base-en-v1.5
, or 1024 for baai/bge-large-en-v1.5
.documentTemplate
: Optionally, you can provide a custom template for generating embeddings from your documents.url
: Specifies the URL of the Cloudflare Worker AI API endpoint.request
: Defines the request structure for the Cloudflare Worker AI API, including the input parameters.response
: Defines the expected response structure from the Cloudflare Worker AI API, including the embedding data.url
field in your configuration. The URL contains your Cloudflare account ID (<ACCOUNT_ID>
) and the specific model you want to use (<Model>
). Make sure to replace these placeholders with your actual account ID and the desired model name (e.g., baai/bge-small-en-v1.5
).
Once you’ve configured the embedder settings, Meilisearch will automatically generate embeddings for your documents and store them in the vector store.
Please note that Cloudflare may have rate limiting, which is managed by Meilisearch. If you have a free account, the indexation process may take some time, but Meilisearch will handle it with a retry strategy.
It’s recommended to monitor the tasks queue to ensure everything is running smoothly. You can access the tasks queue using the Cloud UI or the Meilisearch API.
q
: Represents the user’s search query.hybrid
: Specifies the configuration for the hybrid search.
semanticRatio
: Allows you to control the balance between semantic search and traditional search. A value of 1 indicates pure semantic search, while a value of 0 represents full-text search. You can adjust this parameter to achieve a hybrid search experience.embedder
: The name of the embedder used for generating embeddings. Make sure to use the same name as specified in the embedder configuration, which in this case is “cloudflare”.