Notebooks
W
Weaviate
Hybrid Search Mistral Embed

Hybrid Search Mistral Embed

vector-searchvector-databaseretrieval-augmented-generationllm-frameworksweaviate-featuresfunction-callingweaviate-recipesmodel-providersPythonmistralgenerative-ai

Open In Colab

Hybrid Search with Mistral

This recipe will show you how to run hybrid search with embeddings from Mistral.

Requirements

  1. Weaviate cluster

    1. You can create a 14-day free sandbox on WCD
    2. Embedded Weaviate
    3. Local deployment
    4. Other options
  2. Mistral API key. Grab one here.

[2]

Connect to Weaviate

Only choose one option from the below.

Weaviate Cloud Deployment

[ ]

Embedded Weaviate

[ ]

Local Deployment

[ ]

Create a collection

Collection stores your data and vector embeddings.

[ ]

Import Data

[ ]

Hybrid Search

The alpha parameter determines the weight given to the sparse and dense search methods. alpha = 0 is pure sparse (bm25) search, whereas alpha = 1 is pure dense (vector) search.

Alpha is an optional parameter. The default is set to 0.75.

Hybrid Search only

The below query is finding Jeopardy questions about animals and is limiting the output to only two results. Notice alpha is set to 0.80, which means it is weighing the vector search results more than bm25. If you were to set alpha = 0.25, you would get different results.

[ ]

Hybrid Search with a where filter

Find Jeopardy questions about elephants, where the category is set to Animals.

[ ]