# How to create your algorithms

This feature is only aviable in dev mode

Follow this step-by-step guide to quickly create and configure algorithms for personalised recommendations or merchandising.

## Access the Algorithm Tab <a href="#h_01jdmfnps3fg1e083558hrnevq" id="h_01jdmfnps3fg1e083558hrnevq"></a>

Go to the **Algorithm tab** in the left-hand menu.

To create a new algorithm, click on the **+ Add New Algorithm** button. This will open the configuration page.

![](/files/yGM3kkH775tGHPSSwXcq)

## Rename Your Algorithm <a href="#h_01jdmfntmz51g4v4jwnhjqpmep" id="h_01jdmfntmz51g4v4jwnhjqpmep"></a>

As a first step, **rename your algorithm** by editing the generic title at the top of the page. This will make it easier to identify later when setting up recommendations or merchandising.

## Define Parameters <a href="#h_01jdmfnytatx3tcnfqd3qc3gf3" id="h_01jdmfnytatx3tcnfqd3qc3gf3"></a>

1. Algorithms can have **individual parameters** configured.
2. If an algorithm is added as a sub-algorithm, its parameters are automatically included in the global parameters and cannot be removed.
3. To add a parameter, click on the **Add Parameter** button.

   <figure><img src="https://image-forwarder.notaku.so/aHR0cHM6Ly93d3cubm90aW9uLnNvL2ltYWdlL2h0dHBzJTNBJTJGJTJGcHJvZC1maWxlcy1zZWN1cmUuczMudXMtd2VzdC0yLmFtYXpvbmF3cy5jb20lMkZjZjFjZDNjZC02OWMzLTQ0ZTQtODg0YS0zMzM5NTllZTA3YmIlMkZlYTE3OTJhZC1lMDUxLTRmNzUtOWU3YS0xNjdkNjY4ZWIwMzclMkZVbnRpdGxlZC5wbmc_dGFibGU9YmxvY2smc3BhY2VJZD1jZjFjZDNjZC02OWMzLTQ0ZTQtODg0YS0zMzM5NTllZTA3YmImaWQ9ZjgyZGEyMmEtNmE0MC00YTkwLThkOWUtZThjZmExZjQ2NjZjJmNhY2hlPXYyJndpZHRoPTEzNjA=" alt=""><figcaption></figcaption></figure>

## Set Up Algorithms <a href="#h_01jdmfq7b9nkrn2h8cnb67hh43" id="h_01jdmfq7b9nkrn2h8cnb67hh43"></a>

Algorithms determine how products are retrieved and displayed. They are executed in sequence, with the results combined to form the final list.

1. If the first algorithm returns fewer products than required, subsequent algorithms fill the remaining slots (e.g., Algorithm 1 provides 5 products, Algorithm 2 provides the 6th product, and so on).
2. Use clear and descriptive names for each algorithm to make them easier to manage.

To add an algorithm: click on the **+ Add an Algorithm** button.

Configurable settings for each algorithm:

* **Maximum number of products:** Limit the number of products retrieved.
* **Shuffle products:** Randomise the product order to prevent repetitive displays.

