--- title: About Predictive Query Suggestions (PQS) slug: lcee0589 canonical_url: https://docs.coveo.com/en/lcee0589/ collection: coveo-for-commerce source_format: adoc --- # About Predictive Query Suggestions (PQS) Unlike Coveo ML QS [models](https://docs.coveo.com/en/1012/), which generate suggestions based on query-click patterns, PQS [models](https://docs.coveo.com/en/1012/) leverage Coveo's [product embeddings and vector](https://docs.coveo.com/en/l9gg3565/) capabilities. Leveraging these capabilities allows PQS [models](https://docs.coveo.com/en/1012/) to detect [visitors](https://docs.coveo.com/en/nbub9475/)' shopping objectives and react to intent changes in real time. This means that PQS [models](https://docs.coveo.com/en/1012/) can suggest [query](https://docs.coveo.com/en/231/) candidates that are tailored to the current [visitor](https://docs.coveo.com/en/nbub9475/)’s shopping context, whether they're authenticated or not. ![illustration of PQS outputs | Coveo](coveo-for-commerce/images/pqs-visual.png) Members with the [required privileges](https://docs.coveo.com/en/3398#required-privileges) can [configure and activate Coveo ML PQS in a few clicks](https://docs.coveo.com/en/lcfi0103/). Developers can leverage this [model](https://docs.coveo.com/en/1012/) type in a [search interface](https://docs.coveo.com/en/2741/) using the [Headless library](https://docs.coveo.com/en/headless/latest/reference/interfaces/Search.QuerySuggestActionCreators.html), or with [Atomic](https://static.cloud.coveo.com/atomic/v3/storybook/index.html?path=/docs/atomic-search-box-query-suggestions\--docs). ## How do PQS models work? PQS models leverage advanced deep learning techniques to deliver contextually relevant query suggestions to your [visitors](https://docs.coveo.com/en/nbub9475/). To achieve this, PQS [models](https://docs.coveo.com/en/1012/) rely on the interactions between product and [user session vectors](https://docs.coveo.com/en/nbla0227/). [product vectors](https://docs.coveo.com/en/nbla0256/) are representations of the products made available in your [catalog entity](https://docs.coveo.com/en/3143/), where similar and complementary products are close to each other. These vectors capture relationships between products based on user behavior, [visitor](https://docs.coveo.com/en/nbub9475/) data, and product information. [user session vectors](https://docs.coveo.com/en/nbla0227/) are generated based on [visitor](https://docs.coveo.com/en/nbub9475/) interactions and [Coveo Analytics events](https://docs.coveo.com/en/260/) within their current browsing session. [Product detail view events](https://docs.coveo.com/en/l2pd0522/), which indicate [visitor](https://docs.coveo.com/en/nbub9475/) engagement with specific products during the session, are essential in shaping this vector. They're vital for understanding the [visitor](https://docs.coveo.com/en/nbub9475/)’s immediate interests and preferences. A [user session vector](https://docs.coveo.com/en/nbla0227/) evolves dynamically as the [visitor](https://docs.coveo.com/en/nbub9475/) interacts with your site during their session. It reflects the visitor's behavior, interests, and interactions in real time, making it a crucial element in returning contextually relevant query suggestions. ## How do PQS models leverage product and user session vectors? To generate relevant query suggestions, PQS models leverage the relationships between [user session vectors](https://docs.coveo.com/en/nbla0227/) and [product vectors](https://docs.coveo.com/en/nbla0256/) in the following way: * By continuously analyzing the detail view events of a [visitor](https://docs.coveo.com/en/nbub9475/)’s session, the model detects their shopping intent and generates a _user session_ vector. * PQS relies on _product_ vectors to uncover relationships between products made available by your [catalog entity](https://docs.coveo.com/en/3143/). These relationships are learned from previous [visitor](https://docs.coveo.com/en/nbub9475/) interactions, revealing which products are often associated with or complement each other. * The model positions the _user session_ vector within the _product_ vector space to identify the products that are most relevant to the visitor's current session. * Based on the _user session_ vector's position within the [product vector](https://docs.coveo.com/en/nbla0256/) space, the model suggests queries that have led to success for other [visitors](https://docs.coveo.com/en/nbub9475/) with similar shopping intents. **Example** Visitors A and B have been browsing for sporting equipment in your Coveo-powered ecommerce website. Visitor A has shown interest in soccer-related products like soccer balls and jerseys, while Visitor B has focused on basketball-related products such as basketballs and jerseys. By analyzing the products viewed during these two sessions, PQS can detect that Visitor A is interested in soccer products, while Visitor B is interested in basketball products. Both user sessions vectors are updated according to the visitor's shopping intent. Both visitors then start typing in the search box for `shoes`. By embedding the [user session vector](https://docs.coveo.com/en/nbla0227/) in the [product vector](https://docs.coveo.com/en/nbla0256/) space, PQS can identify the products that are most relevant to the visitor's current session. Based on the user session vector's position within the product vector space, PQS suggests queries that have led to success for other visitors with similar shopping intents, such as `soccer shoes` to Visitor A and `basketball shoes` to Visitor B. ## About the cold start feature With traditional algorithms, [product vectors](https://docs.coveo.com/en/nbla0256/) are generated based on customer interactions with the different products made available in your [catalog entity](https://docs.coveo.com/en/3143/). This means that the more interactions a product has, the more accurate its vector representation will be. But what if a product has none or few interactions? The vector generation process integrates a cold start feature to address this issue. This optimized process allows the usage of product's [metadata](https://docs.coveo.com/en/218/) to build its vector representation and place it accurately within the vector space. For more information, see [About the cold start feature](https://docs.coveo.com/en/na2a8306/). ## Prerequisites To be able to create a PQS model, make sure you: * Have product data indexed in a [Catalog source](https://docs.coveo.com/en/n8of0593/). * Have configured a [catalog entity](https://docs.coveo.com/en/3139/). * Ensure that the [search interface](https://docs.coveo.com/en/2741/) where you want to integrate the model is configured to log [commerce events](https://docs.coveo.com/en/3188/). More specifically, you must minimally log [click](https://docs.coveo.com/en/o1n92447/) and [product view](https://docs.coveo.com/en/o1n93101/) events. Note that if your Coveo for Commerce implementation targets the Search API, you must also [log search events](https://docs.coveo.com/en/o1n91392/). * Make sure tracked events send a [tracking ID](https://docs.coveo.com/en/o8rb0139/) value. This is done when [initializing the Relay library](https://docs.coveo.com/en/o1n90002/). PQS models are based on usage analytics data, so if no data is available, there will be no suggestions. If you recently started collecting usage analytics data, suggestions will improve as more data becomes available each time the [model](https://docs.coveo.com/en/1012/) is [retrained](https://docs.coveo.com/en/1727#training-and-retraining).