Drupal is a registered trademark of Dries Buytaert

ai_search_block

52 sites Security covered
View on drupal.org

AI Search Block

Let users talk with your content without writing custom code. This module provides a powerful search interface that uses AI to query and interact with your Drupal content in real-time.

Overview

Built on top of the AI module, this module allows users to query your content using natural language. Responses are streamed back in real-time, providing a seamless conversational experience directly within your site.

Important: This is not a virtual assistant. This module talks with your indexed data. If no relevant data is found, no response will be generated (by design).

Key Features

  • Real-time Streaming: Responses stream back to users as they're generated
  • Configurable Search Forms: Customize placeholder text, submit buttons, and input types
  • Multiple Data Sources: Query different content types and databases
  • User Feedback: Built-in scoring system for response quality
  • Copy to Clipboard: Easy sharing of AI-generated responses
  • Search Analytics: Optional logging submodule with comprehensive graphs and statistics
  • Performance Optimized: Database indices and caching for fast response times

Search Analytics & Logging

The optional AI Search Block Log submodule provides comprehensive analytics:

  • Track total searches per day with per-block breakdown
  • Monitor average quality scores over time
  • View score distribution trends
  • Analyze searches by user and block
  • Performance optimized with database indices and 1-hour caching
  • Interactive charts using Chart.js

Requirements

  • AI module installed and configured
  • AI embedding model configured
  • LLM (chat) model configured
  • Vector database installed and configured
  • Content indexed in your vector database

Installation

  1. Install the module: composer require drupal/ai_search_block
  2. Enable the module: drush en ai_search_block
  3. Optional: Enable logging: drush en ai_search_block_log
  4. Clear cache: drush cr

Configuration

Step 1: Add Blocks

Place the "AI Search" and "AI Search Response" blocks into your desired regions.

Step 2: Configure the Search Block

Configure your AI search block settings including:

  • Input field type (text field or textarea)
  • Placeholder text and submit button labels
  • Loading and suffix messages
  • Enable/disable streaming responses
  • Enable/disable database results
  • Clear form after search option

Step 3: Select Your Data Source

Choose which content to query - select your configured vector database and content types.

Step 4: Start Searching

Users can now search your content using natural language queries. Responses stream back in real-time.

Step 5: View Analytics (Optional)

If you've enabled the AI Search Block Log submodule, visit /admin/config/ai/ai_search_block_log/graphs to view comprehensive search analytics and statistics.

Performance

The module is optimized for production use:

  • Database Indices: Composite indices on frequently queried columns
  • Query Caching: 1-hour cache for analytics data
  • Efficient Aggregations: Optimized SQL queries for statistics
  • Lazy Loading: Charts and data load efficiently

Permissions

  • access content - View and use the search interface
  • administer ai_search_block_log - Access analytics and graphs

Support

For issues, feature requests, or contributions, please visit the issue queue.

Credits

This module integrates with the AI module and uses Chart.js for visualizations.

Activity

Total releases
19
First release
Jan 2025
Latest release
1 week ago
Release cadence
22 days
Stability
0% stable

Release Timeline

Releases

Version Type Release date
2.0.x-dev Dev Feb 23, 2026
1.0.0-rc21 Pre-release Feb 20, 2026
1.0.0-rc20 Pre-release Jan 27, 2026
1.0.0-rc19 Pre-release Jan 27, 2026
1.0.0-rc17 Pre-release Jan 27, 2026
1.0.0-rc16 Pre-release Jan 21, 2026
1.0.0-rc15 Pre-release Jan 15, 2026
1.0.0-rc13 Pre-release Dec 19, 2025
1.0.0-rc12 Pre-release Dec 19, 2025
1.0.0-rc11 Pre-release Dec 19, 2025
1.0.0-rc10 Pre-release Dec 1, 2025
1.0.0-rc9 Pre-release Dec 1, 2025
1.0.0-rc7 Pre-release Nov 26, 2025
1.0.0-rc6 Pre-release Nov 24, 2025
1.0.0-rc5 Pre-release Nov 24, 2025
1.0.0-rc4 Pre-release Nov 20, 2025
1.0.0-rc3 Pre-release Nov 20, 2025
1.0.0-rc2 Pre-release Mar 12, 2025
1.0.x-dev Dev Jan 21, 2025