Support config-based default questions for agents (foundational and custom)
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Support config-based default questions for agents (foundational and custom)
Problem
Currently, Gitlab::Duo::Chat::DefaultQuestions provides questions based on:
- Resource context (issue, merge request, commit, etc.)
- URL context (code pages get CODE questions, others get DEFAULT)
However, with the introduction of agent-specific flows and the expectation of 20+ foundational agents in the coming months, we need a configuration-based approach for agent-specific default questions rather than hardcoding them in the Rails codebase.
Current limitations:
- Hardcoding questions in
DefaultQuestionsclass doesn't scale to 20+ agents - Custom agents (stored in AI Catalog) have no way to define their own default questions
- Foundational agents (defined in
FoundationalChatAgentsDefinitions) have no place for default questions - No unified approach for both foundational and custom agents
Below are example default questions/prompts for each agent type that should be configurable:
1. GitLab Duo (General Chat Agent)
default_questions: [
"What does this code do?",
"How can I make this code more efficient?",
"Identify any security vulnerabilities in my code",
"Are there any bugs in this code?",
"Create documentation for this code"
]
2. Security Analyst Agent
default_questions: [
"What vulnerabilities are in my project?",
"Analyze the severity of these vulnerabilities",
"Help me triage these security findings",
"Create an issue for this vulnerability"
]
3. Analytics Agent
default_questions: [
"How many merge requests were merged this month?",
"What is the average time to merge?",
"Show me pipeline success rates",
"Analyze project activity trends"
]
4. Code Review Agent
default_questions: [
"Review this merge request for code quality",
"Check for potential bugs in this code",
"Suggest improvements for this implementation",
"Verify this code follows best practices"
]
5. Pipeline Fix Agent
default_questions: [
"Why is my pipeline failing?",
"Fix the failing job in my pipeline",
"Optimize my CI/CD configuration",
"Debug this pipeline error"
]
6. Issue to MR Agent
default_questions: [
"Create a merge request for this issue",
"Implement the requirements from this issue",
"Generate code to address this issue",
"Plan the implementation for this issue"
]
7. Software Development Agent
default_questions: [
"Help me implement this feature",
"Refactor this code for better maintainability",
"Add tests for this functionality",
"Optimize this code for performance"
]
8. Planner Agent (Foundational)
default_questions: [
"What are the key priorities for this project?",
"Help me organize this epic into smaller issues",
"What dependencies exist between these work items?",
"Summarize the progress on this milestone"
]
Edited by 🤖 GitLab Bot 🤖