This project is not covered by Drupal’s security advisory policy.
Overview
AI Chatlog records the conversations your site's AI assistants and agents
have with users and presents them as browsable, threaded transcripts in the
Drupal admin UI. It is built for the AI module ecosystem:
https://www.drupal.org/project/ai.
The module keeps conversations in its own storage and starts recording
as soon as it is enabled. No logging or observability module has to be
set up first.

Features
- Conversation list - paginated overview with
user, assistant, opening message, message count, timestamps and token
usage. Built with Views, so it can be customised. - Filtering and sorting - filter by user,
assistant and date range; sort by most columns. - Full transcripts - browse the complete exchange
history with per-exchange metadata: model, provider, tokens and
timestamp. - CSV export - download all retained conversations,
including follow-up questions and answers, independently of pagination
and list filters. Each row contains the conversation ID, timestamp,
user input, assistant reply and assistant identifier. Export requires
the View AI conversations permission. - Agent tool calls - tool-call retries are folded
into their user turn, with each call's arguments and result.
Conversations that ended without a text answer are flagged as
unresolved. - Render modes - view messages as raw text,
Markdown or safe HTML. Formatted rendering requires
league/commonmark^2.0. - Privacy controls - choose whether to store
message input and output, and what happens to conversations when
a user's account is deleted. - Retention management - configurable automatic
cleanup via cron, with a default retention period of 90 days.
Delete individual conversations or all of them. - Error alerts - the optional AI Chatlog Alerts
submodule detects tool-call failures and unresolved conversations,
logs them, and can email a list of recipients. - Optional cost figures - shown on transcript
pages when theai_insights_costsubmodule of AI Insights
is enabled. - Service API -other modules can inject
ai_chatlog.queryto access conversations, iterate complete
exchanges, or retrieve user inputs within a date range. - Drush commands - rebuild or reconcile
conversation summaries.
How it works
AI Chatlog subscribes to the AI module's response events and records
AI requests and responses, retaining full input and output when logging
is enabled. A summary row per conversation drives the list page.
Streaming response events update the same record rather than creating
duplicates.
Recording errors are caught and written to the
ai_chatlog log channel so they do not interrupt the chat
response.
Supported assistant types
- AI Assistant API assistants
(ai_assistant_api) - AI Agents (
ai_agents)
Requirements
- Drupal 10.3 or later, 11 or 12
- AI module:
https://www.drupal.org/project/ai
Installation
- Install with Composer:
composer require 'drupal/ai_chatlog:^1.0@RC' - Enable it:
drush en ai_chatlog - Optionally enable error alerts:
drush en ai_chatlog_alerts - Grant permissions to the appropriate roles:
View AI conversations, Delete AI conversations
and Administer AI Chatlog. - Adjust settings at
Configuration > AI > Chatlog if needed. - Visit Reports > AI Conversations to browse
conversations or download a CSV export.
Privacy
Recorded messages can contain personal data. Anyone with
View AI conversations can read and export every user's
conversations, not only their own. Grant this permission accordingly.
Updating from a development snapshot
Sites running development snapshots from before 1.0.0-beta1 may need
to update through 1.0.0-beta1 first if the earlier database updates have
not been applied. Check UPDATES.md before upgrading.
Sites installed from 1.0.0-beta1 or later can update normally.
| Attachment | Size |
|---|---|
| ai-conversations.jpg | 506.95 KB |
Project information
- Project categories: Artificial Intelligence (AI)
- Ecosystem: AI (Artificial Intelligence)
12 sites report using this module
- Created by d0t15t on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