![Image without caption](https://image-forwarder.notaku.so/aHR0cHM6Ly93d3cubm90aW9uLnNvL2ltYWdlL2h0dHBzJTNBJTJGJTJGcHJvZC1maWxlcy1zZWN1cmUuczMudXMtd2VzdC0yLmFtYXpvbmF3cy5jb20lMkZjZjFjZDNjZC02OWMzLTQ0ZTQtODg0YS0zMzM5NTllZTA3YmIlMkZiZTIyNjQwZC0wOWNhLTRhMmUtOWIwNS02NzM2NjhjYWNiNzIlMkZVbnRpdGxlZC5wbmc_dGFibGU9YmxvY2smc3BhY2VJZD1jZjFjZDNjZC02OWMzLTQ0ZTQtODg0YS0zMzM5NTllZTA3YmImaWQ9ODdjZjgyZjEtYWUyMy00NjMxLTgzZTYtZTBiNDk1ZGVkYTQwJmNhY2hlPXYyJndpZHRoPTEzNjA=)

## Apply Filters <a href="#h_01jdmfrawq6zt8j6c5bg2pfs5c" id="h_01jdmfrawq6zt8j6c5bg2pfs5c"></a>

Filters refine the results returned by the algorithms. You can apply them globally or to individual algorithms.

**To add a filter:**

1. Click on the **+ Add a Filter** button.
2. Choose the logical condition between filters (AND or OR).
3. Add additional conditions using the + OR button.

![Image without caption](https://image-forwarder.notaku.so/aHR0cHM6Ly93d3cubm90aW9uLnNvL2ltYWdlL2h0dHBzJTNBJTJGJTJGcHJvZC1maWxlcy1zZWN1cmUuczMudXMtd2VzdC0yLmFtYXpvbmF3cy5jb20lMkZjZjFjZDNjZC02OWMzLTQ0ZTQtODg0YS0zMzM5NTllZTA3YmIlMkY1NDY3MmRmOC03ZTUyLTRjMzgtYWRkYS04NzIzN2EwMWE2OGYlMkZVbnRpdGxlZC5wbmc_dGFibGU9YmxvY2smc3BhY2VJZD1jZjFjZDNjZC02OWMzLTQ0ZTQtODg0YS0zMzM5NTllZTA3YmImaWQ9Y2U2MzY2ODEtMTExOS00M2RkLTkzMTUtM2ZlYjAxNTMyYjY1JmNhY2hlPXYyJndpZHRoPTEzNjA=)

## Highlight Specific Products <a href="#h_01jdmfrxhk5ebryzq09gw4s4ny" id="h_01jdmfrxhk5ebryzq09gw4s4ny"></a>

Promote key products to appear at the forefront of the results, regardless of whether they are included by the algorithms.

1. Highlighted products appear only once in the final results, even if listed multiple times.
2. You can configure highlighted products for each algorithm individually.

![Image without caption](https://image-forwarder.notaku.so/aHR0cHM6Ly93d3cubm90aW9uLnNvL2ltYWdlL2h0dHBzJTNBJTJGJTJGcHJvZC1maWxlcy1zZWN1cmUuczMudXMtd2VzdC0yLmFtYXpvbmF3cy5jb20lMkZjZjFjZDNjZC02OWMzLTQ0ZTQtODg0YS0zMzM5NTllZTA3YmIlMkYyMjZiZDFjMC1lZTFhLTQyZWYtOGRkMC0yYWMyNTljOTRkNjclMkZVbnRpdGxlZC5wbmc_dGFibGU9YmxvY2smc3BhY2VJZD1jZjFjZDNjZC02OWMzLTQ0ZTQtODg0YS0zMzM5NTllZTA3YmImaWQ9MTk1NGQ4NDAtNzQ5Yy00NTk1LWJmNWEtZGQwNzE5NmMwZDBjJmNhY2hlPXYyJndpZHRoPTEzNjA=)

**To highlight products:**

1. Click on the **+ Pick Products** to Promote button.
2. Use the interface to search, filter, add, or remove products.
3. Alternatively, import products using the Import Products button and provide a list of product IDs. If an ID is invalid, an error message will appear.

## Set Exceptions <a href="#h_01jdmftp8795w3sdetm3x2jr6z" id="h_01jdmftp8795w3sdetm3x2jr6z"></a>

Exceptions allow you to define specific conditions that override the default results.

![Image without caption](https://image-forwarder.notaku.so/aHR0cHM6Ly93d3cubm90aW9uLnNvL2ltYWdlL2h0dHBzJTNBJTJGJTJGcHJvZC1maWxlcy1zZWN1cmUuczMudXMtd2VzdC0yLmFtYXpvbmF3cy5jb20lMkZjZjFjZDNjZC02OWMzLTQ0ZTQtODg0YS0zMzM5NTllZTA3YmIlMkYzYTUzYjI4Yy02NzQ2LTQ0ZjUtOGVmMy1mZTI1NGJkNGE3OGUlMkZVbnRpdGxlZC5wbmc_dGFibGU9YmxvY2smc3BhY2VJZD1jZjFjZDNjZC02OWMzLTQ0ZTQtODg0YS0zMzM5NTllZTA3YmImaWQ9YjFhZjA5OTktMzY2Yi00YzFlLTlkNzMtYmM4YmZhN2VjZDczJmNhY2hlPXYyJndpZHRoPTEzNjA=)

**Structure of an exception:**

1. **Clause:** Define the condition to trigger the exception.
2. **Algorithm:** Specify which algorithm to use.
3. **Filters:** Apply relevant filters.
4. **Shuffle:** Decide whether to shuffle products.
5. **Promoted Products:** Highlight specific products within the exception.

**To add an exception:** click on the **+ Add a Condition** button.

## Configure Additional Options <a href="#h_01jdmfvx8pteszgcyr4zkexxn3" id="h_01jdmfvx8pteszgcyr4zkexxn3"></a>

Options vary based on the selected page and include:

1. **Exclude products added to the cart:** Prevents products already in the cart from appearing in recommendations.
2. **Exclude the viewed product:** Prevents the currently viewed product from being displayed.
3. **Set a fixed number of products:** Ensures a specific number of products in the final result.

![Image without caption](https://image-forwarder.notaku.so/aHR0cHM6Ly93d3cubm90aW9uLnNvL2ltYWdlL2h0dHBzJTNBJTJGJTJGcHJvZC1maWxlcy1zZWN1cmUuczMudXMtd2VzdC0yLmFtYXpvbmF3cy5jb20lMkZjZjFjZDNjZC02OWMzLTQ0ZTQtODg0YS0zMzM5NTllZTA3YmIlMkZkYTdhZDQwMy1hYTg1LTRkZTMtYmZlMC1mNWJiM2E4MTM4MDQlMkZVbnRpdGxlZC5wbmc_dGFibGU9YmxvY2smc3BhY2VJZD1jZjFjZDNjZC02OWMzLTQ0ZTQtODg0YS0zMzM5NTllZTA3YmImaWQ9OTcwYTcyNzgtYTljNi00NDY5LThkOTctODY1YjU1NjljMDU2JmNhY2hlPXYyJndpZHRoPTEzNjA=)

## Preview and Save Your Work <a href="#h_01jdmfwhsf1q669efj40c4ezfg" id="h_01jdmfwhsf1q669efj40c4ezfg"></a>

1. Click the **Preview** button in the header to see how your configuration will appear.
2. Once satisfied, click the Save button to apply your changes.

![Image without caption](https://image-forwarder.notaku.so/aHR0cHM6Ly93d3cubm90aW9uLnNvL2ltYWdlL2h0dHBzJTNBJTJGJTJGcHJvZC1maWxlcy1zZWN1cmUuczMudXMtd2VzdC0yLmFtYXpvbmF3cy5jb20lMkZjZjFjZDNjZC02OWMzLTQ0ZTQtODg0YS0zMzM5NTllZTA3YmIlMkZmYzgzZjQ0Ni02MTdlLTQxYjAtODYwYS0xNDYxYmVlZTliMjUlMkZVbnRpdGxlZC5wbmc_dGFibGU9YmxvY2smc3BhY2VJZD1jZjFjZDNjZC02OWMzLTQ0ZTQtODg0YS0zMzM5NTllZTA3YmImaWQ9ZDM3YjJiYzYtYWNmYy00Y2NlLWIwYTktNjRjZGQ1ZGU2YTNjJmNhY2hlPXYyJndpZHRoPTEzNjA=)

By following these steps, you can easily create and fine-tune algorithms to meet your specific needs.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.abtasty.com/recommendations-and-merchandising_deprecated/recos-and-merch-algorythms/how-to-create-your-algorithms.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
