ai_chatlog
Overview
AI Chatlog provides a browsable conversation log viewer for Drupal sites
using the AI module ecosystem. It reconstructs human-readable chat transcripts from the events already captured by AI Observability — no extra logging configuration needed.
If your site uses AI assistants or AI agents to interact with users, this
module lets administrators review those conversations from a single place
in the Drupal admin UI.
Features
- Conversation list — paginated overview of all AI conversations with user, assistant, message count, timestamps, and token usage.
- Filtering — narrow by user, assistant, or date range.
- Sortable columns — sort by last activity, start time, message count, or token usage.
- Full transcripts — click any conversation to see the complete exchange history with per-message metadata (model, provider, tokens).
- Session grouping — automatically groups related messages from the same user and assistant into a single conversation, even when the underlying system creates separate thread IDs per message.
- Retention management — configurable automatic cleanup via cron (default: 90 days). Bulk delete option available.
- Permissions — separate permissions for viewing
conversations and administering settings/deletion. - Service API — other modules can inject the
ai_chatlog.queryservice to access conversation data programmatically.
How it works
AI Chatlog is a read-only query layer. It does not
subscribe to any events or write any data. All conversation data comes from
the logger_logs database table populated by AI Observability.
The module queries log entries tagged with
ai_assistant_thread_* or ai_agents_runner_*,
pairs pre-request and post-response events by their provider request ID, and
renders the results as a chat-style transcript.
Supported assistant types
- AI Assistant API assistants
(ai_assistant_api) - AI Agents (
ai_agents)
Requirements
Installation
- Install the module with Composer or place it in
modules/contrib/. - Enable it:
drush en ai_chatlog - Grant the View AI conversations permission to the appropriate
roles. - Visit Reports > AI Conversations to start browsing
conversation logs.