Website Chat (Sam)¶
Overview¶
The Website Chat is a floating chat widget on scottrecycling.com powered by the AI assistant "Sam." Built on the sr_website_chat module, the widget lets website visitors ask questions about e-waste recycling, learn what materials Scott Recycling accepts, get pricing information, schedule pickups through conversation, and leave messages for staff. The chat connects to an external Node.js backend via WebSocket for real-time AI responses.
Last Updated: February 2026 Target Audience: Admins, Website Managers
How It Works¶
The chat widget is injected into every page of the Scott Recycling website through a website template. It works as follows:
- A floating chat button appears in the bottom-right corner of every page
- When a visitor clicks the button, a chat window opens
- The visitor types a message and Sam responds in real time via WebSocket
- The conversation persists across page navigation -- if the visitor moves to a different page, the chat history stays intact
- Sam can answer questions, provide materials information, guide visitors through scheduling a pickup, or take a message for staff
Features¶
| Feature | Description |
|---|---|
| Real-Time AI Chat | Instant responses powered by the AI backend, delivered over WebSocket |
| Pickup Scheduling | Sam can walk visitors through scheduling an e-waste pickup via conversation |
| Materials Information | Answers questions about what materials Scott Recycling accepts and any associated fees |
| Staff Messaging | If Sam cannot resolve a request, the visitor can leave a message for a staff member |
| Persistent Conversations | Chat history is maintained as the visitor navigates between pages |
| Mobile Responsive | The widget adapts to mobile screen sizes automatically |
Configuration¶
The chat widget connects to an external backend service. The connection URL is configured through an Odoo system parameter:
| Parameter | Value | Description |
|---|---|---|
sr_chat.ws_url |
wss://ai.scottrecycling.com/chat/ws (production) |
WebSocket URL for the chat backend |
To update the WebSocket URL:
- Navigate to Settings > Technical > Parameters > System Parameters
- Search for
sr_chat.ws_url - Update the value to the desired WebSocket endpoint
- Save -- the change takes effect on the next page load
Architecture Notes¶
The sr_website_chat module is a frontend-only integration. There are no backend models, database tables, or Odoo business logic involved. The module consists of:
- A website template that injects the chat widget JavaScript and CSS into every page
- JavaScript that manages the WebSocket connection, chat UI, and message rendering
- CSS for the floating button and chat window styling
All AI processing, conversation management, and message storage happen on the external Node.js backend at ai.scottrecycling.com.
Tips¶
Test the chat after configuration changes
After updating the WebSocket URL or redeploying the website, open scottrecycling.com in an incognito window and test the chat to confirm it connects and responds correctly.
Check the backend service if chat is unresponsive
If visitors report that the chat widget is not responding, the issue is likely with the external Node.js backend service rather than the Odoo module. Check the backend server logs at ai.scottrecycling.com.
Questions? Contact your supervisor or refer to the AI & Automation overview.