← All projects
Project — 01 / 09Agentic AI · 2026

FloatChat

A self-hosted, omnichannel customer-support platform built on Chatwoot 4.13, with a multi-agent AI layer that answers customers from the knowledge base, hands off to humans when it can't, and learns new FAQs from resolved conversations.

Ruby on Rails 7.1Vue 3ai-agentsruby_llmOpenAI GPT-4.1PostgreSQLpgvectorRedisSidekiqDocker
Illustrative cover image for the FloatChat case study

01The problem

Support teams answer the same questions across live chat, email, WhatsApp and social channels. They needed AI that resolves routine questions from the company's own knowledge, hands everything else safely to a human, and keeps improving — on a platform they host and fully control.

02How it works

01

A customer message arrives

A customer writes in on any channel — live chat, email, WhatsApp, social or SMS — and the conversation sits in the pending (bot) state.

02

The listener queues a job

CaptainListener checks that the inbox has an AI assistant attached and queues the reply job on Sidekiq.

03

The orchestrator decides

The orchestrator assistant reads up to 30 messages of history and either answers or hands off to the right scenario agent.

04

Agents use tools

Agents call tools such as faq_lookup (pgvector semantic search), add labels, update priority or leave private notes for the team.

05

Reply or human handoff

The answer is posted to the customer — or the chat leaves bot mode, gets an activity note and is auto-assigned to an agent with free capacity.

06

Learning from resolved chats

After a conversation is resolved, a job mines it for new FAQ entries, saved as pending for review and de-duplicated against approved ones.

03What I built

  • Set up FloatChat as a rebranded, self-hosted fork of Chatwoot 4.13 — Rails 7.1, Vue 3, PostgreSQL, Redis / Sidekiq, deployed with Docker.
  • Brought the Captain AI agent system into the core app and enabled the v2 multi-agent flow behind the captain_integration_v2 flag, orchestrated with the ai-agents gem and ruby_llm.
  • Configured an orchestrator assistant that hands off to admin-defined scenario agents using 7 built-in tools — FAQ lookup, human handoff, resolve, private and contact notes, labels and priority — capped at 8 handoffs, 12 tool calls and 30 messages of history per run.
  • Set up the RAG knowledge base: crawled websites and uploaded PDFs are turned into Q&A pairs, embedded with text-embedding-3-small and searched with pgvector (1536-dim, cosine similarity).
  • Enabled the learning loop — resolved conversations are mined for new FAQ entries, saved as pending for review and de-duplicated against approved ones.
  • Hardened agent runs with an LLM timeout guard, history truncation, a Redis run registry that prevents duplicate replies and repeated tool actions, and a run logger.
  • Made models configurable per assistant (GPT-4.1 by default), with provider mapping for OpenAI, Anthropic, Google, Mistral and DeepSeek.

04Key features

Omnichannel inbox

Chat, email, Facebook, Instagram, X, WhatsApp, Telegram, Line and SMS in one place.

AI auto-replies

Answers routine questions from the knowledge base on any inbox with an assistant.

Safe human handoff

Hands over to a person when the AI can't help, with an activity note and auto-assignment.

Self-learning FAQs

Turns resolved conversations into reviewed, de-duplicated FAQ entries.

Copilot for agents

Helps human agents search conversations, contacts and Help Center articles with 6 read-only tools.

One-click AI tasks

Summarise a conversation, suggest replies, rewrite text and suggest labels.

Any LLM provider

Model, provider and temperature set per assistant — OpenAI, Anthropic, Google, Mistral or DeepSeek.

05Challenges & solutions

ChallengeA slow or hanging LLM call could block the reply queue.
SolutionAdded an LLM timeout guard so slow model calls fail fast instead of stalling Sidekiq workers.
ChallengeJob retries could post the same reply twice or repeat a tool action.
SolutionAdded a Redis run registry that tracks each run and prevents duplicate replies and repeated tool actions.
ChallengeLong conversations push past model context limits and cost budgets.
SolutionTruncated history and messages, and capped each run at 8 handoffs, 12 tool calls and 30 messages.
ChallengeHard to see what an agent did and why.
SolutionAdded a run logger that records every agent run for tracing and debugging.

06Impact

7Built-in agent tools, plus custom HTTP tools
9+Channels in one inbox — chat, email, WhatsApp, social, SMS
8 / 12Handoff & tool-call safety limits per run
AutoHuman handoff to an agent with free capacity