---
schema_version: "1"
id: d99e763749763fc7817e74a491017720968fb664f8e3696243e7aa5d9d0c7369
title: Automatic Query Rewrite for Agentic Commerce Search
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/cc/264-0-0/b2c_acs_query_rewrite.md
canonical_url: https://help.salesforce.com/s/articleView?id=cc.b2c_acs_query_rewrite.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 25d981a3b964f3bf41d079f0248695d5eaac682ff51e2c044cb348b888a4f3e1
description: Agentic Query Rewrite in Agentic Commerce Search for B2C Commerce automatically reformulates queries that return poor or irrelevant results to show more relevant products. The feature activates after provisioning and requires no admin configuration.
products:
  - Commerce
  - B2C Commerce
release: "264"
---
# Automatic Query Rewrite for Agentic Commerce Search

Agentic Query Rewrite in Agentic Commerce Search for B2C Commerce automatically reformulates queries that return poor or irrelevant results to show more relevant products. The feature activates after provisioning and requires no admin configuration.

## When Agentic Query Rewrite Runs

Agentic Query Rewrite is useful for emerging trends, specialty terminology, and long-tail phrases that the AI model doesn't handle well.

For example, a shopper searches for "glazed donut nails" (a trending nail aesthetic). The query doesn't match product titles or attributes. Agentic Commerce Search recognizes the weak result set, rewrites the query to "sheer gloss nail polish," and caches the improved results. Subsequent searches return the better match immediately.

## How Agentic Query Rewrite Refines Results

- A shopper submits a query.
- Agentic Commerce Search evaluates the top results for keyword match quality and relevance.
- Strong results return without a rewrite.
- Poor results trigger a background rewrite.
- The first shopper sees the original results while the rewrite runs.
- Subsequent shoppers see the improved results from the cache.

Salesforce manages the cache duration. To adjust the default period, contact your Salesforce account team.

## Influencing Agentic Query Rewrite Quality

Agentic Query Rewrite doesn't expose direct configuration controls. However, complete product titles, descriptions, and attributes give the AI model stronger signals about product intent. You can also [manually create a merchandising rule](https://help.salesforce.com/s/articleView?id=cc.b2c_acs_create_rule.htm&release=264.0.0&type=5 "In Agentic Commerce Search for B2C Commerce, merchandising rules control product ranking, placement, and visibility for specific queries, categories, or catalog attributes. A rule can target a specific query or category, or apply globally across all searches.") and select Query Rewrite as the action type to override the automatic rewrite for a specific query.