> ## Documentation Index
> Fetch the complete documentation index at: https://help.maestra.io/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Create a Similar Products Algorithm

Similar Products algorithms help you recommend items that closely match a given product or a customer's recent activity. Maestra offers three variants of the Similar Products algorithm, each tuned for a different use case — from product detail pages to wishlist reminders and abandoned-browse follow-ups.

## Available algorithms

Maestra supports three Similar Products algorithms. Pick the one that fits where and how you want to surface recommendations.

<CardGroup cols={3}>
  <Card title="Similar Products" icon="box">
    Recommends items similar to a single product. Best for product detail pages.
  </Card>

  <Card title="Similar Products to Product List" icon="list">
    Recommends items similar to a list of products a customer has saved or interacted with. Best for wishlists and "back in stock" flows.
  </Card>

  <Card title="Similar Products to Recently Viewed" icon="eye">
    Recommends items similar to products a customer viewed in their last session. Best for abandoned-browse campaigns.
  </Card>
</CardGroup>

### Similar Products

Recommends items similar to a specific product.

| Property                | Value                              |
| ----------------------- | ---------------------------------- |
| Algorithm type          | Recommendations to product         |
| Audience                | Identified and anonymous customers |
| Invocation              | API (recommendation widget), email |
| Recalculation frequency | Once daily                         |
| Limit                   | Up to 5 algorithms per project     |
| Best for                | Product detail pages               |

**Automatic checks**

* Product availability in the customer's zone.
* External product system compatibility (optional).

### Similar Products to Product List

Recommends items similar to a list of products associated with a customer (for example, a wishlist or a "notify me when back in stock" list).

| Property                | Value                                                |
| ----------------------- | ---------------------------------------------------- |
| Algorithm type          | Personal recommendations                             |
| Audience                | Identified customers only                            |
| Invocation              | API (recommendation widget), email                   |
| Recalculation frequency | Real time, accounting for products the customer adds |
| Limit                   | Up to 3 algorithms per project                       |
| Best for                | "Back in stock" mechanics, wishlist features         |

**Automatic checks**

* Product availability.
* Brand matching (for multi-brand projects).
* Exclusion of items the customer has already purchased.

### Similar Products to Recently Viewed

Recommends items similar to products the customer viewed in their last session.

| Property                | Value                            |
| ----------------------- | -------------------------------- |
| Algorithm type          | Personal recommendations         |
| Audience                | Identified customers             |
| Invocation              | API, email                       |
| Recalculation frequency | Real time                        |
| Limit                   | Up to 2 algorithms per project   |
| Best for                | Abandoned product view mechanics |

<Note>
  For multi-brand projects, the algorithm generates recommendations within each brand separately.
</Note>

## How to create the algorithm

Follow these steps to set up any of the three Similar Products algorithms.

<Steps>
  <Step title="Open Product Recommendations">
    Go to **Content → Product Recommendations** and click **Add Mechanic**.
  </Step>

  <Step title="Choose the algorithm variant">
    Select one of the three Similar Products algorithms based on the use case described above.
  </Step>

  <Step title="Name the algorithm">
    Give the algorithm a clear name so you can identify it later, then continue.
  </Step>

  <Step title="Configure general settings">
    Set up the optional parameters that scope which products the algorithm applies to and which products it can recommend.

    * **Recommend for products** — the target segment of products the algorithm applies to.
    * **Recommend from** — the source segment the algorithm draws recommendations from.
    * **Filter by price** — restricts recommendations to a price range.
    * **Brand** and **Product list** — used for the Similar Products to Product List algorithm.
    * **Recommend only from the same external system** — enabled by default.
  </Step>

  <Step title="Configure similarity settings">
    Choose the product fields that define what "similar" means. The system first filters candidates by **Exact Match** parameters and then sorts the remaining products by similarity.

    See the [Similarity logic](#similarity-logic) section below for the full ranking rules.

    <Warning>
      The more fields you select, the fewer recommendations you'll get. With too many constraints, the algorithm may return no recommendations at all.
    </Warning>

    * **Category selection** — choose the primary category that is closest to the product.
    * **Manufacturer exclusion** — available in its own section if you want to exclude specific manufacturers from recommendations.
  </Step>

  <Step title="Launch the algorithm">
    Activate the algorithm. Maestra displays its status and the timestamp of the last update once it's running.
  </Step>
</Steps>

## Similarity logic

The similarity settings control both filtering and ranking. Maestra first removes candidates that fail the Exact Match rules, then sorts what remains using the similarity rules.

### Exact Match filtering

Candidates must satisfy all of the following for the fields you selected:

* **Price / old price** — only items within ±30% of the current product's price are kept.
* **Manufacturer and other single-value fields** — values must match exactly.
* **Multi-value fields and categories** — the candidate's value set must overlap with or be contained in the source product's value set.

### Similarity sorting

After filtering, remaining candidates are ranked using these rules:

* **Price** — products within ±33% of the source price rank higher.
* **Single-value fields** — products with matching values rank higher; empty values are preferred over non-matching filled values.
* **Multi-value fields** — products are ranked by how many values they share with the source product.

## Recommended use cases

<CardGroup cols={3}>
  <Card title="Product detail pages" icon="box">
    Use **Similar Products** to surface alternatives directly on a product page.
  </Card>

  <Card title="Back in stock and wishlists" icon="bell">
    Use **Similar Products to Product List** to suggest alternatives based on what the customer has saved.
  </Card>

  <Card title="Abandoned browse" icon="clock-rotate-left">
    Use **Similar Products to Recently Viewed** to win back customers who left without converting.
  </Card>
</CardGroup>
