This project is not covered by Drupal’s security advisory policy.
Gives the Drupal Canvas Page Agent (drupal_canvas_page_agent) access to the site's AI context items, such as page building guidelines, brand guidelines and site facts.
What the recipe does
- Installs
ai_agents,ai_context,canvas,canvas_aiandcanvas_dev_ai, and imports their configuration.canvas_dev_aiprovides the Canvas Page Agent. - Adds an "Available context items" default information tool to the agent. It runs
ai_context:list_ai_context_itemson every request and gives the agent the ID, label and purpose of each context item. - Adds the
ai_context:load_ai_context_item_by_idtool to the agent, so it can load the full content of the items it needs. The tool'stask,max_tokensandinclude_subcontextparameters are hidden from the agent. - Sets the AI Context max token budget (
ai_context.settings:max_tokens), 10000 by default. The module default of 1200 truncates loaded items. - Registers the agent as an AI Context consumer with automatic context injection turned off, so context reaches the agent only through the list and the load tool.
The recipe replaces the agent's whole list of default information tools. Any changes made to that list on the site are lost when the recipe is applied.
Requirements
- Grant the
access published ai contextpermission to every role that uses the Canvas Page Agent. Without it, the agent cannot list or load context items.
Applying
drush recipe ../recipes/canvas_ai_context
To set the max token budget without the prompt:
drush recipe ../recipes/canvas_ai_context --input=canvas_ai_context.max_tokens=10000 -n
Project information
- Created by akhil babu on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
