AI Chatbot & Live Chat - Customizable Roles
This module adds a floating, context-aware AI chat assistant to your Drupal site, catering to different users like staff, clients, and visitors. It allows for custom prompts, visibility rules, and budget controls for each chat, with an option to escalate issues into support tasks.
Your team, the clients who sign in and the visitors who do not all want to talk to you. Multi-Role AI Chatbot puts them behind one floating button, each audience with its own prompt and visibility rules, and every conversation in an inbox your operators work from inside Drupal, with a person ready to take over when the assistant reaches its limit.
The day you install it you already have a human live chat that needs nothing else. Add a Google Gemini key of your own, or connect the site to the Central Connect AI service, and the AI chats wake up on the same panel.
What you get
AI chats
- A staff console. Grounded in a prompt template, a project-context file and allow-listed read-only database areas; with AI Ticket Chat installed its idea cards become tasks.
- A clients chat scoped to their own records. Own prompt, suggestion chips and a knowledge base of uploaded text files; on the Anthropic path a
query_user_datatool reads only the signed-in user's own rows in the areas you allow. - An anonymous chat that reads nothing of yours unless you allow-list an area for it, plus any number of custom chats in AI or human mode, each with its own tab, prompt, branding and visibility.
Human live chat and inbox
- A human chat with no AI in it. Staffed by the roles and users you choose; when an AI chat also applies, a chooser asks the visitor which to open.
- Handover to a person. The visitor presses a button or the model signals that a human is needed; everyone with the claim permission gets an email.
- An operator inbox. Live, previous and archived threads, claim and reply with attachments, tags, notes, lock, archive, bulk purge, a private chat between colleagues, and a chime when a visitor is waiting.
Operations
- Learnings from real conversations (with the service connected). A scan distils what visitors keep asking into a queue; you apply a learning to an audience's prompt or turn it into a suggested task.
- Thirteen notifications in the suite bell. Negative feedback, a spike, an unclaimed handover, an overdue reply, an exhausted budget and more.
- Per-bot switch, model and monthly budget in the cost modal; the budget is enforced from the service's spend figures and steps aside when it cannot be reached.
How it works
The widget is injected at the bottom of every page whose visitor matches an audience's roles and path patterns. The human chat routes each message to the board, the Gemini provider calls Google directly with your key, and the default Anthropic provider relays the turn through the Central Connect AI gateway, which holds the provider key, picks the model and meters the cost. Conversations, messages and learnings are content entities; attachments are managed files.
Administration » Configuration » Multi-Role AI Chatbot Settings (/admin/multi-role-ai-chatbot/ajustes) has one tab per chat plus Logs and Permissions; the module's own entry in the administration menu opens the board at /admin/multi-role-ai-chatbot.
Free, and what the optional service adds
Without connecting to anything you get the human live chat and human-mode custom chats, the whole operator inbox, handover emails, bell notifications, visibility rules, branding, knowledge-base files, ratings and prompt-injection heuristics. The Gemini provider is free too: with your Google key in settings.php every AI chat answers directly from Google, without the clients data tool or cost metering.
The optional service adds the Anthropic-backed replies, the query_user_data tool, per-bot budgets and model billing, the learnings scan, AI tag suggestions and prompt drafting, and, once the site is connected, the licence that switches the AI audiences on, allows more than one human-mode chat and, when the licence counts seats, the operator inbox for the people you list. It is operated by a provider — the sponsor's Central Connect AI, or any provider exposing the same API — and you connect it yourself from the SDK settings page; before that step nothing is sent to the service; the module's other outbound calls are listed under Privacy and security. A locked feature shows a plain notice with a call to action, never a broken screen, and if the service is unreachable the module falls back to the free tier.
Use cases
- Agency support desk. Clients ask about their own orders and invoices and reach your operators with one button.
- Public visitor help with a person behind it. The anonymous chat answers from its prompt; an unclaimed handover rings the bell.
- Department chats. A Sales chat and a Billing chat, each with its own tab, prompt and audience.
Getting started
- Run
composer require drupal/multi_role_ai_chatbotand enable the module; Central Connect AI SDK and Session Limit are pulled in. - On People » Permissions grant
use ai ticket chat,use clients ai ticket chat,use anonymous ai ticket chatandadminister ai ticket chat, plus the board permissions listed on the Permissions tab. - Open the settings page and switch on the human chat: who staffs it, its welcome message, where it appears. Open the board to attend the first visitor.
- For AI replies, add
$settings['multi_role_ai_chatbot.gemini_api_key']tosettings.phpand pick the Gemini provider, or connect the site to the service from the SDK settings page; then enable the clients and anonymous chats and write their prompts.
Requirements
- Drupal 11.1 or newer, and the PHP version it requires (8.3); core modules User and File.
- Central Connect AI SDK and Session Limit, both required.
- For AI replies: a Google Gemini key in
settings.php, or a connection to the Central Connect AI service (there is no local Anthropic key). - Optional: AI Ticket Chat, Commerce for the orders and invoices areas, Locale for the shipped Spanish translation.
Privacy and security
- Conversations, messages and learnings are content entities on your site, and attachments are ordinary managed files; nothing about a conversation is written to configuration.
- API keys, read tokens and service credentials live in
settings.phpor State, never in exported configuration, and secrets are stripped from replies; every state-changing route requires the CSRF request header token, sending, typing, sessions and ratings are flood-limited, and uploaded images are checked for MIME type and size. - The clients chat reads only the signed-in user's own rows through allow-listed areas and entity access; the anonymous chat reads no data unless you allow-list read-only areas for it.
- Anonymous visitors are recognised by a long-lived cookie; there is no automatic retention window yet, so operators delete threads or purge non-locked ones in bulk.
- External calls: the connected service on every AI turn; Google on every AI turn when a Gemini key is set; the staff console's prompt template, refreshed at most hourly from a URL you can change (by default a repository address of the sponsor, set in the AI Ticket Chat settings); the tree of a repository you configure, read from GitHub as staff-chat context; and the legacy Monday.com sign-in only when an administrator starts it.
Part of the Central Connect AI suite
The suite shares one header, one bell and one optional connection to a central service. Central Connect AI SDK is required: it provides the header, bell, cost modal and gateway client. AI Ticket Chat (optional) gives the staff console its task board and suggests department chats; Web Health Status (optional) lends the settings page its dashboard library for the subscription card.
Similar projects and how this one differs
- AI and its AI Chatbot submodule are a provider-agnostic framework with an assistants front end; this module is one widget with fixed audiences, a human inbox and handover.
- Custom AI Chatbot is a chatbot block calling several providers with your own key; it does not describe an operator inbox, handover or per-audience prompts.
- AI Content Chat answers from indexed site content; this module answers from prompts, knowledge-base files and the user's own records, and a person can take over.
- Tawk.to and LiveChat embed an external live-chat service; here the human chat is staffed by your Drupal users and every thread is stored on your site.
- AI Ticket Chat is the ticket board of the same suite; this module is the chat that talks to visitors and hands work over to it.
Development
Parts of this module were written with the assistance of AI-based coding tools, as required by the policy on the use of AI when contributing to Drupal. All the code has been read, corrected, tested and is maintained by the human maintainer listed below, who takes full responsibility for it.
Maintainers and sponsor
Maintained by pedroromán and sponsored by Tangram Consulting, which also operates the reference Central Connect AI service. Issues, ideas and contributions are welcome in the issue queue.
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Releases
| Version | Type | Core | Release date | |
|---|---|---|---|---|
| 1.0.x-dev | Dev | 10–11 | Jun 29, 2026 |