{"section":"tutorials","requestedLocale":"en","requestedSlug":"intelligent-search-semantic-search","locale":"en","slug":"intelligent-search-semantic-search","path":"docs/en/tutorials/intelligent-search/intelligent-search-semantic-search.md","branch":"main","content":"> ℹ️ This feature is in early access, which means only selected customers have access to it at this time. If you're a VTEX client and want to adopt Semantic search for your business, contact [Commercial Support](https://help.vtex.com/en/docs/tracks/commercial-support). Additional fees may apply. If you're not a VTEX client but are interested in this solution, complete our [contact form](https://vtex.com/en-us/contact/).\n\nIntelligent Search combines the precision of lexical techniques with the intelligence of Semantic search models to provide a relevant and seamless experience that aligns with user intent.\n\nThis strategy improves product discovery, increases conversions, and reduces friction in interactions, especially in large, varied catalogs.\n\n## Key concepts\n\nIntelligent Search combines two key concepts:\n\n* **Lexical search**: Based on direct keyword matching.\n* **Semantic search**: Focused on interpreting the meaning and intent behind the query.\n\nLearn more about each one below.\n\n### Lexical search\n\nThe lexical layer of search works by directly matching the query terms against the data indexed in the catalog, such as product name, description, technical attributes, and others. This approach works well when customers use exact keywords or search by product codes.\n\n**Example:**\n\n* **Query:** `Nike Air Max 90 sneakers`\n\n  * Lexical search returns exactly the products with that name in the catalog.\n\n### Semantic search\n\nThe semantic layer, based on **Natural Language Processing (NLP)** and **machine learning models**, interprets the meaning of words and the context in which they are used. It recognizes synonyms, relates similar terms, and identifies the customer's intent even when the query doesn't mention exact words found in the catalog.\n\n**Example:**\n\n* **Query**: `running shoes for a marathon`\n\n  * Semantic search understands that the user is looking for shoes focused on long-distance performance, and prioritizes products designed for endurance running, even if they don't use \"marathon\" in the description.\n\n* **Query**: `workout clothes for cold weather`\n\n  * **Lexical**: May not find a direct match for \"workout clothes for cold weather\".\n  * **Semantic**: Understands that the user is looking for sportswear with thermal protection, and prioritizes items such as thermal pants and long-sleeve tops.\n\n## Intelligent Search approach\n\nIntelligent Search dynamically combines these two strategies. The platform uses semantic models trained for the retail context and complements this interpretation with the consolidated lexical structure of Intelligent Search.\n\nThis model considers:\n\n* Structured catalog fields (lexical)\n* Relationships between terms and synonyms (semantic)\n* Search context and user behavior\n* Statistical relevance and machine learning\n\nThe result is a search system that delivers results better aligned with what consumers actually want to find, even when they use natural or ambiguous language.\n\nExample: an electronics ecommerce store receives both specific searches for \"SSD A400 480GB\" (a case where lexical search is ideal) and queries such as \"best storage for games\" (a case where semantic search is better). Intelligent Search handles both queries efficiently.\n\nIn practice, if a customer types \"16GB memory\", for example, the lexical part identifies the exact capacity (16GB), while the semantic component understands that \"memory\" can refer to both RAM and memory cards, presenting both categories with priority given to the most relevant products based on the user's previous behavior.\n\n### Purchase Signal Reranking (PSR)\n\nSemantic Search benefits from the store's purchase history. Purchase Signal Reranking (PSR) identifies, for each product, the search terms that most generated orders, and builds a base of terms associated with that product from them.\n\nThis base is used as input for the Semantic Search model and directly affects its score: a product that is usually purchased after a certain search tends to have a higher score for that search.\n\nPSR is standard in all stores with Semantic Search, requires no activation or configuration, and does not compete with standard [relevance rules](https://help.vtex.com/en/docs/tutorials/relevance-rules).\n\n#### Requirements\n\nTo feed this base, the store must send search events to [Activity Flow](https://developers.vtex.com/docs/guides/activity-flow). The required actions depend on the storefront technology used:\n\n| Situation | What to do |\n| :---- | :---- |\n| Store with [Store Framework](https://help.vtex.com/en/docs/tracks/frontend#store-framework) and native components | Nothing. The events are already sent automatically. To implement search components in Store Framework stores, see [Implementing search on the storefront](https://help.vtex.com/en/docs/tracks/implementing-the-search-in-your-store-frontend). |\n| Store with [FastStore](https://help.vtex.com/en/docs/tracks/frontend#faststore) version 3.90.0 or later | Nothing. The events are already sent automatically. To implement search components in FastStore stores, see [Implementing search features](https://developers.vtex.com/docs/guides/faststore/storefront-features-implementing-search-features). |\n| Store with [FastStore](https://help.vtex.com/en/docs/tracks/frontend#faststore) version earlier than 3.90.0 | Update the store to version 3.90.0 or later. |\n| Headless store | [Install Activity Flow in headless stores](https://developers.vtex.com/docs/guides/installing-activity-flow-in-headless-stores) and send the search events. New integrations must use [Intelligent Search API v1](https://developers.vtex.com/docs/api-reference/intelligent-search-api-v1). Confirm the installation and that search events are working by following the validation step in the [Installing Activity Flow in headless stores](https://developers.vtex.com/docs/guides/installing-activity-flow-in-headless-stores) guide. |\n| Mobile app | [Install Activity Flow in mobile apps](https://developers.vtex.com/docs/guides/installing-activity-flow-in-mobile-apps) and send the search events. |\n\n## Advantages\n\nThe main advantages of this solution for the customer experience and store performance are:\n\n* **Increased conversion:** Delivering more relevant results reduces the time it takes to find a product, which can speed up purchase decisions.\n* **Natural language understanding:** Customers can search the way they speak: with full questions, vague terms, or informal language. For example, a customer can search `what is the best trail running shoe?`, and the search understands they're looking for shoes with specific features, such as a lugged sole and water resistance.\n* **Support for complex discovery cases:** Ideal for catalogs with products that have more subjective descriptions (for example: fashion, beauty, home decor), where the exact attribute may not be explicitly present, but the user's intent can be inferred.\n\n## How to test Semantic search\n\nBefore applying Semantic search to all customers in the store, you can test it to compare results with and without this feature. The testing method depends on the store's architecture.\n\nFor PSR to influence results during testing, the store must be sending search events to Activity Flow. See the PSR [requirements](#requirements).\n\n### Store Framework stores\n\nFor stores that use [Store Framework](https://help.vtex.com/en/docs/tracks/frontend#store-framework), VTEX can create a test workspace and, if necessary, set up an A/B test with VTEX's internal solution to compare results with and without Semantic search. To do so, contact [Support](https://help.vtex.com/en/docs/tutorials/how-does-vtex-support-work).\n\n### Headless or FastStore stores\n\nFor Headless stores or those that use [FastStore](https://help.vtex.com/en/docs/tracks/frontend#faststore), Semantic search can be tested by adding a parameter to the URL of the call made to the [Intelligent Search API](https://developers.vtex.com/docs/api-reference/intelligent-search-api-v1#get-/product-search/-facets-), without changing any store configuration.\n\nA *query string* is the part that appears after the `?` symbol at the end of a URL. It's used to send additional information to the server without changing the rest of the address, in the format `parameter=value`. When there is more than one parameter, they are separated by the `&` symbol.\n\nTo test Semantic search in a specific call, add the `semanticRatio` parameter to the *query string* of the search URL, in the format `?semanticRatio={weightValue}`. This parameter accepts values between `0` and `1`, which define how the search works:\n\n* `0`: Uses only lexical search. This is also the default behavior when the parameter isn't provided.\n* `1`: Uses only Semantic search.\n* `0.5`: Combines both models. Any value between `0` and `1` behaves like `0.5`.\n\n**Example:**\n\n* Without Semantic search: `https://{accountName}.vtexcommercestable.com/api/intelligent-search/v1/product-search?query=baby%20formula`\n* With Semantic search: `https://{accountName}.vtexcommercestable.com/api/intelligent-search/v1/product-search?query=baby%20formula&semanticRatio=0.5`\n\nBecause the parameter is added only to the URL of the test call, it doesn't change the store's configuration or affect other calls. This lets you compare both versions side by side or use this URL in your own A/B testing tool to direct part of the traffic to the version with Semantic search.\n\n### Direct activation in production\n\nYou can also activate Semantic search directly for all calls made to the API, without including the `semanticRatio` parameter in each request. This activation must be requested from [Support](https://help.vtex.com/en/docs/tutorials/how-does-vtex-support-work), and since it applies the change to all customers in the production store, it isn't recommended for testing."}