Search & Recovery
Placements 01 and 02 — put an Ask AI entry point in the storefront search bar, and recover zero-result searches with a guided Sophi panel instead of a dead end.
Meet shoppers at the highest-intent moment of the journey — the search bar — and catch them again when search fails.
Search Integration
01 · SearchFrom keyword search to conversational discovery. An Ask AI entry point embedded inside or next to the search bar lets shoppers express complex needs in their own words, turning search into a guided shopping entry point instead of a keyword lottery.
It earns its place on the queries keyword search handles worst — "a waterproof jacket for hiking in spring" is three constraints and a use case, which a keyword index reduces to "jacket".
Hand the text already in the input straight to the assistant rather than running a keyword search with it:
// Open Sophi with the shopper's query instead of running a keyword search
askAiButton.addEventListener('click', () => {
if (!widget.isReady()) return;
widget.show();
widget.sendTextMessage(searchInput.value);
});sendTextMessage posts a message to the iframe and returns void — it is not a
promise, so there is nothing to await.
SDK reference
widget.sendTextMessage(query)— sends the shopper's query into the chat with no product context.widget.show()— reveals the widget iframe before handing over the query.widget.isReady()—trueonceinit()has resolved and the iframe element exists. Gate the Ask AI button on it.
Surface Ask AI as the escalation path, not as a replacement for the search button. Shoppers who know the product name are faster with keywords, and taking that away to promote the assistant makes the common case worse.
Post-Search Recovery
02 · Post-searchTurn zero results into guided discovery. When a search returns nothing — or few enough to be useless, say one to three hits — Sophi activates in the results area with alternative paths and popular items, so the session continues at the exact point it would otherwise end.
Render the recovery panel in your own results area, and let each suggestion hand its prompt to the assistant when the shopper picks one:
// Render the recovery panel when search comes back empty
if (results.total === 0) {
recoveryPanel.hidden = false;
}
// Each suggestion opens Sophi with the shopper's intent
recoveryPanel.addEventListener('click', (event) => {
const chip = event.target.closest('[data-sophi-prompt]');
if (!chip || !widget.isReady()) return;
widget.show();
widget.sendTextMessage(chip.dataset.sophiPrompt);
});Send the query from a shopper action, not from the zero-result render itself.
isReady() turns true as soon as init() resolves and the iframe element
exists — which is before the app inside the iframe has booted and can receive
messages. A message posted into that window is dropped silently, with no warning.
Waiting for a click is what makes the send reliably late enough.
SDK reference
widget.sendTextMessage(query)— seeds the recovery conversation with the shopper's chosen prompt.widget.isReady()—trueonceinit()has resolved and the iframe element exists. It does not mean the iframe app can accept messages yet.
Render the recovery panel below weak results rather than replacing them, so the shopper keeps whatever the search did find.
Next: On-Page Triggers — the floating trigger and homepage widget for always-on guidance.
Placement Guide
Where the Sophi assistant appears in your storefront — eight entry points across search, discovery, product, cart and checkout, and how to choose between them.
On-Page Triggers
Placements 03 and 04 — build a floating trigger that opens the assistant from any page, and a homepage banner widget that answers delivery and returns questions up front.