Skip to main content
Image
Drupal AI Modules Part 1: Architecture, Setup, Built-ins, and Extensibility

Drupal AI Ecosystem Part 1: Setup and AI CKEditor Configuration

Drupal

The Drupal AI modules smoothly incorporate artificial intelligence into the Drupal ecosystem, viewing AI as a fundamental part rather than just an extra feature. Instead of depending on separate API integrations, it positions AI as a key element within the Drupal framework.

This introductory article shows how the Drupal AI module works well with CKEditor 5, introducing generative AI directly into the content editing process. It guides you through the setup, configuration, and built-in features that enable editors to create, rewrite, summarize, and translate content using AI, all within the familiar Drupal interface.

Future articles will look into more submodules, developer APIs, editorial workflows, and advanced features like semantic search and Retrieval-Augmented Generation (RAG).

Before we move on in this blog to discuss Drupal's AI modules, make sure you don't stop here. Take a look at how our AI services can help you use these tools to achieve real business outcomes.

Explore Our AI Services

Now, let's see how Drupal AI Modules are structured!

Drupal AI Modules: Architecture and Integration Points

Before we look into how Drupal AI modules work, it's important to understand the underlying structure that enables them, the architecture. The Drupal AI ecosystem is built with flexibility and extensibility in mind, allowing smooth interaction between Drupal and various AI providers. Here are the core elements that define Drupal AI Modules architecture and integration points:

  1. Provider-agnostic abstraction: At its core, the Drupal AI modules standardize communication with multiple AI providers through a unified service layer. Whether you’re calling OpenAI, Azure AI, or Anthropic, the same service handles requests, no SDK juggling required.
  2. Plugin-based providers: Each provider is implemented as a plugin, making it easy to swap or add providers without touching your site logic.
  3. Configuration-driven behavior: Admins manage provider keys, model defaults, and rate-limits entirely through config, versionable and exportable like any other Drupal setting.

Drupal AI Modules: Initial Setup for AI Integration in Drupal

The setup process for Drupal AI Modules ensures your Drupal site is configured to communicate seamlessly and securely with various AI providers.

Requirements: Drupal 10+, PHP 8.1+, Composer.

The steps involved in the initial setup for AI integration in Drupal are discussed below:

Step 1: Install the module. The AI module depends on the key module to manage the authentication for the AI provider. The following command will download and key the module as well.

composer require 'drupal/ai:^1.2'

drush en ai -y

drush cr

Step 2: Select and install the module for the AI provider.

Step 3: For this series, I am using OpenAI Provider. So, let's install the OpenAI Provider module.

composer require 'drupal/ai_provider_openai:^1.2' 

drush en ai_provider_openai -y 

drush cr

Step 4: Before configuring the AI Provider, we need to create an API key in the OpenAI dashboard. Go to https://platform.openai.com/ and register (log in if you already have an account) and generate the API key from this URL: https://platform.openai.com/api-keys. Copy the secret key.

Configuring The AI Providers Drupal AI Modules OpenSense Labs

Step 5: Now, create a key in Drupal at Configuration → System → Keys →  (/admin/config/system/keys/add).

Key Creation In Drupal Configuration Drupal AI Modules OpenSense Labs

Step 6: Configure the OpenAI Provider settings to use the key we just created at Configuration → AI → Provider Settings → OpenAI Authentication(/admin/config/ai/providers/openai)

Configure The OpenAI Provider Drupal AI Modules OpenSense Labs

Step 7: Select the key and save the configuration. 

Step 8: Now, let’s configure the AI model settings for various operations. OpenAI provides a range of different models that can be used for different operations, such as embeddings, text-to-speech, chat, or text translation. Go to Configuration → AI → AI Default Settings (admin/config/ai/settings) 

AI Model Configuration Drupal AI Modules OpenSense Labs

Within minutes, you can have a working connection to your first AI provider. 

The Drupal AI modules have various submodules that provide different AI integration and functionality. Here’s the brief introduction about those submodules:

  1. AI Core: The backbone of the ecosystem, a unified service layer that connects Drupal to any AI model. It standardizes how modules talk to providers, so switching models or APIs never breaks your site logic.
  2. AI Explorer: A playground for experimentation. Use it to test prompts, fine-tune wording, and preview how your chosen provider responds, all from a clean admin interface.
  3. AI Automators: Your workflow engine for AI-driven actions. It can populate, transform, or enrich Drupal fields using chained prompts, web scraping, or OCR. Works alone or with ECA for building complex, no-code AI pipelines.
  4. AI Search (Experimental): Brings semantic search and Retrieval-Augmented Generation (RAG) into Drupal. It uses embeddings and vector databases like Milvus, Zilliz, or Pinecone so your site can “understand” content meaning and answer natural-language questions.
  5. AI Assistants API + Chatbot: A flexible backend for building and managing chat-based assistants. Configure how they reason, what data they access, and plug in any front-end UI you want, from a support bot to a content guide.
  6. AI CKEditor: Integrates AI directly into the editor. Rewrite, translate, summarize, or polish text without leaving CKEditor 5, making smart assistance part of everyday content creation.
  7. AI Content: A set of intelligent helpers for editors. Adjust tone, summarize long content, suggest tags, and catch moderation issues, all tuned for Drupal’s editorial flow.
  8. AI External Moderation: Adds an AI-powered safety net. Uses OpenAI’s moderation tools to screen content or responses before they’re processed by other language models.
  9. AI Logging: Keeps a record of every AI request and response. Useful for audits, debugging, and cost tracking — with enough detail to learn from usage, but without exposing sensitive data.
  10. AI Translate: Enables one-click AI translations for multilingual sites. It’s a fast, editor-friendly bridge between Drupal’s translation system and your chosen language model.
  11. AI Validations: Let's AI validate text fields dynamically. Pair it with the Field Validations module to check grammar, tone, or even factual accuracy through LLM-powered rules.

