The compact Mode selector in the Drupal Canvas AI message box toolbar
The Drupal Canvas AI message box toolbar with the microphone beside the Mode dropdown
The microphone in the chat message box, under the words to be sent
The Mode list at the top of the Drupal Canvas AI panel, showing all available modes
The Mode dropdown settings: the switch that offers the dropdown, and the four places it can appear in the Drupal Canvas AI panel
The Microphone settings: the switch that offers a microphone in the chat, and the four places it can sit
The Reading replies aloud settings: the switch, reading language, voice, pitch, speed and volume

This project is not covered by Drupal’s security advisory policy.

AI Agent Modes puts a simple Mode dropdown in front of your AI assistant, so you can tell it what kind of job you want done before you start typing.

Pick "Page Builder Only" and the assistant builds pages. Pick "Content Types & Fields" and it works on your content structure. Leave it on "All" and it decides for itself, exactly as it does today.

Why it helps

An AI assistant that can do everything has to consider everything. The more jobs it knows about, the more it has to read before it answers, and the more likely it is to wander off or invent something that does not fit your site.

Choosing a mode narrows the job. The assistant is pointed at the handful of skills that matter for that task, so it stays on topic and gives steadier results. Nothing is taken away: the assistant keeps all of its abilities and is simply steered towards the right ones.

What you get

  • A Mode dropdown next to the chat box, listing the modes your site offers.
  • Your choice sticks for the rest of the conversation, so you set it once and keep working.
  • Modes you can create, name and edit yourself, and share between sites as configuration.
  • A settings screen to choose where the dropdown sits: at the top of the panel, above the message box, under the message box, or tucked into the toolbar.
  • A switch to turn the dropdown off altogether, for a site that scopes its assistant by configuration instead.
  • Modes you can offer for selected AI Assistants, rather than for every assistant backed by the same agent.
  • A microphone in the chat, so you can dictate instead of typing, and replies read aloud when you want them. Both stay off until you switch them on.

Tips and things to know

Note: The selector only appears when there is more on offer than the free-form default. Create at least one mode, or make sure the parent assistant has live sub-agents, otherwise the dropdown stays hidden.

Note: A mode choice is remembered in Drupal's private temporary store rather than saved as a permanent setting. Each person chooses independently, and the choice is not carried over forever.

Tip: By default a mode only steers: it adds an instruction and the assistant keeps every tool. A mode set to Scope strength: restrict also withholds the sub-agent tools it does not name, and a site-wide Enforce tool scope switch turns that off without editing any mode. Withholding narrows what the model is offered, so it is not an authorisation boundary: every tool still authorises itself when it runs.

Where it appears

  • Drupal Canvas AI: the dropdown appears in the Canvas AI panel while you build pages.
  • AI Assistant chatbot: the dropdown is added to the assistant chat.
  • Anywhere else: place the "AI Agent Mode selector" block next to any AI chat on your site.
  • One AI Assistant at a time: an assistant's own form decides the microphone, where it sits, reading replies aloud, and where its mode dropdown appears, each falling back to the site setting.

Speaking and listening

The chat can offer a microphone and dictate what is said into the message box, and it can read each reply aloud. Both use the browser's own Web Speech support, so this module sends nothing to any service and needs no key. A Chromium-based browser recognises in the cloud, so the audio leaves the machine through the browser, and the settings form says so rather than promising locality.

  • Four places the microphone can sit, following the writing direction, and clear of the send button and the mode dropdown.
  • Dictation language, words shown as they are recognised, sending after a pause in speaking, voice commands, and corrections for words the recogniser mishears.
  • Reading language, voice, pitch, speed and volume, with the voice list filled in by the browser and each entry saying whether it speaks on the device or online.
  • Both directions ship off, and an update never switches them on by itself.

Managing modes

Site administrators manage everything at Configuration > AI > AI Agent Modes. The Modes tab lists each mode, which assistant it belongs to, the skills it covers, and whether it is switched on. The Settings tab is grouped as Mode dropdown, Microphone, Reading replies aloud and Tool scope. A dedicated "administer ai agent modes" permission keeps this in the hands of the people who should have it.

Getting started

  1. Install the module. It needs only the AI and AI Agents modules.
  2. Go to Configuration > AI > AI Agent Modes to review the modes your site has.
  3. Open your AI assistant and pick a mode from the dropdown before you type.

If your site uses Drupal Canvas, a starter set of modes for page, section, component and pattern work is added for you when the matching Canvas agents are present. Otherwise you start with the free-form default and add your own modes.

Documentation

The full documentation covers choosing a mode while you work, managing modes and where the dropdown can sit, developing against the configuration entity, and the behaviors that look like faults and are not.

Supporting organizations: 
Initial building, ongoing maintenance and development

Project information

Releases