How to Use AI in Drupal
Drupal has always been the CMS people reach for when they need serious, structured, enterprise-grade content management. And for a long time, AI felt like something that lived in other tools — something you’d copy-paste between your CMS and a chatbot window.
That’s changed. Drupal now has a growing ecosystem of AI modules that bring intelligence directly into the editorial workflow, the admin interface, and the site experience — without having to leave Drupal to get there. Here’s a practical breakdown of what’s available and how to actually use it.
Start Here — The AI Module (Core Framework)
Before anything else, this is the foundation everything else is built on. The AI module is a unified framework that connects Drupal to external AI providers through a single abstraction layer. Instead of each integration being its own separate thing, the AI module lets you plug in providers like OpenAI, Anthropic’s Claude, Google Gemini, Hugging Face, or self-hosted models via Ollama — and swap between them without rebuilding your setup.
Install this first. Everything else sits on top of it.
It ships with several useful submodules right out of the box:
- AI Core — the foundation layer that handles provider connections and model abstraction
- AI Explorer — an admin interface where you can test prompts before putting them anywhere near a real workflow
- AI Automators — lets you populate and transform any Drupal field using AI, with support for chaining prompts together into more complex workflows
- AI Search (Experimental) — semantic search powered by vector databases, so search understands meaning rather than just matching keywords
- AI Logging — logs every AI request and response, useful for auditing and debugging
Modules Worth Installing
AI CKEditor
This is the one content editors notice immediately. It puts an AI assistant directly inside the CKEditor 5 toolbar — the same editor your team already uses. Select some text and ask it to rewrite, summarise, adjust tone, fix grammar, or translate. No switching tabs, no copy-pasting between tools. Just AI where the writing already happens.
AI Content Tools
Adds AI assistance to the broader content editing experience — adjusting tone, summarising body text, suggesting taxonomy terms, and checking content against moderation rules before it ever gets published. Useful for teams with a lot of contributors and inconsistent writing standards.
AI Translate
One-click AI translation for multilingual Drupal sites. Instead of waiting on a translator for a first draft, editors can generate a translated version and have someone review and adapt it. The time saved on multilingual content is significant if you’re managing multiple language sites.
AI Image Alt Text
As images are uploaded to the media library, this module uses computer vision to generate descriptive alt text automatically. Editors can review and edit before saving. For teams with large image libraries and accessibility requirements, this is one of those modules that quietly saves a lot of time while also making the site better.
OpenAI Provider
Connects Drupal to OpenAI’s API — GPT-4, DALL-E for image generation, and Whisper for speech-to-text. Works as a provider under the AI module framework. If your team is already using OpenAI elsewhere, this is the straightforward path to bringing those capabilities into Drupal.
Anthropic Provider
The same thing, but for Anthropic’s Claude models. If you prefer Claude for writing and reasoning tasks — which many teams do — this is how you get it into Drupal. Works with the same AI module framework so switching providers later is clean.
Augmentor
More of a Swiss Army knife than a single-purpose tool. Augmentor connects Drupal to external AI APIs through configuration rather than custom code, which makes it flexible enough to use for content generation, text analysis, or pulling AI-generated data into fields. Good for teams with varied needs who don’t want to maintain multiple separate integrations.
AI Agents
A framework for building AI agents inside Drupal — text-to-action agents that can modify content, manage taxonomy, handle fields, or take actions based on natural language instructions. More developer-focused than editor-focused, but powerful for teams building custom AI workflows inside Drupal.
Chatbot API
Middleware that lets Drupal talk to external conversational AI platforms — Google Dialogflow, Wit.ai, and others — through a single integration layer. Good for teams building intelligent chatbots or conversational interfaces that need to work with structured Drupal content underneath.
AI External Moderation
Uses OpenAI’s moderation tools to check content for sensitive or policy-violating material before it gets processed — regardless of which LLM provider you’re using for generation. Useful for platforms where content quality and brand safety matter, and where editors shouldn’t have to be the last line of defence.
Best Practices for Using AI in Drupal
Start with the AI Explorer before going live
The AI module ships with an Explorer interface in the admin where you can test prompts and see what models return before putting anything in front of editors or visitors. Use it. Prompts that look reasonable often produce something slightly off in ways you only discover when you run them. Test first, configure second.
Use the Key module for API credentials
Don’t hard-code API keys into settings files. The Key module gives you a secure, centralised way to manage all your API credentials — for OpenAI, Anthropic, Google, or any other provider. It also makes rotating keys much cleaner when you need to.
Add one module at a time
The AI module ecosystem is growing fast and some modules are still experimental. Installing five things at once makes it hard to know what caused a problem when something doesn’t work right. Add one AI feature, test it properly, then move on to the next. A phased approach also makes it easier to see the actual impact of each addition.
Set clear permissions for who can use what
AI features that send content to external APIs need to be gated. Not every editor on your site should have access to AI generation — both for cost reasons and for content governance. Drupal’s permission system handles this well, but you have to actually configure it. Decide early which roles get access to which AI features and lock it down accordingly.
Don’t skip content review just because AI generated it
AI-generated content in Drupal goes through your normal editorial workflow just like anything else — or it should. The AI modules make it easy to generate, but easy generation doesn’t mean automatic publishing. Build in a review step. AI gets things wrong, makes things up, and produces plausible-sounding content that doesn’t actually match your brand or facts. Review is not optional.
Think about data privacy before connecting to external APIs
When you use OpenAI, Anthropic, or Google-hosted models, content from your Drupal site is being sent to their APIs. For most sites that’s fine. For sites handling sensitive data, personal information, or confidential enterprise content, you need to understand what gets sent, when, and what the provider’s data policies are. The AI module also supports self-hosted models via Ollama and LM Studio for teams that need to keep everything on their own infrastructure.
Use AI Automators for field population, not just writing assistance
One of the less obvious uses of the AI module is populating structured fields automatically — generating taxonomy terms from body content, extracting keywords, summarising long articles into a teaser field, or pulling metadata from uploaded documents. AI Automators handles all of this through configuration rather than custom code. It’s worth exploring for content workflows that involve a lot of repetitive field-filling.
Where to Go From Here
- Drupal AI module: drupal.org/project/ai
- Drupal AI Initiative overview: drupal.org/about/artificial-intelligence
- OpenAI module: drupal.org/project/openai
- AI Image Alt Text: drupal.org/project/ai_image_alt_text
- Augmentor: drupal.org/project/augmentor
- Key module (for API credentials): drupal.org/project/key
- Chatbot API: drupal.org/project/chatbot_api