Drupal is a registered trademark of Dries Buytaert

magic_search

No security coverage
View on drupal.org

Transform your Drupal search with AI. Display dynamic, contextual answers and summaries above traditional results to better address user intent using RAG technology.

Magic Search transforms traditional keyword-based search into an intelligent, AI-powered experience that truly understands what your users are looking for.

Instead of just listing search results, Magic Search displays a dynamic block with direct answers, contextual summaries, and relevant links that directly address user intent - all powered by AI and RAG (Retrieval Augmented Generation) technology.

How It Works

When a user searches your site, Magic Search:

  1. Understands Intent: Uses AI to analyze and refine the search query, determining what the user really wants to know
  2. Retrieves Context: Searches your vector database index for the most relevant content across your entire site
  3. Generates Answers: Uses large language models to synthesize information into clear, accurate, contextual responses
  4. Composes the Layout: The AI dynamically selects which UI components to use from your configured component library and determines how to structure the response block based on the vector chunk results and an LLM-syntesized information
  5. Displays Results: Renders the AI-composed block with the selected components, content, and layout (often along with traditional search results)

Key Features

AI-Powered Intelligence

  • Intent Recognition: Understands user queries and generates optimized search terms
  • RAG Technology: Combines vector search with large language models for accurate, contextual responses
  • Smart Caching: Optimizes performance by caching AI responses to reduce API calls
  • Provider Agnostic: Works with Gemini, OpenAI, Anthropic Claude, or any AI provider supported by the Drupal AI Core

Flexible Configuration

  • Multiple Search Types: Create different search configurations for various contexts
  • Custom Prompts: Define how AI should behave with full Drupal token support
  • Component Library: Configure which UI components are available to the AI - the LLM intelligently decides which components to use and how to arrange them for each query
  • Fine-Tuned Control: Adjust AI parameters like temperature, tokens, and penalties per use case

Use Cases

  • Documentation Sites: Provide direct answers to "how-to" questions
  • E-commerce: Help customers find products based on needs, not just keywords
  • Knowledge Bases: Surface relevant information from large content repositories
  • Corporate Websites: Guide visitors to the right content quickly
  • Educational Platforms: Answer student questions with contextual information

Requirements

Quick Start

  1. Install via Composer:
  2. Enable the module:
  3. Configure at: Admin > Configuration > Search and metadata > Magic Search settings
    • Set up your AI providers (intent and RAG models)
    • Configure your search index
    • Customize prompts for your use case
  4. Create search types at: Admin > Configuration > Search and metadata > Magic Search types
  5. Place the Magic Search Results block on your search results page
  6. Search your site and watch the magic happen!

Activity

Total releases
1
First release
Feb 2026
Latest release
3 weeks ago
Release cadence
Stability
0% stable

Releases

Version Type Release date
1.x-dev Dev Feb 9, 2026