All logs
No. 016DEC 03, 20265 MIN READ

Your Drupal Content Can Now Answer Questions on Any Website

Copy 1 snippet from Drupal and your content answers questions on any website, with sources. That's AI Answers 1.1.

Your Drupal Content Can Now Answer Questions on Any Website
Singapore, 2024

Every café owner answers the same questions all day. How long do the brownies keep? Is the quiche vegetarian? Do you deliver? Can I bring my dog?

AI Answers is a module I work on. It answers those questions from your own content and shows where each answer came from. Version 1.1 is coming, and it adds a lot. To show it, we built a small demo café called “the kitchen”. Here is a week in its life.

Morning: a customer asks the website

The kitchen’s website runs on WordPress. Its recipes live in Drupal. On the website there’s an “Ask the kitchen” page.

A customer asks “Is there a vegetarian quiche?”. The answer comes from the kitchen’s own quiche recipe, with a [1] that links to it. Nothing is made up from the internet.

The Ask the kitchen page on a WordPress site, answering a question about a vegetarian quiche with a linked source
The café's WordPress site. The answer and the source come from Drupal.

The next customer asks “How long do brownies keep?”, then “Can I freeze them?”. It knows “them” means brownies, the same way the person behind the counter would. They leave a thumbs up.

A follow-up question about freezing brownies, answered with a source

The owner’s setup: 1 snippet

Getting this on the website took 1 copy and paste. The owner copies a snippet from Drupal and pastes it into a WordPress page. The same works on any website.

Only the café’s own website can use it. Any other site that tries gets turned away. There’s also a limit on how many questions 1 visitor can ask in a few minutes, so nobody can run up the AI bill with a script.

The placement form in Drupal with the embed snippet and a Copy snippet button

Closing time: the notebook

Every question goes into a log, like a notebook by the till: what was asked, whether it got an answer, the thumbs up or down, and where it was asked.

My favourite column is Had the information. After each answer, AI checks whether the kitchen’s content really covered the question, and if not, what was missing.

The AI Answers log with each question, its feedback, where it was asked and a Had the information column

End of the week: a pattern

The kitchen is a demo, so its 300 questions are generated, not real customers. Everything here works on a real Drupal site, though.

Reading 300 questions one by one isn’t fun. So every question gets a topic from a list the owner picks: Recipes, Opening hours, Visiting, Pricing and so on.

The AI Answers tags report with a count of questions per topic

Now the pattern is easy to see. 45 questions found nothing to answer from. And “Shipping and delivery” never comes up as a topic, because the kitchen has never written a word about delivery. People keep asking, and the website stays quiet.

Monday: the to-do list

This is the part I’d want as a café owner. The Content gaps page lists every question the kitchen couldn’t answer. 1 click on Evaluate content gaps with AI groups them into topics and suggests what to write.

The content gaps page with an AI analysis grouping unanswered questions into topics with suggested content

For the kitchen: delivery and shipping 9 questions, parking 7, discounts 6, pets 5, payment methods 5. That’s the owner’s writing list for next week. Add a delivery page, and next time the website answers.

Bonus: other AI assistants can ask too

More and more people ask an AI assistant instead of opening a website. AI Answers now works as a set of tools that those assistants can use. They can ask the kitchen and get the same answer, with the same sources, that a visitor on the website gets.

Tool Explorer listing the 3 AI Answers tools: Search content, Ask a question and List answer agents

Under the hood, for Drupal folks

All of this is merged into the 1.1.x branch. There’s no 1.1 release yet.

  • Embedding on other sites, with an origin allowlist and rate limits: #3615766
  • The per-question log: #3615759, and the “had the information” check, opt-in per agent: #3615779
  • Tagging with taxonomy terms, on cron: #3615760, and sorting unanswered questions into expected, vague or noise: #3615787
  • Content gaps: #3615761
  • Tool API tools for MCP clients: #3615763
  • drush ai-answers:ask --no-log, to ask as an anonymous visitor without logging it: #3615777
  • The demo data generator: #3615781

If you want to know how it finds its sources, I wrote about that after DrupalCon Rotterdam.

What’s next, and where to help

The 1.1 work is split into 4 milestones: the embeddable widget, insights, suggested questions as you type, and grouping similar questions so answers can be cached. The board shows what’s in review.

Everything open is in the issue queue. Small ones to start with: the focus outline on host pages (#3615800) and keeping the wait time in the rate-limit message (#3615799). Reviews help too, like the insights dashboard (#3615780).

Thank you

This came together in the issue queue. Joonas Meriläinen (Mearra) wrote most of the code, with Pravesh Poonia (OpenSense Labs) and Konstantine Kirkitadze (Omedia). Reviews and testing came from Tomi Mikola (Mearra), Abhinav Jha (OpenSense Labs), Ahmad Khalil (ImageX), Ricardo Castañeda (SeeD EM), Levente Besenyei, Adam Herczeg and last but not least, the most important ones Arian Raeesi, Vidit Anjaria for helping manage everything in the Drupal AI Initiative. Oh yes also me 😅 and thanks to Dropsolid AI for sponsoring my time.

Count the companies in that list: 6 of them, plus a few more people, all on 1 module. No single company decides how Drupal gets ready for AI. It happens in the open, in issue queues like this one, with whoever shows up. That’s the part of Drupal I love most.

Want this for your café?

Or your shop, school or council website? Find me on Drupal Slack (abhisekmazumdar).

ps: no brownies were harmed in this demo. They keep 4 days in a tin, apparently.