Add a single global context, making Vienna Driesnote AI demos much simpler
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3555225. -->
Reported by: [tedbow](https://www.drupal.org/user/240860)
Related to !11
>>>
<p>[Tracker]<br>
<strong>Update Summary: </strong>Add a single global context, making Vienna Driesnote example much simpler<br>
<strong>Check-in Date: </strong>MM/DD/YYYY<br>
<strong>Additional Collaborators: </strong> @kristen pol, @tedbow<br>
<em>Metadata is used by the <a href="https://www.drupalstarforge.ai/" title="AI Tracker">AI Tracker.</a> Docs and additional fields <a href="https://www.drupalstarforge.ai/ai-dashboard/docs" title="AI Issue Tracker Documentation">here</a>.</em><br>
[/Tracker]</p>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>Watching the Driesnote from Vienna 2025 <a href="https://www.youtube.com/live/WNEyg3UKTVQ?si=m9tP0ULg-G4dzyT3&t=3525">https://www.youtube.com/live/WNEyg3UKTVQ?si=m9tP0ULg-G4dzyT3&t=3525</a>, it focused on simply adding a context that "all the AI agents in Drupal have access to this context" and context being updated by "site builders and marketers"</p>
<p>I think the way the contexts are set up now in the module achieving this would be fairly complicated but it could be made much easier by adding a single "global" context in addition to the current contexts.</p>
<p>The problems</p>
<ol>
<li>Achieving "all the AI agents in Drupal have access to this context" is difficult. For a site with just a few agents this may be simple but you have to go to admin/config/ai/ai-context/pools and edit every agent to assign the context to each one
<p> Also every time a new module is installed or an existing module is updated it may provide a <strong>new</strong> agent. In this case the site builder would have to add the context to every new agent manually (this doesn't seem like something a marketer should be expected to do)</p></li>
<li>Marketers would be expected to know how to make a context available to every agent. While we can expect a site builder to be able to figure this out or read the docs it seems overly complicated for someone who does not know how agents work to figure this out.</li>
<li>Dries compared the contexts to a "claude.md" file. Although you can make multiple claude.md files in different directories, the simplest set up is to put 1 in the base of your project and it is always in effect. Nothing more to set up, nothing else to think about. Conceptually the contexts as set up now are not as simple
</li></ol>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<ol>
<li>Leave the existing contexts behavior the way it currently is</li>
<li>Add a new single global context, this would always be included and would not require any other setup</li>
<li>Add a new "edit global context" permission. This would allow editing only the new global context</li>
</ol>
<p>This would allow a marketer to be assigned the "edit global context" permission and have a single text area to edit which affects all AI operations on their site</p>
<p>For many sites editing the global context might be enough, like editing a single claude.md file. Other sites could still take advantage of making certain contexts available for only certain agents</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<h3 id="summary-ui-changes">User interface changes</h3>
<p>New Global Context form and menu item</p>
<h3 id="summary-api-changes">API changes</h3>
<h3 id="summary-data-model-changes">Data model changes</h3>
> Related issue: [Issue #3559379](https://www.drupal.org/node/3559379)
issue