AI Auto-Reply

Power your chat widget with an AI agent built on Gemini, GPT-4o, or Claude. Train it on your own pricing page, FAQ, and uploaded documents via the Knowledge Base, write custom instructions, and let it answer common questions 24/7. Hand off to a human the moment you reply.

Setup

  1. Go to Dashboard → Chat Settings → AI Agent
  2. Toggle AI Auto-Reply on
  3. Pick a model (Gemini, GPT-4o, or Claude - see below)
  4. Paste your API key for that provider
  5. Write your Agent Instructions (or choose a preset template)
  6. (Optional) Open the Knowledge page to add URLs, notes, or upload PDF/DOCX files the AI should know about
  7. Set max replies per conversation
  8. Save settings

Model Selection

FloatMessage supports six models from three providers. Switch between them anytime — you bring your own API key so usage costs stay transparent.

ModelProviderNotes
gemini-2.5-flash-liteGoogleCheapest, high-volume chat
gemini-2.5-flashGoogleFast general-purpose
gemini-2.5-proGoogleMost capable Gemini model
gpt-4o-miniOpenAIFast and affordable
gpt-4oOpenAIMost capable OpenAI model
claude-haiku-4-5AnthropicFast and affordable
claude-sonnet-4-5AnthropicMost capable Claude model

Get an API key from Google AI Studio, OpenAI Platform, or Anthropic Console. The key is stored encrypted and used only to call the model on your behalf — FloatMessage doesn't see any token usage stats.

Knowledge Base

The Knowledge Base is what your AI agent “knows” about your business beyond its core instructions. Three item types live in one list at Live Chat → Knowledge:

  • URL — Paste any public page (pricing, FAQ, docs). FloatMessage scrapes the main content and re-fetches it daily. Stale entries are auto-refreshed on the next AI reply that needs them.
  • Note — Free-text content you write directly. Best for short, structured snippets like return policies or holiday hours.
  • File — Upload a PDF, DOCX, TXT, or Markdown file (max 5 MB). FloatMessage extracts the text in your browser and stores it alongside the original.

Auto-generated bootstrap

When you add a new domain, FloatMessage scrapes its front page and asks Claude Haiku to summarize it into 3–5 FAQ-style notes — so your agent has something useful to say from the very first visitor message. You can also trigger this from the dashboard with “Auto-generate from my site”.

Plan limits

PlanKnowledge items per domain
FREE10
PRO30
ENTERPRISE100

What gets sent to the AI

Every enabled item is concatenated in dashboard order and prepended to the AI's system prompt as a Knowledge Base block. URLs are clearly labeled with their source link so the model can cite them; notes and files use their title only. Total knowledge size is capped at ~240,000 characters — items past the cap are dropped from the bottom.

Toggle individual items off (eye icon) to keep them around without including them in AI context — useful when running short A/B tests on instruction quality.

URL scraping details

FloatMessage extracts clean text only — no images, no scripts, no styles. The extractor:

  • Removes <script>, <style>, navigation, footer, and ad markup.
  • Prefers the <article> or <main> element if present, falls back to <body>.
  • Collapses whitespace and strips empty lines.
  • Truncates each page to ~5,000 characters (the most-relevant section near the top wins).
  • Stores the source URL alongside the content so the AI knows what each chunk represents.

Failed scrapes (4xx/5xx, timeouts) keep the previous content available and stamp the row with the error so you can fix or remove the URL — the rest of your knowledge keeps working. Use Re-scrape URLs to force fresh fetches after publishing updates.

Agent Instructions

Instructions tell the AI what to do, how to behave, and what information to share. Be specific about your product, tone, and boundaries. FloatMessage provides preset templates for common use cases:

Coupon / Promotion
Customer Support
Lead Generation
Product Recommendations
Event / Webinar Promotion
Appointment Booking
Onboarding Guide
Feedback Collector
Real Estate Agent
Restaurant / Menu Helper
SaaS Trial Conversion
E-commerce Shopping Assistant
Course / Education Advisor

Max Interactions

Set a limit on how many AI replies per conversation (default: 10). After this limit, the AI stops replying and you can take over manually from the dashboard.

Admin Takeover

