Drupal is a registered trademark of Dries Buytaert
Release: Paragraphs 8.x-1.23 Minor update available for module paragraphs (8.x-1.23). Release: AI (Artificial Intelligence) 1.4.6 Minor update available for module ai (1.4.6). Release: AI (Artificial Intelligence) 1.3.11 Minor update available for module ai (1.3.11). Release: Search and Replace Scanner 2.0.0 Major update available for module scanner (2.0.0). Release: Chosen 5.0.7 Minor update available for module chosen (5.0.7). Release: amazee.ai Private AI Provider 1.4.0 Minor update available for module ai_provider_amazeeio (1.4.0). Release: Instagram Feed Block 1.0.2 Minor update available for module instagram_feed_block (1.0.2). Release: Mercury Editor Page Templates 1.0.10 Minor update available for module mercury_editor_page_templates (1.0.10). Module Revived: Entity Browser 8.x-2.16 Module entity_browser updated after 11 months of inactivity (8.x-2.16). Usage Milestone: Media entity Twitter Module media_entity_twitter crossed 10,000 active installs.

This module provides an Elasticsearch backend for Drupal's AI module, allowing you to store and retrieve AI embeddings directly within your existing Elasticsearch cluster. It supports advanced features like hybrid search (combining vector and keyword matching) and semantic search without needing a separate vector database.

Elasticsearch AI VDB Provider

An Elasticsearch backend for the Drupal AI module and its AI Search submodule. Stores and retrieves embeddings using Elasticsearch's native dense_vector field with HNSW kNN, so semantic search and RAG work directly against your existing Elastic Stack — no separate vector database to operate.

Why this module

As of April 2026, this is the only Drupal AI VDB provider that runs hybrid search (kNN + BM25) in a single Elasticsearch request, merged with Reciprocal Rank Fusion (RRF).

Capability This module Other VDB providers Approximate kNN (HNSW) Yes Yes Access-control pre-filtering Yes Yes Hybrid search (kNN + BM25 + RRF) Yes No Reuses an existing Elastic Stack Yes No

Requirements

  • Drupal 10.3 or 11
  • AI module (includes the AI Search submodule)
  • Key module for credential storage
  • An Elasticsearch 8.x cluster with dense_vector support — 8.8+ for hybrid search (RRF)
  • An AI Provider module for embeddings (OpenAI, Anthropic, Ollama, etc.)

Install

composer require drupal/ai_vdb_provider_elasticsearch
drush en ai_vdb_provider_elasticsearch

Configure

  1. Store credentials. At /admin/config/system/keys, create a Key entity holding either an Elasticsearch API key (recommended) or a Basic Auth password. Skip for unauthenticated local clusters.
  2. Configure the provider. At /admin/config/ai/vdb_providers/elasticsearch, set the host URL, point at your Key entity, choose an Index Prefix (e.g. drupal_) and a Similarity Metric (cosine for normalized embeddings from commercial LLMs — the safe default).
  3. Wire up Search API. At /admin/config/search/search-api, add a Server with AI Search (VDB) as the backend, select Elasticsearch as the VDB Provider, attach your AI Provider for embeddings, then add an Index and run it.

The Elasticsearch index is created automatically on first use. The similarity metric and embedding dimensions are baked into the mapping at creation time — changing either requires dropping and re-indexing.

Pure vector search is excellent at conceptual matching but fails on exact lexical lookups — product SKUs, acronyms, proper names. With hybrid search enabled, every query runs both a kNN vector search and a BM25 keyword match in one Elasticsearch request, then merges the two ranked lists with RRF. No manual weight tuning needed.

Content profile Recommendation Mostly narrative prose, queried by concept Pure kNN (hybrid off) Codes, acronyms, proper names mixed in Hybrid on RAG agent over a mixed knowledge base Hybrid on Elasticsearch < 8.8 Hybrid not available

License note. RRF is a commercial Elastic feature on 8.x. The basic (free) license returns 403 license non-compliant for [Reciprocal Rank Fusion (RRF)]; either start a Platinum trial or leave the toggle off. Pure kNN works on the basic license.

Documentation

Detailed walkthroughs live in the project repository:

Index field mapping

The module maps these fields explicitly at index creation; everything else ai_search sends through is accepted via dynamic: true.

Field Type Purpose vector dense_vector Embedding (HNSW-indexed) entity_id keyword Drupal entity ID entity_type keyword Pre-filter (e.g. node) bundle keyword Bundle pre-filter langcode keyword Language pre-filter chunk_id keyword Chunk identifier within an entity content text Plain text used by BM25 in hybrid mode

Maintainers

  • Ricardo Amaro
  • Looking for co-maintainers — open an issue or reach out.

Activity

Tracked releases
7
Tracked since
Mar 2026
Latest release
2 months ago
Releases (12 mo)
7 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Release date
1.0.0-rc1 Pre-release May 9, 2026
1.0.0-alpha5 Pre-release May 2, 2026
1.0.0-alpha4 Pre-release Mar 28, 2026
1.0.x-dev Dev Mar 25, 2026
1.0.0-alpha3 Pre-release Mar 23, 2026
1.0.0-alpha2 Pre-release Mar 23, 2026
1.0.0-alpha1 Pre-release Mar 23, 2026