AI has arrived in the Drupal ecosystem โ€” not as a chatbot bolted onto a corner of the admin interface, but as a properly architected, provider-agnostic framework that any module can consume. The Drupal AI initiative, backed by the Drupal Association and major Drupal companies, is building the infrastructure layer that lets site builders and developers wire up any LLM โ€” OpenAI GPT-4o, Anthropic Claude, Google Gemini, Llama 3, Mistral โ€” to Drupal's content architecture.

Here's a comprehensive guide to what's available now, what's coming, and how to build AI-powered Drupal sites that actually work in production.

1. The Drupal AI Module Framework

The ai module on Drupal.org is the provider-agnostic core. It defines a set of plugin types (LLM provider, image generation, embeddings, audio, moderation) and a unified PHP API that all provider implementations must satisfy:

// Get the AI provider plugin manager
$ai = \Drupal::service('ai.provider');

// Get any configured provider for text generation
$response = $ai->chat(
  provider: 'openai',
  model: 'gpt-4o',
  messages: [['role'=>'user','content'=>'Summarise this article: '.$text]]
);

The provider abstraction means you can switch from OpenAI to Anthropic to a self-hosted Llama model by changing a configuration value โ€” no code changes needed.

2. Connecting LLM Providers

Each provider is a separate module. Installing the ai_provider_openai module and entering your API key gives you access to GPT-4o, GPT-4 Turbo, and GPT-3.5 Turbo. Installing ai_provider_anthropic gives access to Claude 3.5 Sonnet, Claude 3 Opus, and Haiku. Provider modules exist for:

  • OpenAI (GPT-4o, DALL-E 3, Whisper, text-embedding-3)
  • Anthropic (Claude 3.5 Sonnet, Claude 3 Opus)
  • Google Vertex / Gemini
  • Hugging Face (self-hosted models)
  • Ollama (local Llama 3, Mistral, Phi-3 via Docker)
  • AWS Bedrock

For editorial use cases, we typically configure OpenAI GPT-4o as the primary provider with Anthropic Claude as a fallback, routed through the AI module's provider chain.

3. AI-Powered Content Generation

The ai_content module adds AI generation directly into Drupal's entity edit forms. Editors see a "Generate with AI" button on text fields that opens a sidebar with prompt controls:

  • Generate a first draft from a title and keywords
  • Summarise an existing long-form article into a teaser
  • Rewrite for a different reading level or tone
  • Translate content to another language via LLM
  • Generate meta descriptions and SEO titles

All generated content flows into the standard Drupal editorial workflow โ€” revisions, moderation states, audit trail โ€” so nothing bypasses your existing governance process.

4. Semantic Search with Vector Embeddings

Standard Drupal search is keyword-based. With the search_api module + an embeddings provider, you can build semantic search that understands meaning rather than matching tokens:

// Index content with embeddings (stored in pgvector / Pinecone / Weaviate)
$embedding = $ai->embeddings(
  provider: 'openai',
  model: 'text-embedding-3-small',
  input: $node->getTitle() . ' ' . $node->get('body')->value
);

// Semantic similarity search
$similar = $vector_db->query($embedding, limit: 10);

We've implemented this for a government knowledge base with 50,000+ documents โ€” semantic search reduced the "zero results" rate from 34% to under 4%, and user satisfaction scores improved significantly.

5. Automated Tagging & Classification

The ai_automator module can automatically apply taxonomy terms to content based on LLM classification. Configure a prompt template for each taxonomy vocabulary and enable auto-classification on content save:

# ai_automator config: topics_taxonomy
prompt: |
  Given the following article, suggest 3-5 relevant topic tags from
  this list: {{ taxonomy_terms }}

  Article: {{ node.title }} {{ node.body }}

  Return only a JSON array of tag names.

In production, this handles 90%+ of taxonomy assignments automatically, with human review only for low-confidence classifications.

6. AI Workflow Automation

Combine the AI module with Drupal's Rules module or ECA (Event-Condition-Action) for fully autonomous workflows. Examples we've deployed:

  • Incoming press releases automatically drafted into news articles with AI, placed in review queue
  • Product descriptions generated from structured field data at time of publish
  • Support tickets routed to the correct team based on AI intent classification
  • Image alt text generated automatically on media upload using vision models

7. Responsible AI in Editorial Systems

Every AI integration we build includes three safeguards:

  • Human in the loop: AI suggestions are always proposals, never automatic publishes
  • Audit trail: Every AI interaction is logged โ€” model, prompt, response, user, timestamp
  • Moderation: Content passes through the AI module's moderation plugin before surfacing to editors

The Drupal AI framework makes all three straightforward to implement via its built-in logging and moderation hooks.