circuit-board Leveraging AI in Drupal websites

Generative text AI like ChatGPT can boost productivity. Explore ways that you can use AI in creating content for Drupal sites.

One of the many benefits of using a popular, open source project like Drupal, the popular web content management system, is the pace of innovation. Drupal already has a growing number of free modules that can enhance your website with AI in a variety of ways. The potential enhancements include content generation as well as using AI to augment your content with generated metadata.

Drupal can also integrate AI-based vector search, for faster, more accurate results, as well as the ability to query for more complex data relationships than simple keyword matches. Currently most of Drupal's search-based AI integrations are built for the Pinecone vector database.

While the most popular Drupal modules integrate with OpenAI's ChatGPT, support for large language models (LLMs) from other vendors is available, including those from Google and AWS.

AI content generation

Directly within Drupal's content creation interface, you have the ability to to use a ChatGPT-style prompt to query for content, and have it automatically created by OpenAI. How well does it work? As anyone who has used ChatGPT to answer technical questions will tell you, there are some significant limitations.

For starters, the currently available models rely on a dataset that isn't up-to-date. At the time of this writing, the most recent data they rely on is from September 2021, more than 18 months ago. In a technical sense, this is a lifetime.

screenshot of ChatGPT
ChatGPT doesn't know anything about LangChain (screenshot: Martin Anderson-Clutz)

Furthermore, these AI models are optimized to return a result that will be "acceptable" rather than accurate. In technical writing, this is a crucial distinction. Today's AI models may be useful for generating answers for general topics like "What is a Content Management System?" but for anything more technically nuanced, they are currently unreliable.

screenshot of ChatGPT
query "What is a Content Management System?" (screenshot: Martin Anderson-Clutz)

As such, these models don't currently pose any significant risk of being able to replace anyone writing about their own particular area of expertise. They might be useful for general explanations of high level concepts, but for the kind of in-depth analysis likely to generate real interest, an actual person with up-to-date knowledge is a definite requirement. As a writer, you may even find that AI models can help to generate the introductory content, allowing you to focus on the more in-depth explorations you're passionate about.

In short, current AI models have some significant limitations when it comes to generating content. You can work around some of that with the right expertise, but a combination of a growing ecosystem of tools around AI and a quickening cadence of AI improvements mean that this is no time to be complacent.

AI content transformation

The good news is that we don't have to rely on AI to generate content for it to be useful. Even using content created by a human, AI can transform content in a variety of very useful ways. For example, it can change the tone of some or all of your content. If there's a section of your content you want to sound less technical, or more professional, AI can help.

Explain it to me like I'm 5 (before)Explain it to me like I'm 5 (after)
before and after - explain it to me like I'm 5 (screenshot: Martin Anderson-Clutz)

If you want your content to be available in multiple languages, AI can help with that, too. You can translate some or all of your content in just a couple of clicks. Is this translation capability mature enough to be relied on? Particularly for technical topics, automated translation should always be reviewed by a native speaker, but getting a first draft created in seconds can be a big time saver.

creating a translation
creating a translation (screenshot: Martin Anderson-Clutz)

When you don't rely on AI as the source of truth, it actually becomes more useful. It can be much more reliable in generating variations of your human-generated content: in a different tone, a different language, and more.

AI content augmentation

In my opinion, the most exciting application of AI for writers is for generating complementary metadata. Given a set of content, AI can suggest a summary, to display in content listings, on-site search results, or even meta tags that are ingested by search engines like Google. It can also suggest a set of tags to apply, or even suggest a title. Website content architectures are often built expecting values for these kinds of fields, so populating them with minimal effort by the writer is a win for everyone, including site visitors.

suggesting multiple title options
suggesting multiple title options (screenshot: Martin Anderson-Clutz)
creating a summary
creating a summary (screenshot: Martin Anderson-Clutz)
suggesting tags - keyword extraction
suggesting tags - "keyword extraction" (screenshot: Martin Anderson-Clutz)