doc/development/duo_agent_platform/agent_interaction_patterns.md
This guide establishes interaction patterns and rules for agents and flows within GitLab. These patterns ensure consistent, user-friendly behavior while managing infrastructure load and maintaining a high-quality user experience.
This guide targets GitLab-managed agents and flows. The patterns should also extend to custom agents created in the AI Catalog.
Behavior Pattern: When a flow or agent begins work on an issue or MR, create an initial comment to signal activity.
Resources:
Behavior Pattern: While an agent is actively working on a task, it should update a single comment rather than creating multiple new comments.
Resources:
Behavior Pattern: When an agent completes its work or requires human review and follow-up actions, create a new comment with a summary and next steps, and mention the relevant user.
Resources:
Behavior Pattern: When a flow completes (successfully or with errors), always post a summary comment to the work item.
Resources:
Behavior Pattern: Agents use mentions the way a human would: to communicate important information to team members who they are collaborating with, while taking care not to create unnecessary noise for others.
Rationale:
Behavior Pattern: Agents should rely on the Sessions section for logging detailed, real-time progress tracking, while using comments for milestone notifications and summaries. Users shouldn't have to go into the Sessions tab for all of their flows. They will use the Sessions tab for troubleshooting and other deeper analysis activities, as well as for managing Sessions asynchronously when they are no longer on the work item or MR related to the Session.
Content to Show In Sessions tab:
Content to Show In Work Item and MR Comments:
This is an example on how this could look like in a single agent's prompt:
COMMENT BEHAVIOR:
* Create ONE initial status comment when you start
* Update that same comment with your progress
* Create a NEW comment when you complete or need review
* Always mention users in completion/review comments
* Never mention users in progress updates
FINAL SUMMARY:
* Always post a final summary when done
* Include what you did, results, and next steps
* Link to the full session details
These patterns help manage load by:
As the Agent Platform evolves, we may need to address:
If you need help extending these patterns or introducing new ones, you should reach out to the Product Design team and the Agent Foundations team, so that you can design a new pattern together and add it into this document for future use.