To explore these submodules in detail, check out the related blogs below:

  1. Transform Your Website with Drupal AI Module in 2025
  2. Create and Integrate: CKEditor 5 Plugin in Drupal 11
  3. Gin Admin Theme: Replacing Claro In Drupal CMS
  4. Explainable AI Tools: SHAP's power in AI

Drupal AI Modules: Set Up and Configure the AI CKEditor Module 

The AI CKEditor submodule brings generative AI directly into the Drupal editing experience. Once configured, editors can prompt the AI to rewrite, translate, summarize, or refine text without leaving the CKEditor 5 interface. 

  1. Enable the Module: Enable the ai_ckeditor module from the following Drush command or from the Drupal UI.
drush en ai_ckeditor

Once enabled, configure the text formatter to add the plugin for AI CKEditor. After adding the plugins, you will see AI Tools settings below, and there are options available to set the GPT model, use a prompt to generate/modify content, set the tone, generate a summary, translate content, or even just correct spellings & grammar, and many more. 

Let’s start with generating and modifying the content using AI. Expand “Modify with a Prompt” and “Generate with AI” and enable these features. You can also select a different model for each feature and can set a different prompt separately for each of them. Configure and save the settings.

Generate And Modifying The Content Drupal AI Modules OpenSense Labs

Now, let’s create an article with AI content!

Creating An Article With AI Content Drupal AI Modules OpenSense Labs

Click on the AI Assistant plugin and select Generate with AI.

Add the prompt (example given below) and click on generate:

I want to generate detailed article on the following topic: "Each year, millions of tons of plastic waste end up in the ocean, threatening marine life and coastal communities. Small behavioral changes—like reusing containers and supporting low-waste packaging—can make a measurable difference."

Generating Content With AI Assistant Drupal AI Modules OpenSense Labs

You can see the response from AI just below the context you have submitted. You can regenerate the response by setting a different prompt. Once you are satisfied, click on Save Changes to Editor. This will copy the response into the text-formatted field.

Response Of AI Assistant In Drupal AI Modules OpenSense Labs

Now, let’s say we want to rephrase the first paragraph. Select the paragraph and click on the AI assistant plugin, and then select “Modify with a prompt”. Describe the changes or provide instructions in the “Your Instructions” field and click on the Modify text button.

Modifying Content With A Prompt Drupal AI Modules OpenSense Labs 1

Modifying Content With A Prompt Drupal AI Modules OpenSense Labs 2

As you can see in the above screenshots, the selected text has been rephrased with a simple instruction.

This concludes our look at the foundation of Drupal’s AI ecosystem. In Part 2, we’ll continue the journey with another submodule—exploring how it works and how it fits into practical Drupal AI Ecosystem.

Key Takeaways

  1. Drupal AI Modules introduce AI into the Drupal ecosystem, smoothly incorporated into modules, services, and editors for more efficient workflows.
  2. The Drupal AI Modules have a flexible, plugin-based design that lets developers link various AI providers, such as OpenAI, Gemini or Azure AI, without interfering with the site's functionality.
  3. Setting up the Drupal AI Modules in a few steps, installation, setting up API keys, and linking with your selected AI provider for immediate AI-powered features.
  4. Understanding of specialized submodules for creating content, managing it, translating it, and smart searching — improving the editorial and development experience in Drupal.

Subscribe

Ready to start your digital transformation journey with us?

Related Blogs

Transform Your Website with Drupal AI Module in 2025

Top Drupal AI Modules to Transform Your Website in 2025 OpenSense Labs

Drupal is quickly progressing in Artificial Intelligence with the creation of the Drupal AI Module and the upcoming Drupal…

Gin Admin Theme: Replacing Claro In Drupal CMS

Gin Admin Theme Drupal CMS Will Replace Claro OpenSense Labs

Drupal’s default admin theme, Claro, is one of the factors that make a visual comparison between Drupal 7 and Drupal 10 so…

SDC: Integrating Storybook & Single Directory Component

Integrating SDC With Storybook OpenSense Labs

Today, we will talk about about Drupal Single Directory Components or SDC and Storybook. Single Directory Components in…