This project is not covered by Drupal’s security advisory policy.
A chat block for assistant-ui (React) that talks to Drupal's AI stack over a plain HTTP + Server-Sent Events endpoint.
Features
- Live tool-call output. With "Show each tool step" on, tool calls stream as they execute, showing the tool's actual result rather than a generic "Calling
<tool>" placeholder — including a per-tool progress message while it's still running. - File attachments, safely staged. Visitors can attach files from the composer. Bytes are staged in a private, per-user temp store and only become a permanent, managed Drupal file once the assistant actually uses it in its reply — anything staged but never used is cleaned up automatically, so nothing is left orphaned.
- @-mentions and content search. Typing
@opens a picker of content by title to point the assistant at something specific; the Search content tool lets it find content nobody pointed at, on its own. - Ask the editor. When the assistant can't decide for you — which paragraph type, which of three markets you meant — it stops and asks, with its options as buttons in the chat, rather than guessing.
- External tools (MCP). Offer tools hosted on external Model Context Protocol servers, authorized per user via OAuth. The connection and tool execution happen in the visitor's own browser; Drupal only stores the per-user connection state.
- Edit entities in place. With the optional Form bridge submodule, the assistant can read and propose changes to the entity currently open in an edit form — shown as a reviewable diff you approve before anything is written.
- Slash commands, starter prompts and follow-ups. Prompts from the site's prompt library show up as
/commands and empty-state suggestion buttons; an optional extra call can offer up to 3 follow-up prompts as chips after each reply. - Sidebar or inline placement. The default sidebar is collapsible, resizable (with a full-width snap point) and keyboard-summonable (
Cmd/Ctrl+K); anonymous visitors get a floating launcher instead of a toolbar button. Or render the chat directly in a block region instead. - Safe Markdown rendering. Replies render through
react-markdown, which escapes embedded HTML — model output can never inject markup into the page. - Native theming. Sidebar and panel chrome are styled against core's
default_admin/Gin design tokens, with plain-CSS fallbacks otherwise.
How it works
assistant-ui (useLocalRuntime) ──POST──▶ /api/assistant-ui/chat ▲ │ └────────── SSE, ui-message-stream ─────────┘
A whole turn — including every tool call the agent makes — runs inside one request. History is read from and written to AiAssistantApiRunner's existing private-tempstore storage, so nothing new is introduced there; the thread id round-trips in the request body and the X-Assistant-Thread-Id response header. Tool execution events from ai_agents are re-emitted as protocol frames, so a configured agent's tool calls show up live without any extra wiring.
Requirements
- Drupal ^11
- AI (
ai:ai,ai:ai_assistant_api) and AI Agents (ai_agents:ai_agents) — all hard dependencies. - At least one AI Assistant entity already configured. Creating one requires an AI Agent behind it —
ai_assistant_apicannot create an assistant without one.
ai_chatbot is not a dependency.
Installation
- Install as usual, e.g.
composer require drupal/ai_chatbot_assistant_ui, thendrush en ai_chatbot_assistant_ui. - Grant Use the AI Assistant UI chat to whichever roles may chat.
- Place the AI Chatbot (assistant-ui) block and pick a configured AI Assistant.
Tagged releases ship the compiled chat bundle, so installing is enough to run it. A git checkout or 1.0.x-dev does not — see "Building the frontend" below.
Optional submodules
- Form bridge — lets the assistant read and change the entity open in the current edit form, with human approval on every change.
- Docx Import — lets editors attach a
.docxfor the assistant to read, even without the core Media module enabled.
Building the frontend
The compiled bundle is committed under dist/ on tagged releases, so installing the module is enough to run it — no build step required at install time. To change the frontend itself, or to run from a git checkout / 1.0.x-dev:
npm install npm run build npm test
The frontend is bundled with esbuild; no framework build tooling runs on the Drupal side. Node ^20.19, ^22.18 or ≥24.11 is required.
Project information
- Project categories: Artificial Intelligence (AI)
1 site reports using this module
- Created by chr.fritsch on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
Releases
Development version: 1.0.x-dev updated 17 Nov 2026 at 13:12 UTC

