Skip to content

Commit

Permalink
comments fixes from Laurent
Browse files Browse the repository at this point in the history
  • Loading branch information
qdequele committed Aug 29, 2024
1 parent 4a12477 commit 815c646
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion config/sidebar-guides.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
},
{
"source": "guides/embedders/mistral.mdx",
"label": "Semantic Search with Mistral Embedding",
"label": "Semantic search with Mistral embedding",
"slug": "mistral"
}
]
Expand Down
19 changes: 9 additions & 10 deletions guides/embedders/mistral.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Semantic Search with Mistral Embedding - Meilisearch documentation
description: This guide will walk you through the process of setting up Meilisearch with Mistral embeddings to enable semantic search capabilities.
---

# Semantic Search with Mistral Embedding
# Semantic search with Mistral embedding

## Introduction

Expand All @@ -17,17 +17,13 @@ To follow this guide, you'll need:
- A Mistral account with an API key for embedding generation. You can sign up for a Mistral account at [Mistral](https://mistral.ai/).
- No backend required.

## Explanation

Meilisearch has the ability to automatically generate embeddings for your documents by configuring an embedder within the engine. You can use a local embedder, which may be slower depending on your cloud account, or leverage a third-party API. The third-party API can be a self-hosted API based on Ollama or a service using the dedicated REST option.

By utilizing this configuration, Meilisearch will automatically generate embeddings for your documents based on the template you've set up (optional but recommended) and store the embeddings in the vector store. Meilisearch optimizes the calls to the third-party API by auto-batching the requests. Additionally, Meilisearch uses this configuration to automatically generate embeddings for each search query, which are then used to query the Approximate Nearest Neighbor (ANN) in the vector storage.

## Setting up Meilisearch

To set up an embedder in Meilisearch, you simply need to add it to your settings. You can refer to the [Meilisearch documentation](https://www.meilisearch.com/docs/reference/api/settings#update-embedder-settings) for more details on updating the embedder settings.
To set up an embedder in Meilisearch, you need to configure it to your settings. You can refer to the [Meilisearch documentation](https://www.meilisearch.com/docs/reference/api/settings#update-embedder-settings) for more details on updating the embedder settings.

Here's an example configuration for using Mistral embedding:
While using Mistral to generate embeddings, you'll need to use the model `mistral-embed`. Unlike some other services, Mistral currently offers only one embedding model.

Here's an example of embedder settings for Mistral:

```json
{
Expand Down Expand Up @@ -69,7 +65,7 @@ Please note that most third-party tools have rate limiting, which is managed by

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: https://www.meilisearch.com/docs/reference/api/tasks#get-tasks

## Testing Semantic Search
## Testing semantic search

With the embedder set up, you can now perform semantic searches using Meilisearch. When you send a search query, Meilisearch will generate an embedding for the query using the configured embedder and then use it to find the most semantically similar documents in the vector store.
To perform a semantic search, you simply need to make a normal search request but include the hybrid parameter:
Expand All @@ -96,3 +92,6 @@ You can use the Meilisearch API or client libraries to perform searches and retr
## Conclusion

By following this guide, you should now have Meilisearch set up with Mistral embedding, enabling you to leverage semantic search capabilities in your application. Meilisearch's auto-batching and efficient handling of embeddings make it a powerful choice for integrating semantic search into your project.

To explore further configuration options for embedders, consult the [detailed documentation about the embedder setting possibilities](https://www.meilisearch.com/docs/reference/api/settings#embedders-experimental).

0 comments on commit 815c646

Please sign in to comment.