diff --git a/backend/app/agents/devrel/prompts/react_prompt.py b/backend/app/agents/devrel/prompts/react_prompt.py index 12195d96..58da8c8b 100644 --- a/backend/app/agents/devrel/prompts/react_prompt.py +++ b/backend/app/agents/devrel/prompts/react_prompt.py @@ -1,4 +1,6 @@ -REACT_SUPERVISOR_PROMPT = """You are a DevRel AI assistant. Use ReAct reasoning: Think -> Act -> Observe. +REACT_SUPERVISOR_PROMPT = """You are a DevRel AI assistant. +You have been activated because a user requires specific assistance. +Use ReAct reasoning: Think -> Act -> Observe. CURRENT SITUATION: - User Message: {latest_message} diff --git a/backend/app/agents/devrel/prompts/summarization_prompt.py b/backend/app/agents/devrel/prompts/summarization_prompt.py index 470e7750..83b762ba 100644 --- a/backend/app/agents/devrel/prompts/summarization_prompt.py +++ b/backend/app/agents/devrel/prompts/summarization_prompt.py @@ -11,7 +11,7 @@ Instructions: 1. Create a NEW summary combining existing and recent conversation -2. Focus on user's technical interests, problems, and experience level +2. Focus on capturing the user's specific technical intent, questions asked, and problems solved 3. Keep under 300 words 4. Include relevant context for future interactions diff --git a/backend/app/classification/prompt.py b/backend/app/classification/prompt.py index 5b458d3b..02e33713 100644 --- a/backend/app/classification/prompt.py +++ b/backend/app/classification/prompt.py @@ -4,23 +4,40 @@ Context: {context} -DevRel handles: -- Technical questions about projects/APIs -- Developer onboarding and support -- Bug reports and feature requests -- Community discussions about development -- Documentation requests -- General developer experience questions +CRITICAL INSTRUCTIONS: +The DevRel Agent is a SPECIALIZED technical assistant. It must NOT interfere in normal human conversation. +It should ONLY be activated if one of the following conditions is met: + +1. **DIRECT MENTION**: The user explicitly tags or names the bot (e.g., "@Devr.AI", "bot", "assistant"). + - Action: `needs_devrel: true` + - Priority: `high` + +2. **TECHNICAL SUPPORT**: The user asks a specific technical question about the project, code, API, or installation. + - Example: "How do I set up the environment?", "I'm getting a build error", "Where is the API doc?" + - Action: `needs_devrel: true` + - Priority: `medium` + +3. **CONTRIBUTION/COMMUNITY**: The user asks about contributing, PRs, issues, or community guidelines. + - Action: `needs_devrel: true` + - Priority: `medium` + +**IGNORE (needs_devrel: false)**: +- General greetings ("Hi", "Hello", "Good morning") unless tagged. +- Social chatter ("How are you?", "This is cool", "lol") unless tagged. +- Discussions between users that don't involve the project specifics. +- Vague statements without a clear question. Respond ONLY with JSON: {{ "needs_devrel": true/false, "priority": "high|medium|low", - "reasoning": "brief explanation" + "reasoning": "Brief explanation of why it fits/excludes criteria" }} Examples: -- "How do I contribute?" → {{"needs_devrel": true, "priority": "high", "reasoning": "Onboarding question"}} -- "What's for lunch?" → {{"needs_devrel": false, "priority": "low", "reasoning": "Not development related"}} -- "API is throwing errors" → {{"needs_devrel": true, "priority": "high", "reasoning": "Technical support needed"}} +- "Hi everyone!" → {{"needs_devrel": false, "priority": "low", "reasoning": "General greeting, no tag"}} +- "@Devr.AI Hi!" → {{"needs_devrel": true, "priority": "high", "reasoning": "Direct mention"}} +- "I'm getting a 500 error on /api/login" → {{"needs_devrel": true, "priority": "medium", "reasoning": "Technical support"}} +- "I think we should use React" → {{"needs_devrel": false, "priority": "low", "reasoning": "Opinion"}} +- "How do I submit a PR?" → {{"needs_devrel": true, "priority": "medium", "reasoning": "Contribution question"}} """