How SmartBrain Decides Which Product to Recommend — The Server-Side Logic Explained
The short answer: the server decides, the AI just talks
When a customer sends a message like "I need a gift under €50 for a runner," SmartBrain does not ask an AI model to guess which product fits. Instead, the recommendation engine queries your live catalog first — filtering by price, stock status, and any rules you have configured — and hands a confirmed product to the AI. The AI's only job is to write a natural, personalized message around it.
This architecture matters because AI language models hallucinate. They can confidently name a product that is out of stock, discontinued, or priced incorrectly. SmartBrain eliminates that risk by keeping product selection entirely server-side, where your data is authoritative.
What "server-side product selection" means in practice
Server-side selection means the recommendation logic runs against your actual database or Shopify catalog at the moment a customer asks a question. Nothing is cached from a previous session, and no product is suggested that does not currently exist in your system with available inventory.
The flow looks like this:
- A customer message arrives via DM, chat, or a form trigger.
- SmartBrain extracts intent signals: category, budget, occasion, constraints.
- A structured query runs against your catalog with those signals as filters.
- One or more matching products are retrieved — confirmed in stock, within budget, eligible under your promotion rules.
- The matched product data is passed to the AI layer, which writes the reply.
The AI never has access to the full catalog. It receives a structured payload: product name, price, image URL, short description, and a link. It writes copy around what the server already decided.
Which signals does the engine actually use to filter?
Budget range
If a customer states a budget explicitly ("under €50", "around $100") or if one is inferred from context, the query applies a price ceiling and optionally a floor. Products outside the range are excluded before the AI sees anything. This is the most common filter and the one that most directly prevents the classic AI error of recommending a product the customer cannot afford.
Real-time stock status
Only products with available inventory pass the filter. If a variant is sold out, it is excluded even if it would otherwise be a perfect match. For Shopify stores with multi-location inventory, the query can be scoped to a specific warehouse or fulfillment zone.
Category and intent matching
Intent signals extracted from the conversation — "running shoes," "gift for a teenager," "vegan skincare" — map to your catalog taxonomy. SmartBrain uses your existing product tags, collections, and metafields rather than a separate AI-generated classification layer. This means your merchandising decisions carry over directly: if you have tagged a product as "gift-suitable," that tag is queryable.
Promotion and margin rules
Store owners and agencies can configure rules that exclude low-margin SKUs from recommendations, prioritize products currently on promotion, or boost items that need to move. These rules run as query modifiers on the server — they are not instructions given to an AI model, which means they are reliable and auditable.
A concrete example: the €50 gift scenario
A customer on Instagram DMs your store: "Hi, I need a birthday gift for my girlfriend, she loves yoga, budget around €50."
SmartBrain's engine extracts three signals: category = yoga/wellness, budget ceiling = €50, occasion = birthday gift. It runs a query against your Shopify catalog: products tagged "yoga" or in the "wellness" collection, priced between €20 and €50, with stock available, sorted by a configurable relevance score that you control (bestseller rank, margin, or manual curation).
The top result — say, a €44 yoga mat with a gift-packaging option — is retrieved. The server passes that product record to the AI, which writes: "Great choice for a yoga lover! This premium cork mat is €44 and we can add gift wrapping at checkout — here's the link." The AI did not pick the mat. It described the mat the server already chose.
How this compares to a pure LLM recommendation approach
Some commerce chatbots let the AI model read a product list and choose what to recommend. This approach is simpler to set up but introduces several failure modes that cost real money:
- Hallucinated availability: The AI recommends a product it saw in a training snapshot or an older catalog export, regardless of current stock.
- Price drift: If the catalog feed is not updated in real time, the AI quotes a price that has since changed.
- Uncontrolled margin exposure: Without server-side rules, the AI has no concept of which products you want to promote or protect.
- No auditability: When a customer complains about a wrong recommendation, there is no query log to inspect — only a language model's probabilistic output.
SmartBrain's architecture inverts this. The business logic is deterministic and logged. The AI is responsible only for tone and fluency — the parts where language models actually excel.
What store owners and agencies need to configure
The recommendation engine works out of the box with a standard Shopify catalog sync, but the quality of recommendations improves significantly with a few deliberate setup choices:
- Clean product tags: Use consistent taxonomy. "yoga-mat" is queryable; "YM-v2-cork-NEW" is not useful as a semantic filter.
- Metafields for occasions and personas: Tagging products as "gift-suitable," "beginner-friendly," or "professional-grade" gives the engine more filter dimensions without requiring any AI inference.
- Promotion rules: Define which collections or SKUs should be boosted or suppressed in recommendations. These are simple JSON or UI-configured rules, not prompt engineering.
- Budget tiers: If your catalog spans a wide price range, configuring sensible budget band defaults improves match quality when customers give vague signals like "not too expensive."
FAQ
Does SmartBrain work with products that have multiple variants?
Yes. The query engine operates at the variant level. If a customer specifies a size or color, the filter applies to that specific variant's stock status and price. Only available variants are surfaced.
Can I exclude certain products from ever being recommended?
Yes. You can add products or collections to a blocklist in the configuration. This is useful for clearance items you do not want to highlight, or for products with complex purchasing requirements (age verification, prescription, etc.).
What happens if no product matches the customer's filters?
The engine returns a fallback signal to the AI layer, which can then ask a clarifying question ("Would you consider a slightly higher budget?") or offer the closest available alternative. The fallback behavior is configurable per store.
Is the product selection logic visible and auditable?
Every recommendation event is logged with the query parameters used, the matched product ID, and a timestamp. This makes it straightforward to audit why a specific product was recommended in a given conversation.
Does the AI ever override the server's product selection?
No. The AI layer in SmartBrain has no write access to the recommendation output. It receives the product payload as a fixed input and generates copy around it. The separation between selection logic and language generation is enforced at the architecture level, not by instruction.
Try SmartBrain free on your store — watch it qualify a shopper and recommend the exact in-stock product, in minutes. Free plan, instant setup, no rebuild.
Start free →