Notebooks
W
Weaviate
Hybrid Search Ada 002

Hybrid Search Ada 002

vector-searchvector-databaseretrieval-augmented-generationopenaillm-frameworksweaviate-featuresfunction-callingweaviate-recipesmodel-providersPythongenerative-ai

Open In Colab

Dependencies

[ ]

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 three results. Notice alpha set to 0 results in zero objects returned, whereas alpha = 1 returns the three objects.

[ ]
[ ]

Hybrid Search on a specific property

The properties parameter allows you to list the properties that you want bm25 to search on.

[ ]

Hybrid Search with a where filter

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

[ ]

Hybrid Search with a custom vector

You can pass in your own vector as input into the hybrid query, by using the vector parameter.

[ ]