Back to Admin

Chatbots

How the Support, Sales, and Estimate chatbots work — features, flows, settings, and configuration.

Overview

RFS Hub includes three AI-powered chatbots, each serving a different purpose. All chatbots are powered by Google Gemini and can be customized through the admin Settings page. They are accessible as full-page web apps and can be embedded into your main website via iframes.

ChatbotURLPurpose
Support/supportAnswers customer support questions using the knowledge base. Can look up customer accounts, create support tickets, and collect satisfaction ratings.
Sales/salesAnswers pre-sales questions about services, pricing, and capabilities using the sales knowledge base.
Estimate/estimateGuides customers through a structured flow to generate instant security system estimates with detailed pricing.

How Chatbots Work

All three chatbots follow a similar technical pattern:

  1. User sends a message — The message is sent to the server API.
  2. Knowledge base search — The system searches the relevant knowledge base for matching articles.
  3. AI prompt construction — A system prompt is built that includes the business context, knowledge base results, conversation history, and any specific instructions configured in Settings.
  4. Gemini AI generates a response — The AI produces a response that is streamed back to the user in real time (you see words appearing as the AI generates them).
  5. Response parsing — The system extracts any special tags from the response (such as quick-reply chips, quantity selectors, or answer data) and renders the appropriate UI.

The AI model used by each chatbot can be configured independently in Settings (e.g. gemini-2.5-flash or gemini-2.5-pro).

Support Chatbot

The Support Chatbot (/support) is designed to help existing customers with technical issues. It searches the support knowledge base to answer questions and can escalate to a human by creating a support ticket.

Support Chat Flow

The support chat follows these phases:

  1. Welcome — The chatbot displays a welcome message and quick-action chips (e.g., "Alarm System," "CCTV," "Access Control," "Intercom," "Other Issue").
  2. Quick Actions — If the user clicks a chip, it sends that topic as their first message.
  3. Chatting — The user describes their issue. The AI searches the knowledge base and provides answers. If the AI can't find an answer, it can optionally search the web (if enabled) and suggest the result for admin review.
  4. Ticket Creation — If the issue needs human attention, the user can create a support ticket directly from the chat.
  5. CSAT — After the conversation, the user is asked to rate their experience (1-5 stars).
  6. Ended — The session is complete.

Customer Verification

The Support Chatbot can verify customer identity by extracting information from the conversation. It looks for:

  • Email address — Matched against the customer database.
  • Account number — Matched against property records.
  • Address — Matched against property addresses.

When a customer is verified, the AI can provide account-specific information and the ticket will be linked to their customer record.

Ticket Creation from Chat

When the chat triggers ticket creation, a form appears with these fields:

FieldRequiredDescription
NameYes (if not verified)Customer name. Pre-filled if the customer was verified during chat.
EmailYes (if not verified)Customer email. Pre-filled if verified.
PhoneNoCustomer phone number. Pre-filled if available.
SubjectYesA short summary of the issue (max 60 characters). The AI may suggest a subject based on the conversation.

The full chat transcript is automatically attached to the ticket, so the support team has full context. The AI generates a summary of the conversation for the ticket description.

Customer Satisfaction (CSAT)

After the conversation, customers can rate their experience on a 1-5 star scale. This rating is stored with the chat session and can be used to track support quality. If the user provides a rating below 3, they can also leave text feedback explaining why.

Support Chatbot Settings

Configure the support chatbot in Settings → Support. Key settings include:

  • Chat Enabled — Toggle the chatbot on/off.
  • Welcome Message — The initial message shown to users.
  • System Prompt — Instructions that tell the AI how to behave, what tone to use, and what it can/cannot do.
  • AI Model — Which Gemini model to use.
  • Quick Actions — The chip buttons shown at the start of a conversation.
  • Web Search — Whether the AI should search the web when the KB has no answer.
  • Self-Learning — Whether web search results should be saved for admin review.
  • Escalation Keywords — Words that trigger ticket creation suggestions.
  • Max Message Length — Maximum character count for user messages.

Sales Chatbot

The Sales Chatbot (/sales) helps potential customers learn about your services, pricing, and capabilities before making a purchase decision.

Sales Chat Flow

  1. Welcome — Displays a sales-oriented welcome message and quick-action chips.
  2. Chatting — The user asks questions. The AI searches the sales knowledge base and responds with relevant information about your services.

The sales chatbot uses the sales knowledge base (separate from the support KB) which contains FAQ entries about your products, services, pricing, and capabilities.

Sales Chatbot Settings

Configure in Settings → Sales:

  • Welcome Message — The initial greeting.
  • System Prompt — Instructions for the sales AI persona.
  • AI Model — Which Gemini model to use.
  • Sales Prompts — Pre-configured prompt templates that provide the AI with knowledge about your business.
  • Max Message Length — Maximum characters per message.

