Drupal is a registered trademark of Dries Buytaert

ai_chatblock

No security coverage
View on drupal.org

AI Chatblock adds a floating chat widget to any page on your Drupal site, powered by the AI module's assistant framework. Functionally similar to the ai_chatbot module from the AI ecosystem, but with a frontend that is 100% Drupal-native, and thus with a more flexible and familiar theming workflow.

Features

  • Streaming responses via Server-Sent Events (SSE), so replies appear progressively as they are generated.
  • Server-side session history — conversation threads are tracked per session, giving the AI context from earlier messages.
  • Suggested questions — clickable starter questions shown before the first message.
  • Introduction text — optional HTML displayed above the suggested questions.
  • Markdown rendering — assistant responses rendered as formatted HTML when league/commonmark is available.
  • Optional history restore on reload — reopens the chat with history intact after a page reload via localStorage.
  • In-browser test runner — fire test questions against the assistant directly from the block configuration form.
  • CLI test runner — a Drush script for automated testing from the terminal, with support for multi-turn conversation simulation.
  • SDC example component — a Single Directory Component starter that can be copied into any theme as a customisation base.

Post-Installation

  1. Configure an AI Assistant at Administration → AI → Assistants.
  2. Place the block at Structure → Block layout — search for AI Chatblock.
  3. Configure the block: go to the block's configuration form, select the AI Assistant you just created, and set other values as needed.
  4. Test the assistant — expand Test Questions in the block config form, enter a few questions then save the form. Then click Run Tests to verify responses.
  5. Theming (optional) — copy templates/ai-chatblock.html.twig to your theme and/or copy example-data/chatbot-sdc/ to your theme's components/ directory. Disable the module's default CSS in your theme's .info.yml:
    libraries-override: ai_chatblock/chatbot: css: theme: css/ai-chatblock.css: false

Additional Requirements

  • Drupal 10 or 11
  • drupal/ai — core AI integration framework, including the ai_assistant_api sub-module.
  • At least one configured AI Assistant entity at Administration → AI → Assistants.
  • An LLM provider module — e.g. drupal/ai_provider_openai with a valid API key.
  • league/commonmark — converts assistant responses from Markdown to formatted HTML. Install via composer require league/commonmark. Without it, responses are plain text.
  • drupal/ai_agents — adds agentic capabilities (tool use, multi-step reasoning) to AI Assistants.
  • A vector database provider (e.g. drupal/ai_vdb_provider_milvus) — enables retrieval-augmented generation (RAG) so the assistant can answer questions grounded in your site's content.

Similar projects

  • drupal/ai - submodule ai_chatbot — the official AI ecosystem chatbot module. The difference is that ai_chatbot's preferred frontend uses an external js chatbot API (Deepchat), while ai_chatblock's frontend is all Drupal.

Supporting this Module

Developed and maintained by LOOMhttps://loom.de

CLI test runner:

ddev drush php:script web/modules/custom/ai_chatblock/tests/drush/test-questions.php

Set $shared_thread = TRUE in the script to simulate a continuous multi-turn conversation.

Activity

Total releases
1
First release
Mar 2026
Latest release
1 day ago
Release cadence
Stability
100% stable

Releases

Version Type Release date
1.0.0 Stable Mar 6, 2026