When you send a manual message from the Dashboard chat, AI auto-reply is automatically disabled for that conversation. This prevents the AI from interfering while you're personally handling the conversation.

  1. Visitor sends a message → AI auto-replies as configured
  2. You open the conversation in Dashboard → Live Chat
  3. You type and send a reply manually
  4. AI auto-reply is permanently disabled for this conversation
  5. All future visitor messages in this conversation go only to you

This is a per-conversation setting. Other conversations with the same visitor (or other visitors) continue to use AI auto-reply normally.

Tip: When the AI hands off to you and the issue needs follow-up, click the 3-dot menu in the chat header and choose Create Ticket. The conversation becomes a tracked ticket with status, internal notes, and file attachments. See Tickets.

Instruction Sources

ModeDescription
Static OnlyUses the instructions you write in the dashboard
Webhook OnlyFetches dynamic instructions from your server for each conversation
Webhook + FallbackTries webhook first, falls back to static instructions if webhook fails

Webhook Configuration

When using Webhook or Webhook + Fallback mode, your server receives visitor context and returns personalized instructions.

Webhook Payload

POST your-webhook-url
Headers:
  Content-Type: application/json
  X-FloatMessage-Signature: sha256=<hmac>

Body:
{
  "event": "conversation.instructions",
  "conversationId": "abc123",
  "visitor": {
    "id": "vis_xyz",
    "name": "John",
    "email": "john@example.com",
    "country": "US",
    "city": "San Francisco",
    "userAgent": "Mozilla/5.0...",
    "pageUrl": "https://example.com/pricing",
    "customData": {
      "userPlan": "enterprise"
    }
  }
}

Expected Response

{
  "instructions": "You are a VIP support agent...",
  "maxInteractions": 20
}

Webhook Security

Optionally set a Webhook Secret to verify requests. FloatMessage signs the payload with HMAC-SHA256 and sends the signature in the X-FloatMessage-Signature header.

Client-Side Variables

Collect JavaScript variables from the visitor's browser to send to your webhook. For example, window.userPlan or myApp.user.tier. These values appear in the webhook payload under visitor.customData.

Template Variables

Personalize AI instructions per visitor using ${variableName} placeholders. These are replaced with real visitor data before the AI generates a response.

Built-in Variables

These are automatically collected for every visitor — no configuration needed.

VariableSourceExample
${country}Cloudflare geolocationUS
${city}Cloudflare geolocationSan Francisco
${userAgent}Browser User-Agent headerMozilla/5.0...
${pageUrl}Current page URLhttps://example.com/pricing
${visitorName}Pre-chat form (if enabled)John
${visitorEmail}Pre-chat form (if enabled)john@example.com

Custom Variables

You can collect custom data from the visitor's page in two ways:

1. Dashboard Configuration

Add JavaScript variable paths in Chat Settings → Template Variables → Custom Variables. The embed script reads these from the visitor's page automatically. The last segment of the path becomes the variable name.

// If you configure: window.userPlan
// And your page has:
window.userPlan = "enterprise";

// Then in your AI instructions you can write:
"The visitor is on the ${userPlan} plan. Tailor your response accordingly."

2. JavaScript API (Programmatic)

Use FloatMessage.setCustomData() to pass custom data programmatically. This is useful when the data isn't available as a simple window variable, or when it changes dynamically. Requires the JavaScript API to be enabled.

// Pass any key-value pairs
FloatMessage.setCustomData({
  userPlan: "enterprise",
  cartTotal: "249.99",
  accountAge: "2 years"
});

// These become available as template variables:
// ${userPlan}, ${cartTotal}, ${accountAge}
// And in webhook payload as visitor.customData

You can call setCustomData() at any time. It merges with any variables already collected from the dashboard-configured paths and sends the updated data to the server immediately.

Example: Personalized AI Instructions

You are a support agent for MyStore.com.

The visitor is from ${city}, ${country}.
They are on the ${userPlan} plan with a cart total of $${cartTotal}.

If they are on the "free" plan, mention our Pro upgrade.
If their cart is over $100, offer free shipping with code FREESHIP.
Be friendly and concise.

Note: If a variable has no value (e.g. the visitor's browser doesn't have window.userPlan set), the placeholder stays as-is in the instructions — the AI will see the literal ${userPlan} text.