Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Cms 2.1.4 Update released for Drupal core (2.1.4)! Release: Drupal 12.0.0-alpha1 First alpha version released for Drupal core (12.0.0-alpha1). Release: PhotoSwipe - Responsive JavaScript Modal Image Gallery 5.0.9 Minor update available for module photoswipe (5.0.9). Release: AI (Artificial Intelligence) 1.4.8 Minor update available for module ai (1.4.8). Release: AI (Artificial Intelligence) 1.3.13 Minor update available for module ai (1.3.13). Release: Moderated Content Bulk Publish 2.0.53 Minor update available for module moderated_content_bulk_publish (2.0.53). Release: Mailchimp 2.2.9 Minor update available for module mailchimp (2.2.9). Release: Mailchimp 3.1.4 Minor update available for module mailchimp (3.1.4). Module Revived: Image field to media 3.0.2 Module image_field_to_media updated after 13 months of inactivity (3.0.2). Security Coverage: Analyze PostHog Module analyze_posthog now has official Drupal security advisory coverage.

Drupal RAG Toolkit provides a Drupal-native framework for building and operating Retrieval-Augmented Generation (RAG) applications using Drupal content as a governed knowledge corpus.

Rather than implementing a single fixed RAG stack, the Toolkit integrates with Drupal's existing Search API and Drupal AI ecosystems and provides stable, provider-independent APIs for RAG consumers. This allows Drupal developers to build search, question-answering, assistants, and other RAG-powered applications while keeping content structure, access rules, retrieval configuration, citations, and operational controls in Drupal.

The initial implementation uses Search API and AI Search for retrieval and supports independently configured embedding, vector database, and generation providers.

Project summary:

Drupal-native toolkit for building governed RAG search and AI applications using Search API, Drupal AI, and interchangeable embedding, vector, and generation providers.

Features

Drupal RAG Toolkit is intended for developers and Drupal teams that want to build RAG applications around Drupal without tying the application itself to a particular language model, vector database, or retrieval implementation.

Current features include:

  • Provider-independent RAG API: Applications consume stable Drupal PHP interfaces rather than depending directly on a specific LLM, vector database, Search API index, or vector collection.
  • Search API integration: The included Search API implementation uses Drupal Search API and AI Search for semantic and lexical retrieval, allowing indexed Drupal fields, metadata, filters, facets, and Views to participate in the RAG application.
  • Independent AI providers: Embedding and generation providers are configured separately. A site can, for example, use a local embedding model while using a hosted model for answer generation.
  • Grounded answers and canonical citations: Generated responses are bound to eligible retrieved evidence and include citations back to Drupal content.
  • Evidence-only retrieval: Consumers can retrieve governed evidence without invoking answer generation, making the Toolkit useful for search interfaces and other applications that do not always require an LLM response.
  • Explicit result states: Applications can distinguish between a grounded answer, retrieved evidence without generation, insufficient evidence, and an unavailable RAG dependency instead of treating every query as a successful generated answer.
  • Drupal access verification: Retrieved candidates are checked against Drupal content eligibility before they can become evidence used by the RAG response. The initial supported profile targets a governed public corpus.
  • RAG profiles and corpus configuration: Retrieval and generation behavior can be represented as Drupal configuration rather than being hard-coded into consuming applications.
  • Curated answers: Administrators can define controlled answers for important queries where deterministic editorial behavior is preferable to fully generated output.
  • Safe index lifecycle: Significant index changes can be built as a candidate generation, validated, explicitly activated, and rolled back without immediately replacing the active RAG index.
  • Operator tools: Administrative screens provide setup checks, profile status, index lifecycle controls, Search API information, and a query workbench for inspecting accepted evidence.
  • Evaluation workbench: Human-reviewed test cases can check expected and forbidden citation sources, acceptable result states, and latency budgets. Evaluation runs use the same governed Toolkit query boundary as normal consumers.
  • Views integration: RAG evidence and Search API results can participate in normal Drupal search experiences instead of requiring a completely separate search application.
  • Drush support: Querying, index status, staged builds, validation, activation, and rollback can also be operated from the command line.

Typical use cases include:

  • AI-assisted public website search.
  • Grounded question-and-answer applications over Drupal content.
  • Knowledge bases and documentation sites.
  • Government, university, nonprofit, and enterprise sites where content governance and citations are important.
  • Custom Drupal modules that need RAG capabilities without depending directly on a specific AI or vector provider.
  • Projects that need local AI components, hosted AI services, or a mixture of both.

The Toolkit is designed as an integration framework rather than a replacement for Search API, Drupal AI, AI Search, or their provider modules.

Post-Installation

The base drupal_rag_toolkit module provides the provider-independent PHP API and consumer contracts. To use the current Search API-based RAG implementation, also enable drupal_rag_toolkit_search_api and its dependencies.

