> For the complete documentation index, see [llms.txt](https://docs.abtasty.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.abtasty.com/recommendations-and-merchandising/concepts/strategies/rules/presets-default-algorithms/algorithms-usage.md).

# Algorithms Usage

### Default algorithmic signals

In addition to manual or variable-based blocks, **AB Tasty Recommendations & Merchandising** provides default algorithmic logic for several ranking blocks, for example *Associated Products* and *Similar Products*.

These are powered by three main signals:&#x20;

* Co-occurrence
* TF-IDF
* Semantic

### Co-occurrence

* **Definition**: Co-occurrence measures how often two products appear together in the same context (same basket, same purchase, or same browsing session).
* **Logic**: The more frequently two products are seen or bought together, the stronger their association score.
* **Example use cases**:
  * *Associated products* (“Frequently bought together”): Phone + Protective Case
  * *Complementary products*: Printer + Ink Cartridges

### TF-IDF (Term Frequency – Inverse Document Frequency)

* **Definition**: A weighting method that adjusts the co-occurrence score to reduce the bias of overly generic products.
* **Why it matters**: Popular products (gift cards, batteries, etc.) tend to appear in many baskets and could dominate co-occurrence. TF-IDF down-weights such generic items and highlights more relevant, less obvious associations.
* **Example use cases**:
  * *Associated products with relevance*: Instead of recommending a gift card with every book, TF-IDF will surface the next tome in the same series.
  * *Similar products*: Boosts underexposed or niche products, giving visibility to new arrivals or long-tail items.

### Semantic (on demand)

* **Definition**: Semantic similarity measures how closely products relate to each other based on their **descriptions, attributes, and catalog metadata**, rather than just co-viewing or co-purchasing patterns.
* **Logic**: By analyzing product text and attributes, semantic algorithms identify products that “feel alike” in style, function, or category.
* **Example use cases**:
  * *Similar products on PDP*: A customer viewing a red running shoe could be shown other running shoes of similar style or color.
  * *Alternative discovery*: Highlight stylistically close items when co-occurrence data is too sparse (e.g., for new products).

{% hint style="info" %}
**Semantic Algo – Multilingual**\
The embedding model is trained on 109 languages, including those without spaces between words (e.g. Japanese, Chinese, Thai). This differs from the Content Interest Criterion (segment builder), which does not support such languages.
{% endhint %}

#### How AB Tasty uses them

* Both the **“Associated Products”** and **“Similar Products”** blocks sort results using:
  * **Co-occurrence** (frequency)
  * **TF-IDF** (relevance adjustment)
* Semantic similarity can be **activated on demand** to enrich *Similar Products* recommendations and improve discovery when behavioral data is limited.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.abtasty.com/recommendations-and-merchandising/concepts/strategies/rules/presets-default-algorithms/algorithms-usage.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