Sales chat does not save conversations to the database; each page refresh starts a new session. For troubleshooting or account-specific help, direct users to the Support Chatbot; for pricing estimates, to the Estimate Chatbot.

Sales vs Support Chatbot

FeatureSalesSupport
PurposeProduct inquiriesTroubleshooting
Knowledge BaseSales KBSupport KB
SessionNo (browser only)Yes (server-side)
Customer verificationNoYes
Ticket creationNoYes
CSAT ratingNoYes
Self-learningNoYes
Web search fallbackYesYes
EmbeddableYesYes

Estimate Chatbot

The Estimate Chatbot (/estimate) is the most complex chatbot. It guides customers through a structured, step-by-step flow to generate a detailed security system estimate with product recommendations and pricing.

Estimate Chat Flow

The estimate flow progresses through four phases:

  1. System Selection — The customer chooses what type of system they need (e.g., alarm, CCTV, access control). This determines which category of questions they'll be asked.
  2. Requirements — The chatbot asks detailed questions about the customer's needs — number of cameras, doors, sensors, installation type (new or upgrade), etc. Each question is a defined "flow step."
  3. Contact — The customer provides their name, email, and phone number.
  4. Confirmation — The system shows a preview of the estimate with line items and pricing. The customer reviews and confirms to generate the final estimate.

How the Flow Engine Works

The estimate chatbot uses a deterministic state machine powered by flow steps and transitions:

  • Flow Steps — Each step defines a question, the input type (choice, number, text, quantity selector), and available options. Steps are configured in Settings → Estimate → Chat Flow.
  • Transitions — Rules that determine which step comes next based on the customer's answers. For example, if a customer selects "CCTV," the next step might ask about camera count. Transitions use condition expressions.
  • Answers — Each customer response is saved as a key-value pair (e.g., camera_count=8). These answers are used to evaluate transition conditions and product rules.

The AI doesn't decide what question to ask next — that's determined by the flow transitions. The AI's role is to present the question in a natural, conversational way and extract the structured answer from the customer's response.

Quantity Selectors

For questions where the customer needs to select products with quantities (e.g., choosing camera models and how many of each), the chatbot shows a special quantity selector UI. This displays product cards with +/- buttons for setting quantities. Products shown in the selector are configured in Settings → Estimate → Selectors.

Estimate Generation

Once all required questions are answered, the system generates an estimate by:

  1. Evaluating product rules — Rules determine which products to include and in what quantities based on the customer's answers. For example: "If installation=new AND camera_count > 4, add CAT6-CABLE with quantity CEILING(camera_count/2)."
  2. Calculating pricing — Unit prices, installation costs, and monthly fees are looked up from the product catalog.
  3. Applying tax — HST at 13% is applied to applicable items.
  4. Generating the estimate document — A formatted estimate with the estimate number (e.g., EST-12345678), line items, totals, and any relevant notes.

After the Estimate

Once an estimate is generated, the customer can:

  • View the estimate — See the full estimate with all line items and pricing.
  • Email the estimate — Have the estimate sent to their email address as a link.
  • Request a site visit — If the project requires an on-site assessment.
  • "I Also Need..." — Start a new estimate for a different system category while keeping their contact information.

Estimate Chatbot Settings

The estimate chatbot has extensive configuration in Settings → Estimate:

  • Categories — System types available for estimates (alarm, CCTV, access control, etc.).
  • Products — The product catalog with pricing, SKUs, and descriptions.
  • Selectors — Products available in quantity selector UIs.
  • Chat Flow — The flow steps (questions) and transitions (routing logic).
  • Rules — Product rules that determine what gets added to an estimate based on answers.
  • Notes — Conditional notes that appear on the estimate document.
  • Knowledge Base — Estimate-specific KB articles for the AI to reference.
  • AI Model & Prompts — Model selection and system prompt configuration.
  • Integrations — QuickBooks Online connection for syncing estimates.

Embedding Chatbots

Chatbots can be embedded on your website using iframes. Content Security Policy (CSP) headers allow framing from redflagsecurity.ca; other domains may be blocked. Use your actual deployment URL and the chatbot path (/support, /sales, or /estimate).

<iframe
  src="https://your-app-url.vercel.app/sales"
  width="400"
  height="600"
  style="border: none; border-radius: 12px;"
  title="RedFlag Security Sales Chat"
></iframe>

The chatbot is responsive to iframe dimensions. No authentication is required for embedded usage.

Quick Action Chips

Quick action chips are the clickable buttons shown at the start of a chat conversation (e.g., "Alarm System," "CCTV," "Access Control"). When a user clicks a chip, it sends that text as their first message, helping guide the conversation.

Chips are configured in Settings → Support → Quick Actions as a JSON array. Each chip has an id, label (display text), and optionalicon. The AI can also include chips in its responses to suggest follow-up questions.