ai_assistant_ui
AI Assistant UI provides functionality for two common AI-Interfaces:
* Chatbot
* AI-Search-Results
Both of which are powered by the AI-Module's AI Assistant API, which brings many agentic tools such as RAG.
Features
- Server-side session history — conversation threads are tracked per session, giving the AI context from earlier messages.
-
Markdown rendering — assistant responses rendered as formatted HTML when
league/commonmarkis 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 base.
Streaming responses
Post-Installation
- Configure an AI Assistant at Administration → AI → Assistants.
- Place the block at Structure → Block layout — search for AI Assistant Chatbot.
- Configure the block: go to the block's configuration form, select the AI Assistant you just created, and set other values as needed.
- 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.
-
Theming (optional) — copy
templates/ai-chatblock.html.twigto your theme and/or copy
example-data/chatbot-sdc/to your theme'scomponents/directory. Disable the module's default CSS
in your theme's.info.yml:libraries-override: ai_assistant_ui/chatbot: css: theme: css/ai-assistant-chatbot.css: false
Additional Requirements
- Drupal 10 or 11
-
drupal/ai — core AI integration framework, including the
ai_assistant_apisub-module. - At least one configured AI Assistant entity at Administration → AI → Assistants.
-
An LLM provider module — e.g.
drupal/ai_provider_openaiwith a valid API key.
Recommended modules/libraries
-
league/commonmark— converts assistant responses from Markdown to formatted HTML.
Install viacomposer 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
The chatbot is functionally similar to the Ai-Deepchat-Block provided by the
ai_chatbot module from the AI-Module, but with a frontend that is 100% Drupal-native,
and thus with a more flexible and familiar theming workflow. The Search-Results block is similar to the
AI-Search-Block module, with the main difference being that ai_search_block does not use
AI-Assistant, and has a different RAG implementation.
Supporting this Module
Developed and maintained by LOOM —
https://loom.de
CLI test runner:
ddev drush php:script web/modules/custom/ai_assistant_ui/tests/drush/test-questions.php
Set $shared_thread = TRUE in the script to simulate a continuous multi-turn conversation.