This project is a comprehensive customer support solution featuring Clara, an AI-powered chat widget. It can be embedded on any website to provide instant assistance to users. The system is designed to handle user queries, escalate issues to a support team via Slack, and provide a seamless integration experience for developers.
The backend is powered by the Siren AI Agent Toolkit, which is used to orchestrate complex, multi-step workflows and perform actions like sending notifications:
- Chat Behavior: The Siren Chat Node manages the conversation with the user. When it determines that human intervention is required, it triggers a workflow using the AI Agent Toolkit.It defines how the bot interacts with users and when to escalate to a human agent.
- Slack Notifications: The chat workflow sends a detailed notification to a designated Slack channel, allowing the support team to see the user's query and respond.
- Email Notifications: Siren is also used to send transactional emails. For example, when a support ticket is resolved, a webhook from Siren notifies the backend, which in turn sends an automated email to the user to inform them of the resolution.
The project is a monorepo composed of three main parts:
platform/agent
: The backend service (Node.js/Express).platform/client
: The frontend application/dashboard (Next.js).mock-ui
: A mock user-facing website to demonstrate the chat widget.
- Embeddable Chat Widget: A self-contained chat widget that can be easily added to any website.
- AI-Powered Support: Clara, the AI bot, provides intelligent responses to user queries.
- Email Capture: Automatically detects and saves user email addresses provided in the chat.
- Slack Integration: Escalates complex queries to a support team in a designated Slack channel.
- Real-time Updates: Uses SSE to push messages from the server to the chat widget in real-time.
- Easy Configuration: A simple dashboard for getting the widget embed code and configuring integrations.
Follow these steps to get the project running locally.
- Node.js and npm (or yarn/pnpm).
- Access to Siren and an API Key.
- An OpenAI API Key.
You will need to create a .env
file in the platform/agent
directory with the following variables:
SIREN_API_KEY=your_siren_api_key
SIREN_API_BASE_URL=https://api.siren.io
OPENAI_API_KEY=your_openai_api_key
# Siren Workflow Configuration
CHAT_WORKFLOW_NAME="Siren Agent Chat"
CHAT_WORKFLOW_SLACK_CHANNEL="#support-alerts"
CHAT_NODE_ID="chat-user-message"
-
Install root dependencies (if any, for monorepo tools):
npm install
-
Install Backend dependencies:
cd platform/agent npm install
-
Install Frontend dependencies:
cd platform/client npm install
-
Start the Backend Server:
- Navigate to the backend directory and run the start command.
- The server will run on
http://localhost:3001
.
cd platform/agent npm run dev
-
Start the Frontend/Client Application:
- Navigate to the client directory and run the start command.
- The client dashboard will be available at
http://localhost:3000
.
cd platform/client npm run dev
-
View the Mock UI with the Chat Widget:
- Simply open the
mock-ui/index.html
file in your web browser. - This page demonstrates the embedded chat widget connecting to the local backend.
- Simply open the
- Navigate to the client dashboard (
http://localhost:3000/integrations
). - Copy the script tag provided.
- Paste this script tag into the HTML of any website to embed the Clara support bot.