Add Duo Chat Architecture Blueprint Documentation
Why is this change being made?
This merge request adds comprehensive documentation for GitLab's Duo Agentic Chat feature - the core conversational AI interface within the AI Panel. The documentation explains the current architecture challenges and defines the target architecture for data flow, streaming, and component design.
The key architectural decisions covered include: using Apollo Client's cache as the single source of truth for state management, decoupling WebSocket streaming from component lifecycle via a StreamManager service pattern, persisting agent and model selection in localStorage/cookies to support external triggers, and defining clear chat state terminology (New, Current, Old) for thread management.
The documentation also details how external triggers (like the troubleshoot button on pipeline pages) interact with the chat system, requiring certain state to be accessible before the chat component mounts. It covers the navigation rail integration where agent selection lives in the rail while model selection is in the input area.
The design addresses critical issues including streams being severed when users navigate away mid-response, inconsistent data flow patterns (props, events, Vuex, Vue.observable), and the duo-ui npm library slowing development. The blueprint documents the transition path to shadcn-based components mounted as web components for faster iteration.
Future enhancements documented include SharedWorker for even more resilient streaming that survives page navigation, and UI improvements like expandable input boxes for larger prompts.
Author and Reviewer Checklist
Please verify the check list and ensure to tick them off before the MR is merged.
- Provided a concise title for this Merge Request (MR)
- Added a description to this MR explaining the reasons for the proposed change, per say why, not just what
- Copy/paste the Slack conversation to document it for later, or upload screenshots. Verify that no confidential data is added, and the content is SAFE
- Assign reviewers for this MR to the correct
- The when to get approval handbook section explains when DRI approval is required
- The who can approve handbook section explains how to identify the DRI
- If the MR does not require DRI approval, consider asking someone on your team, such as your manager.
- The approver may merge the MR. If they approve but don't merge, you can merge.
- For transparency, share this MR with the audience that will be impacted.
- Team: For changes that affect your direct team, share in your group Slack channel
- Department: If the update affects your department, share the MR in your department Slack channel
- Division: If the update affects your division, share the MR in your division Slack channel
- Company: If the update affects all (or the majority of) GitLab team members, post an update in #whats-happening-at-gitlab linking to this MR
- For high-priority company-wide announcements work with the internal communications team to post the update in #company-fyi and align on a plan to circulate in additional channels like the "While You Were Iterating" Newsletter
Commits
- Add Duo Chat Architecture Blueprint Documentation