Recommendations based on vector search.

Vector Search based recommendations are done by extracting the vectors of the documents ids specified performing some vector operations and then searching the dataset with the resultant vector.

This allows us to not only do recommendations but personalized and weighted recommendations here are a couple of different scenarios and what the queries would look like for those:

  1. Recommendations Personalized by single liked product:

    positive_document_ids=['A']

    -> Document ID A Vector = Search Query

  2. Recommendations Personalized by multiple liked product:

    positive_document_ids=['A', 'B']

    -> Document ID A Vector + Document ID B Vector = Search Query

  3. Recommendations Personalized by multiple liked product and disliked products:

    positive_document_ids=['A', 'B'], negative_document_ids=['C', 'D']

    -> (Document ID A Vector + Document ID B Vector) - (Document ID C Vector + Document ID C Vector) = Search Query

  4. Recommendations Personalized by multiple liked product and disliked products with weights:

    positive_document_ids={'A':0.5, 'B':1}, negative_document_ids={'C':0.6, 'D':0.4}

    -> (Document ID A Vector 0.5 + Document ID B Vector 1) - (Document ID C Vector 0.6 + Document ID D Vector 0.4) = Search Query

You can change the operator between vectors with vector_operation:

e.g. positive_document_ids=['A', 'B'], negative_document_ids=['C', 'D'], vector_operation='multiply'

-> (Document ID A Vector Document ID B Vector) - (Document ID C Vector Document ID D Vector) = Search Query

Language
Click Try It! to start a request and see the response here!