Conversational Search
The widget supports a conversational search mode that maintains context between successive searches, allowing natural refinement of results.
Activation
Conversational search requires enabling the AI assistant:
NeuroonWidget.init({
container: '#neuroon-search',
token: 'YOUR_TOKEN',
features: {
aiAssistant: true, // Enables conversational mode
},
});
The AI assistant is available on Growth plans and above.
How It Works
Session Context
The widget maintains a conversation history during the session:
User: "running shoes"
→ Results: athletic shoes
User: "Nike only"
→ Context: shoes + Nike
→ Results: Nike running shoes
User: "under $100"
→ Context: shoes + Nike + price < $100
→ Refined results
Natural Refinement
The assistant understands contextual references:
- Pronouns: "Do you have them in red?" → References displayed products
- Comparatives: "cheaper ones" → Refines price filter
- Specifications: "from Nike" → Adds brand filter
Chat Interface
The conversational chat is presented as an integrated panel in the widget:
- Appears when clicking the chat icon
- Shows conversation history
- Allows typing natural messages
- Shows "thinking" indicator while processing
Interface Features
| Element | Description |
|---|---|
| History | Last 10 interactions for relevance |
| Indicator | Shows when assistant is processing |
| Suggestions | Chips with suggested refined queries |
| Products | Inline results within the chat |
Inferred Filters
The assistant analyzes queries and extracts filters automatically:
| Query | Inferred Filters |
|---|---|
| "cheap Nike shoes" | Brand: Nike, Price: budget |
| "gaming laptop" | Category: gaming |
| "red dress size M" | Color: red, Size: M |
| "under 50 dollars" | Max price: $50 |
Confidence Indicator
Each response includes a visual confidence level:
| Range | Visual | Meaning |
|---|---|---|
| 90-100% | Green | Clear interpretation |
| 70-89% | Yellow | Good inference |
| 50-69% | Orange | May need confirmation |
| <50% | Gray | Ambiguous query |
When confidence is high, filters are applied automatically. With low confidence, the assistant asks for clarification.
Session Persistence
History is saved in sessionStorage during the browser session:
- Restored on page reload
- Cleared when browser closes
Configure Persistence
NeuroonWidget.init({
features: {
aiAssistant: true,
},
persistence: {
chat: false, // Disable persistence (default: true)
},
});
Responding to Searches
To execute logic when the user searches (including conversational searches), use the onSearch callback:
NeuroonWidget.init({
features: {
aiAssistant: true,
},
callbacks: {
onSearch: (query) => {
console.log('User searched:', query);
// Analytics
gtag('event', 'search', {
search_term: query,
});
},
},
});
Callbacks are the only way to respond to widget events. See the callbacks documentation for all available options.
Customization
Translations
NeuroonWidget.init({
translations: {
chat: {
placeholder: 'What are you looking for?',
send: 'Send',
thinking: 'Thinking...',
newConversation: 'New conversation',
suggestions: 'Suggestions',
},
},
});
Styles
.neuroon-widget {
/* Chat panel */
--nrn-chat-bg: 30 41 59;
--nrn-chat-user-bg: 59 130 246;
--nrn-chat-assistant-bg: 51 65 85;
}
Best Practices
- Limited context: History is limited to 10 interactions for relevance
- Visual indicators: Show when assistant is "thinking"
- Fallback: If it doesn't understand, offer manual filters
- Optional persistence: Disable if context shouldn't persist
Next Steps
- AI Assistant - More about guided filters
- Callbacks - Respond to widget events