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

# Recommendation rules

> Tell your agent which products to show only, or show first, when a customer asks about a topic, season or occasion.

A recommendation rule is one merchandising intent: when a customer asks about something you describe in plain words, the agent recommends only a chosen set of products, or puts them first. Use rules for seasonal pushes ("anyone asking about Valentine's gifts"), bundles, or clearing stock, without editing every product.

Rules are set once for the workspace and apply to every agent that has **Recommend products** switched on. See [Agent capabilities](https://docs.trypopcorn.ai/agents/capabilities.md#selling-and-orders).

## Before you start

* Your catalog must contain the products you want to pick. See [Product catalog](https://docs.trypopcorn.ai/products/catalog.md).
* A rule affects what the agent's product search returns. It does not change your storefront, and it does not affect products a teammate sends manually from the Inbox.

## Create a rule

**1. Open the rules tab**

Go to **Products** and open the **Recommendation rules** tab, or click **Manage rules** next to **Recommend products** on an agent's **Actions** tab. Click **Add rule**.

**2. Name it**

In **New rule**, enter a **Name**, for example "Valentine 2026". Names are kept to 120 characters.

**3. Describe when it applies**

Under **When the customer asks about**, describe the customer signal in your own words, for example "When the customer is asking about Valentine, a gift for their wife or girlfriend, or romance." Descriptions are kept to 500 characters. The agent reads this description during each conversation to decide whether the rule applies, so write it the way a customer would phrase the request.

**4. Choose what the agent should do**

Under **What the agent should do**, pick one:

* **Show only these products**: when this rule matches, the agent recommends from this list only.
* **Show these products first**: when this rule matches, the agent floats these products to the top of the results.

**5. Pick the products**

Under **Products**, use **Search products** and click the products to select them. Selected products stay at the top of the list, and the count under the list reads, for example, "3 products selected". A rule holds up to 500 products.

If your products carry tags, **Add products by tag** opens a panel where you search for tags, pick one or more and click **Add** to select every product with those tags in one go. You see "Added 12 products to the list." You can still remove individual products afterwards. The rule keeps a list of products, not the tag: products that get the tag later are not added.

**6. Set an active window (optional)**

Under **Active window (optional)**, fill in **Starts** and **Ends** to limit the rule to a date range. Dates are whole days in your local time: the rule starts at the beginning of the start day and stops at the end of the end day. Leave both empty for an always-active rule, or fill in only one for a rule that starts, or ends, on a day.

**7. Save**

Click **Create rule**. You see "Rule created". The rule is on immediately and applies from the next conversation.

## Manage rules

Each rule shows its name, an **Only these** or **These first** badge, the description, the number of products, and either the dates ("Feb 1, 2026 to Feb 14, 2026", "From …", "Until …") or **Always active**. A paused rule shows a **Paused** badge.

Open the **⋯** menu (**More actions**) on a rule:

* **Edit rule** opens it again; save with **Save changes**. You see "Rule saved".
* **Pause rule** turns it off without deleting it ("Rule paused"), and **Resume rule** turns it back on ("Rule resumed"). Pausing works even if some of the rule's products have since been deleted.
* **Delete rule** asks you to confirm with **Delete rule**: the agent stops using it from the next conversation onward, and the products themselves are not affected.

When some products are boosted or hidden one by one, a strip above the rules reads, for example, "4 products boosted · 2 products hidden", with **Manage in catalog** to open the **Catalog** tab.

## Examples

| Goal | When the customer asks about | Action | Products and window |
| - | - | - | - |
| Push the Valentine collection in February | Valentine, a gift for their wife or girlfriend, or romance | **Show these products first** | The Valentine products, **Starts** 1 Feb, **Ends** 14 Feb |
| Answer corporate-gifting enquiries with a curated set only | Corporate gifts, bulk orders for employees or clients | **Show only these products** | The corporate bundles, always active |
| Clear last season's stock | A discount, a deal, or the cheapest option | **Show these products first** | Every product tagged "clearance", added with **Add products by tag** |

## Rules or per-product weights?

| Use | When you want |
| - | - |
| **Boost** on a product | A standing preference for that product in every conversation where it is relevant |
| **Hide** on a product | The agent to never mention that product, while it stays on your storefront |
| **Show these products first** | A set of products to lead the results only for a kind of request, optionally for a period |
| **Show only these products** | The agent to recommend nothing outside a set for a kind of request |

## How rules, weights and search combine

1. The customer asks for something and the agent searches the catalog. Products set to **Hide** never appear, whatever the rules say.
2. The agent checks your enabled rules that are inside their active window and decides which ones apply to the current conversation, using your **When the customer asks about** descriptions.
3. If any applicable rule is **Show only these products**, results are limited to the products of those rules. If none of the search results are in the list, the agent gets no products for that search rather than falling back to the whole catalog.
4. Products from applicable **Show these products first** rules move to the top, ahead of products that are merely boosted. Otherwise the order stays by relevance, with boosted products first.
5. A rule that names a product with variants covers all of that product's variants. When a **Show only these products** rule applies, the options the agent sees for a product (which colours or sizes are for sale) include only the variants the rule allows.

Rules and weights apply to the agent's product search only. Sending a product card from the Inbox, or the catalog the customer browses in WhatsApp, is not filtered by rules.

## Troubleshooting

* **The agent ignores a rule.** Check that the rule is not paused or outside its dates, that the agent has **Recommend products** on, and that the description matches how customers actually phrase the request. Test it in the agent's test chat before relying on it; see [Test and publish](https://docs.trypopcorn.ai/agents/test-and-publish.md).
* **An "only" rule leaves the agent with nothing to show.** The customer's request matched the rule, but none of the products in the list matched what they asked for. Widen the product list or switch the rule to **Show these products first**.
* **A product you deleted is missing from a rule.** Opening the rule drops products that no longer exist from its list. Save the rule to keep the change.
* **Couldn't save the rule.** The rule needs a name ("Give this rule a name."), a description ("Describe when this rule should apply.") and at least one product ("Pick at least one product."). The **Starts** date must not be after the **Ends** date.

## Related

* [Product catalog](https://docs.trypopcorn.ai/products/catalog.md) for per-product **Boost**, **Normal** and **Hide**.
* [Popcorn's rules and Voice](https://docs.trypopcorn.ai/agents/popcorns-rules.md) for how the agent sounds and behaves alongside rules.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.