After installation:

  1. Configure the Drupal AI providers that will be used for embeddings and, if generated answers are required, generation.
  2. Configure a supported vector database provider for AI Search.
  3. Go to Configuration → Web services → RAG.
  4. Run the RAG setup preflight and resolve any missing configuration.
  5. Review and enable the RAG profile.
  6. Use the Search API administration integration to select the Drupal fields and metadata that should participate in the corpus.
  7. Index the content normally through Search API.
  8. Use the RAG operator overview and test-query workbench to verify retrieval and inspect the evidence accepted for queries.

Ordinary content changes are handled through the active Search API index and its tracker. Editing or publishing content does not normally require replacing the entire RAG index.

For significant index-level changes, such as changing embedding models or indexed structure, Drupal RAG Toolkit provides a staged workflow:

Build candidate
      ↓
Validate candidate
      ↓
Activate
      ↓
Rollback if necessary

Equivalent lifecycle operations are available through Drush.

The initial shipped profile is intended for a governed public corpus. Role-personalized/private RAG, complete multilingual retrieval policy, persistent generated-answer caching, and automated physical cleanup of retired index resources are still under development.

Additional Requirements

Drupal RAG Toolkit core:

  • Drupal 11.2 or later.

For the included Search API implementation:

  • Search API
  • Drupal AI
  • AI Search
  • A compatible embedding provider
  • A compatible AI vector database provider

A generation/chat provider is additionally required when generated answers are enabled. Retrieval-only and evidence-only applications do not necessarily require generation for every query.

The development environment currently includes integrations for:

  • Ollama
  • OpenAI
  • Qdrant VDB Provider
  • Milvus VDB Provider
  • Key, for secure provider credential management

The providers and infrastructure required for a particular installation depend on the RAG profile being deployed. The Toolkit itself is designed to keep provider-specific details out of consuming application code.

The following Drupal projects can be used to extend or configure a Drupal RAG Toolkit installation:

  • AI provider modules such as AI Provider Ollama or AI Provider OpenAI for embedding and generation services.
  • AI VDB provider modules such as Qdrant or Milvus for vector storage and semantic retrieval.
  • Key for managing API credentials and secrets.
  • Search API ecosystem modules where additional datasource, processor, indexing, filtering, or backend capabilities are required.

The Toolkit is intentionally designed to build on the Drupal AI and Search API ecosystems rather than duplicating their provider and indexing functionality.

Similar projects

Drupal as RAG (drupal_rag) provides a self-contained RAG implementation using Ollama and PostgreSQL/pgvector, including its own entity and file extraction pipeline, chunking, vector storage, and HTTP query/generation endpoints.

Drupal RAG Toolkit takes a different approach. It is intended as a composable Drupal RAG framework rather than a fixed RAG stack. It uses Search API, AI Search, and Drupal AI provider abstractions and adds Drupal-oriented RAG governance, consumer APIs, profiles, citations, evaluation, and staged index lifecycle management. The projects therefore address overlapping use cases with different architectural goals.

AI RAG API exposes AI Search-based RAG through an OpenAI-compatible HTTP chat-completions API, making Drupal RAG available to decoupled applications and OpenAI SDK clients.

Drupal RAG Toolkit currently focuses instead on the Drupal application and operational layer: provider-independent PHP contracts, governed evidence and results, Search API integration, RAG profiles, lifecycle management, evaluation, and reusable APIs for other Drupal modules. A general-purpose remote RAG transport/API is not currently part of the Toolkit's public API.

AI Search provides the underlying semantic/vector search capabilities used by the Toolkit's initial Search API implementation. Drupal RAG Toolkit does not replace AI Search; it builds a governed RAG application layer on top of it.

Supporting this Module

Development, bug reports, feature requests, documentation improvements, testing, and contributed integrations are welcome through the Drupal.org project issue queue.

In particular, contributions that help validate additional AI providers, vector databases, retrieval strategies, datasource integrations, and production deployment patterns are welcome.

Community Documentation

Documentation is currently being expanded as the Toolkit approaches its first public releases.

The project README contains the current developer API, local development setup, operator workflow, Drush commands, and implementation notes.

Additional installation recipes, architecture documentation, provider examples, and walkthroughs are planned as the project evolves.

Project status

Drupal RAG Toolkit is currently intended for development, evaluation, demonstrations, and early operator pilots.

The architecture and APIs are actively being prepared for reusable Drupal implementations, but the project should not yet be considered a general-purpose production distribution. Current production-readiness work includes release packaging and CI, persistent caching policy, multilingual retrieval behavior, and complete cleanup management for retired index resources.

The goal of the project is to provide a reusable Drupal RAG toolkit that lets Drupal teams assemble the infrastructure appropriate to their project while retaining Drupal as the governed source of content, metadata, access policy, retrieval configuration, and citations.

AI-assisted development disclosure

AI-assisted tools have been used to draft portions of this project's code
and documentation. The maintainer remains responsible for project direction,
architecture, licensing, security review, validation, and every submitted
change.

If AI was used to create a significant portion of an issue, patch, merge
request, code, or documentation, disclose that use and explain the human review
and validation performed.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Sep 2026
Latest release
1 hour ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Core Release date
1.0.0-alpha1 Pre-release 11 Sep 3, 2026