> Documentation index: [Saleor](/llms.txt) · [This section](/demos/llms.txt)
> Source: https://docs.saleor.io/demos/similar-products

# Product Recommendations with OpenAI and Saleor

This example shows how to use the OpenAI Embeddings API to find products that are semantically similar based on their overall characteristics — such as attributes, product type, or category.

You can find the source code in the [Saleor Examples repository](https://github.com/saleor/examples/tree/HEAD/example-app-similar-products-embeddings).

<a id="how-it-works"></a>

## How it works

This example uses the **OpenAI Embeddings API** to find products that are semantically similar based on their characteristics.

1.  Generate embeddings - Product data (type, attributes, category, description) is converted into 1536-dimensional vectors using the embeddings model.
2.  Store vectors - The generated vectors are saved along with product metadata.
3.  Compare vectors - When viewing a product, its vector is compared with others using cosine similarity to find the closest matches.
4.  Display results - The top matches above a similarity threshold are shown as "similar products".

The demo focuses on the basic logic for semantic similarity. In production, this approach can be extended using, for example, a vector database.
