Drupal Advent Calendar day 23 - AI Track

By james, 23 December, 2024
Door 23 contains a computer chip with a brain

Welcome back for the penultimate door of this year’s Drupal Advent Calendar, and today we’ve recruited the legendary Mike Anello to bring us up to speed on a big topic, the AI track of Drupal CMS.

The stated goal of the AI track is to make it easier for non-technical users to build and extend their sites - it is really interesting to note that this is mainly geared towards admin-facing UI, not site user-facing AI. With that in mind, let’s take a look at what is included (so far!)

AI generated alternate text for images

With virtually no configuration (other than entering your LLM API key) the recipe adds a Generate with AI button for image fields’ Alternate text. Upload an image, click the button and you’ve got an AI-powered suggestion for the image’s alternate text field.

Screenshot of using AI to generate alternative text
The entire generated Alternative text reads, “Man holding a glass of amber drink at a festive, illuminated market.”

Drupal Agent Chatbox

Again, with virtually no configuration, once the recipe is applied, the site’s admin area has easy access to the Drupal Agent Chatbox. If you watched Dries Buytaert’s keynote address from DrupalCon Barcelona, this was definitely one of the highlight demonstrations - simply ask the chatbox to create a content type and some fields and it takes care of the rest.

The chatbox is currently limited to creating content types, fields, and vocabularies. Here’s an example of it creating a vocabulary and terms for me:

Screenshot of chat sequence generating
Chatbot generating a taxonomy vocabulary

Using it is really quite impressive, as it almost always determines the field type I intended. In the short time I’ve been testing it, I feel like it has been training me into providing the necessary amount of context to get what I’m looking for. 

Is it ready to replace me as a site-builder? Hardly. Is it ready to help me work faster and more efficiently? Indeed it appears that way…

What exactly does the recipe include?

Modules

Configuration

  • Basic configuration for AI Image Alt Text and AI agents
  • Installation of the Drupal Agent Chatbox in the admin theme
  • Content editor permission to generate AI alt tags
  • Configuration for the Drupal Agent Chatbox (including the default LLM prompts)

What setup is required?

At this point in time, only an API key for either OpenAI or Anthropic. In the (near?) future, the AI recipe will provide a link from the site dashboard to a form provided by the AI simple provider installer module to enter the API key.

Who is working on the AI track?

The track lead is Jamie Abrahams (yautja_cetanu) with assistance from Marcus Johansson (marcus_johansson) and many others. As the team progresses (with the AI module in general), they’ve found that the more folks that use it, the more effort goes into making it as robust as possible. Jamie says,

We’ve found with more eyes that we really need to put a great deal of effort to making them robust and work with the wide variety of prompts people will throw at it. 

There are a lot of views on exactly how the agents should interact with fields and so governance is becoming more important. Should the AI give detailed and accurate explanations on what it’s done or should it give easy to understand? Should we have a UI for rollback or should we let the ai undo things? 

What is on the roadmap for future AI additions to Drupal CMS?

Unsurprisingly, lots of stuff including: better support for the Media module, assistance with data migrations, Views integration, Experience Builder integration, Project Browser integration, and CKEditor integration. Jamie adds,

We’ve been focusing on making the agents really robust and building tools to help debug the tools, give you feedback before things are implemented and improving logging. 

We’ve got some really cool stuff we’re hoping to announce at [DrupalCon] Atlanta.

Related, see this task related to a tool for allowing site-builders who use Drupal AI modules to evaluate how well the tools are actually working. 

Mile holding a glass of amber drink at a festive, illuminated market.Mike Anello is co-founder of DrupalEasy, providing long form training courses for Drupal professionals. Mike has spoken and run training sessions at many events around the world, and was presented with the 2024 Aaron Winborn award at DrupalCon, Portsland. He is also an active member of the mentoring community, and contributes to several modules.

Comments

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.