UX for integrating AI into software
From the archive: first published on the original PCT WordPress blog on 10 October 2024.
To integrate a tool like GitHub Copilot into internal company tools and systems, you’ll likely want to follow common UX/UI patterns for embedding AI-based assistance. Here are some common patterns and approaches for UX when integrating Copilot-like tools:
1. Chat-like Interface:
- Tool Integration Example: Embed an interactive chat widget within your company’s tool (e.g., an IDE, web platform, or internal portal) to enable users to interact with Copilot-style assistance in real-time.
- Pattern: Place this chat widget in a sidebar or as an overlay.
- Interaction Flow:
- User asks the tool for suggestions or assistance (e.g., “How to implement a login system in Node.js?”).
- Copilot provides context-sensitive code snippets or suggestions.
- Allow users to accept, reject, or further refine the suggestions in the chat interface.
- UX Tip: Provide clear interaction options for “accept suggestion,” “modify,” or “more info.”
2. Command Palette or Contextual Menus:
- Tool Integration Example: Integrate Copilot commands into a command palette (like in Visual Studio Code) where users can trigger code suggestions within specific file types, functions, or UI elements.
- Pattern: Present as a dropdown or modal when triggered.
- Interaction Flow:
- User highlights code or places the cursor at the point where help is needed.
- From a context menu or command palette, they request Copilot assistance.
- Copilot provides a few relevant code block options.
- UX Tip: Give users shortcut keys to quickly access the feature without breaking their workflow.
3. Inline Suggestions:
- Tool Integration Example: Show inline suggestions directly as the user types, similar to how GitHub Copilot operates in IDEs like VS Code.
- Pattern: Integrate this directly into a company’s custom IDEs or internal coding environments.
- Interaction Flow:
- As the user types code, Copilot suggestions appear grayed out inline.
- Users can accept by pressing
Tabor reject by continuing to type.
- UX Tip: Ensure that suggestions do not clutter or overwhelm the interface, giving users the ability to toggle this functionality.
4. Adaptive Cards (Action Cards) with Dynamic Content:
- Tool Integration Example: When certain trigger conditions are met (like starting a new project or encountering an error), show an adaptive card (popup or modal) that provides Copilot suggestions for common fixes or code snippets.
- Pattern: Similar to Microsoft Teams adaptive cards or system notifications.
- Interaction Flow:
- A task or issue triggers an adaptive card that opens in the tool.
- The card contains code suggestions, buttons for “Try This,” “Get More Help,” or “Ignore.”
- The user can directly apply the suggestion from the card.
- UX Tip: Ensure the adaptive card provides clear and concise code actions relevant to the user’s current context.
5. Embedded API-Based Actions (CP API Plugin Approach):
- Tool Integration Example: Use an API plugin or CP (Copilot API) to directly hook into your internal systems or project management tools.
- Pattern: Embed Copilot’s suggestions within project management or CI/CD tools (like Jira, Trello, or internal DevOps pipelines).
- Interaction Flow:
- When a user opens a task in an internal project management tool, they see Copilot suggestions based on task descriptions or code requirements.
- Users can trigger Copilot to generate suggestions for code reviews, tests, or optimizations based on the project.
- UX Tip: Make sure the Copilot suggestions fit within the scope of the task at hand and offer users the ability to customize or refine them directly.
6. Integration into Documentation Tools:
- Tool Integration Example: Allow Copilot to suggest inline documentation or code snippets directly in your company’s internal documentation or knowledge base tools.
- Pattern: Present as a tool that provides auto-generated content when writing technical documentation.
- Interaction Flow:
- User writes documentation and Copilot suggests relevant code samples, explanations, or markdown content.
- Users can quickly insert and edit the content as needed.
- UX Tip: Provide the ability to highlight terms or concepts and ask Copilot to generate relevant code or explanations.
7. AI Pair Programming Mode:
- Tool Integration Example: Enable a “pair programming” mode in your internal development tools where Copilot operates as a real-time assistant, offering continuous feedback.
- Pattern: A sidebar shows live suggestions or alternative approaches to what the user is working on.
- Interaction Flow:
- User codes normally while Copilot provides alternate approaches or suggestions in real-time.
- The user can accept, reject, or modify Copilot’s input, creating a seamless collaborative environment.
- UX Tip: Offer toggles for different levels of assistance (from minimal nudges to more in-depth coding suggestions).
8. Task-Based Automation Flows:
- Tool Integration Example: Use Copilot as part of automated workflows (like code generation, testing, or refactoring tasks) where users can specify a task, and Copilot generates a solution or test case.
- Pattern: Use in combination with automation tools (e.g., Jenkins, GitLab CI, or an internal script runner).
- Interaction Flow:
- User specifies a task or bug fix they need.
- Copilot auto-generates the appropriate code and integrates it into the pipeline.
- UX Tip: Provide clear options for customization to prevent automation from becoming too generic.
UX Design Considerations:
- Intuitive Access: Ensure that users can easily trigger and control Copilot’s assistance with minimal friction.
- Non-intrusive Interface: Copilot suggestions should blend seamlessly into the workflow, not interrupt it.
- Adaptability: Let users customize the level of Copilot assistance, from full auto-completion to minimal suggestions.
- Feedback Loop: Include a feedback mechanism to let users easily report on the quality of suggestions.