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

# Query-Based Recommendations

The **Query-Based Recommendations** algorithm dynamically generates personalized suggestions by interpreting a shopper’s explicit search input or business-defined query. Ideal for headless environments, QBA transforms any keyword or rule into a tailored recommendation set—without relying on a graphical UI.

<img src="https://mintcdn.com/experro/4fPtPqhyselHfqmM/images/discovery/qba_example.png?fit=max&auto=format&n=4fPtPqhyselHfqmM&q=85&s=c7af6742fe7795a14b7abb5773520ec0" alt="" width="1345" height="649" data-path="images/discovery/qba_example.png" />

## How It Works

1. **Query Parsing**\
   The system ingests the user’s search term or custom query, extracting keywords, filters, and logical operators.

2. **Intent & Preference Analysis**\
   Natural language processing and business rules interpret shopper intent (e.g., “leather office chair under \$200”).

3. **Data Retrieval**\
   A tailored database lookup applies the parsed conditions—matching product attributes, categories, or metadata.

4. **Relevance Scoring**\
   Matched items are ranked by semantic relevance, performance signals (clicks, conversions), and any active merchandising rules.

5. **Results Delivery**\
   The algorithm returns a prioritized list of recommendations that best align with the original query’s intent and any configured rules.

## Supported Rule Types

* Global
* Home Page
* Product
* Category
* Cart
* Search

## When to Use

* **Headless Integrations:** Embed personalized recommendations directly via API calls in any frontend (mobile app, CMS, PWA).
* **Rule-Driven Campaigns:** Combine with business logic (“on sale,” “clearance”) for promotional or seasonal collections.
* **Zero-UI Experiences:** Power chatbots or voice assistants where visual widgets aren’t available.

## Example

1. A shopper enters the query **“ergonomic mesh office chair with lumbar support”** into your site’s search bar.
2. QBA parses the keywords and applies a rule to exclude out-of-stock items.
3. It retrieves all matching chairs, ranks them by recent performance and in-stock levels, and applies any boost rules (e.g., promoted brands).
4. The top 5 chairs are returned as recommendations in a headless widget on the category page.
