[META] AI background / autonamous agents
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3560619. -->
Reported by: [guptahemant](https://www.drupal.org/user/3278073)
>>>
<p>[Tracker]<br>
<strong>Update Summary: </strong>Background Agent Processing - We have a plan for the intial preparation of background agents<br>
<strong>Short Description: </strong>Allows Agents to work on the sever without direct user involvement enabling many automation features such as firing on cron or in response to content changes. Includes significant Architecture improvements.<br>
<strong>Check-in Date: </strong>07/12/2025<br>
<strong>Additional Collaborators:</strong> @guptahemant, @harivansh<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>Define and refine the process for running background Ai agents:</p>
<h4 id="summary-steps-reproduce">Steps to reproduce (required for bugs, but not feature requests)</h4>
<p>Please provide information like AI modules enabled, which AI provider, browser, etc.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p><strong>Preparation Work for Background Agents</strong><br>
This is the initial work to improve the existing AI Agents to be ready to do background agents properly.</p>
<ul>
<li><span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/ai/-/work_items/3560792" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/ai/-/work_items/3560792</a></span> 1 day</li>
<li><span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/ai_initiative/-/work_items/3560627" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/ai_initiative/-/work_items/3560627</a></span></li>
<li>Depending on if what we decide: (Current view is this should happen first) <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-1"><a href="https://www.drupal.org/project/ai/issues/3556141" title="Status: Active">#3556141: [Meta] Move and improve AI Agents in AI Core roadmap</a></span> </li>
<li><span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-1"><a href="https://www.drupal.org/project/ai/issues/3493260" title="Status: Active">#3493260: Add Symfony Messenger Integration Module to AI module</a></span> to allow for a more effective background queuing system. 1 month. <strong>LUCA</strong> - Can edit this issue, or create a new one, or even create a whole new module.</li>
<li><span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/ai_initiative/-/work_items/3562010" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/ai_initiative/-/work_items/3562010</a></span> - <strong>Harivansh and Hemant</strong></li>
<li>We need a permissions system so Agents have their own permissions given that a user will be necessarily be firing them off.</li>
<li>Explore any security considerations with the move to symfony and long running processes (Memory leaks?)</li>
</ul>
<p><strong>Necessary Deliverables.</strong><br>
These are the deliverables unique to specifically handling background autonamous agents.</p>
<ul>
<li>We need reports to track progress of AI Agents and Agent Flows in real time and historical.</li>
<li>We need to create processes and UIs for firing off these background agents. (For example via ECA, or flowdrop or incoming MCP requests)</li>
<li>We need a developer inteferface (dispatch interface) and documentation for others to utilise backgrounds into their processes and UIs</li>
<li>We need at least some basic reporting screens to see the changes Agents have made (Probably use core content moderation screens).</li>
</ul>
<p><strong>Medium Term</strong><br>
These are needed to support the more complex Agents in Drupal CMS.</p>
<ul>
<li>Background Agents may need access to something like Chromephp if their tasks involve manually controlling javascript front-ends</li>
<li>Background Agents may need some method of visually seeing the results of its work via somehting like Chromephp, playright or other methods of sending screenshots to it in a headless environment.</li>
<li>Allow for Canvas AI background Agents.</li>
<li>Integrating backgrounds with ECA</li>
<li>Integrating background Agents with Flowdrop</li>
<li>Create a basic UI for simple background agents without complex workflow, with some simple triggers.</li>
<li>Notifications systems for Background Agents including E-mail, on screen, reporting, etc.</li>
</ul>
<p><strong>Future Deliverables:</strong></p>
<ul>
<li>This is linked but we don't need to do the full move only a bit of <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-1"><a href="https://www.drupal.org/project/ai/issues/3538499" title="Status: Active">#3538499: [Meta] Use Symfony AI</a></span></li>
<li>Create a plan for the full move of AI module / Agents Runner to symfony with time estimates and approval from the Symfony AI leadership.</li>
<li>Triggers to allow AI Agents to trigger background agents.</li>
<li>Create features and reporting for enabling outsouring the AI Agent processing to external machines (such as multiple AWS instances)</li>
<li>Background Agents will need secure access to the Drupal Database (Might be OOB)</li>
<li>Create simple processes for caching some aspects of Drupal's database so background agents can scale further off the cached DB (eg with Redis)</li>
<li>Improve the AI Agent Runner to allow a mixture of Determinisc and Agentic flows allowing it to potentially be a unifed runner for ECA, FlowDrop and Meastro.</li>
<li>Bring the AI Agent Runner into Symfony AI itself (if they want it) and move Drupal AI Agents to being built on top of Symfony AI Agents.</li>
<li>Allow Tasks to be run without a full Drupal bootstrap<a href="https://www.alexandervarwijk.com/blog/2025-09-08-proposal-restructuring-drupals-internals">https://www.alexandervarwijk.com/blog/2025-09-08-proposal-restructuring-drupals-internals</a></li>
</ul>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<h3>Optional: Other details as applicable (e.g., User interface changes, API changes, Data model changes)</h3>
> Related issue: [Issue #3560054](https://www.drupal.org/node/3560054)
issue