Search More-Like-These™

This powerful endpoint enables developers to create a rich discovery experience by blending text, items, and embeddings. It allows for a nuanced search within the embedding space, where various elements can be mixed and matched in different proportions.

Consider using More-Like-These™ search for:

  • Personalizing search results based on session or long-term user data.
  • Incorporating external sources to enhance search with specific styles or properties.
  • Combining multi-modal inputs, such as blending image embeddings or text descriptions with current searches.
  • Creating nuanced searches by using an item as a base and adding a textual twist to find similar yet distinct items.
  • Excluding certain elements from searches by using one item as a base and another as a reference for what to avoid.

👍

Standard Search Options apply

Filtering, pagination, accuracy etc all apply to this endpoint

these

The these object is an array combining various items into a single search space, each with a specific weight. The weights do not need to sum to 1. The last action (at the very top level these object) is to be normalized to a unit vector, and fit within a -1 to 1 range.

🚧

weight and ONLY one other field

The items in the these array must have a weight, and then one and ONLY one of the other fields. You will receive an error if you populate more than one of these que ry_text query_document_id embedding these

weight (required)

A value that sets the blending factor for each element. Positive values strengthen the influence, while negative values reduce it, useful for "NOT like this" scenarios.

query_text

Textual input for the LLM provider, such as:

  • slender modern desk for my dorm room
  • outdoor end tables for a Napa patio
  • soft throw pillows

📘

Vantage Managed Embeddings (VME) only!

query_text is only available for Vantage Managed Embeddings, where you have an LLM provider configured for your collection.

query_document_id

References an existing item's ID, for example:

  • item-27
  • SKU-102022
  • 283830228

embedding

A JSON array representing an embedding in the collection's space, useful for externally generated embeddings:

  • [0.2338382, -0.283832 .....]
  • [0.8383289, 0.83837272 .....]

these

Allows nesting of these objects to group items with equal weighting, enabling hierarchical structuring of elements.

  • [{"query_text": "half", weight:0.5}, {"query_text": "other half", weight:0.5}]

Example: soft chair + item 27 + two Pinterest images

Let's use a practical example: a query that combines 30% imagery, 20% an existing catalog item, and 50% textual input.

More-Like-These™

Search Text (50%)

The user is searching for a soft chair.

Soft Chair

Images (30%)

Two Pinterest board images, embedded into the model, serve as embedding vectors representing their classification within the space.

Pink 1
Pink 2

Item 27 (20%)

An item from the catalog that the user has shown interest in.

Item 27

{
  "these" : [
    {
      "embedding": [ 0.2, 0.1, -0.1 ... ],  // Image 1
      "weight": 0.15 
    },
    {
      "embedding": [ 0.1, 0.11, -0.9 ... ], // Image 2
      "weight": 0.15 
    },
    {
      "query_document_id": "item-27",       // Item 27 in collection
      "weight": 0.2 
    },
    {
      "query_text": "soft chair",           // Search Bar Text 
      "weight": 0.5 
    }
  ]
}
// In this example the most influential weight is 0.75 but its being influence by the 0.25 and everything washes out
// (1 * (0.5 + 0.5)) + (-1 * (0.75 + 0.25)) = 0
"these" : [
   {weight: 1, "these": [
       {weight: 0.5,  query_text: "text1"},
       {weight: 0.5, query_document_id: "doc1"},
   ]},
   {weight: -1, "these": [
       {weight: 0.75, query_text: "text2"},
       {weight: 0.25, query_document_id: "doc2"},
   ]},
]

//This would produce the same result
//(1 * (50 + 50)) + (-1 * (75 + 25)) = 0
"these" : [
   {weight: 1, "these": [
       {weight: 50, query_text: "text1"},
       {weight: 50, query_document_id: "doc1"},
   ]},
   {weight: -1, "these": [
       {weight: 75, query_text: "text2"},
       {weight: 25, query_document_id: "doc2"},
   ]},
]
//This would  bias heavily towards the negative "these"
//(1 * (50 + 50)) + (-10 * (75 + 25)) = -900
"these" : [
   {weight: 1, "these": [
       {weight: 50,  query_text: "text1"},
       {weight: 50, query_document_id: "doc1"},
   ]},
   {weight: -10, "these": [
       {weight: 75, query_text: "text2"},
       {weight: 25, query_document_id: "doc2"},
   ]},
]
//Lastly this example is dominated by the 50 for 'text1'
//(1 * (50 + 0.5)) + (-1 * (0.75 + 0.25)) = 49.5
"these" : [
   {weight: 1, "these": [
       {weight: 50,  query_text: "text1"},
       {weight: 0.5, query_document_id: "doc1"},
   ]},
   {weight: -1, "these": [
       {weight: 0.75, query_text: "text2"},
       {weight: 0.25, query_document_id: "doc2"},
   ]},
]

📘

More-Like-These™ Reference Guide