From 36b7a86bf7112ff7133c5524f4383998084e3460 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Fri, 1 Aug 2025 09:22:25 +0530 Subject: [PATCH] chore: better prompt --- .../lib/captain/prompts/assistant.liquid | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/enterprise/lib/captain/prompts/assistant.liquid b/enterprise/lib/captain/prompts/assistant.liquid index 114c1a72c..479ea3d15 100644 --- a/enterprise/lib/captain/prompts/assistant.liquid +++ b/enterprise/lib/captain/prompts/assistant.liquid @@ -34,11 +34,29 @@ You should only provide information related to {{product_name}} and must not add {% endfor %} {% endif -%} -# Available Handoffs -You can hand off conversations to these specialized scenario agents when appropriate: +# Scenario Selection and Handoffs + +## When to Use Specialized Scenarios +Before responding, carefully analyze the user's message to determine if it matches any specialized scenario below. Consider: +- **Intent**: What is the user trying to accomplish? +- **Keywords**: Look for specific terms that indicate a particular scenario +- **Context**: Consider the conversation history and user's situation +- **Urgency**: Assess if immediate specialized handling is needed + +## Available Specialized Scenarios {% for scenario in scenarios -%} -- handoff_to_{{ scenario.key }}: {{ scenario.description }} -{% endfor %} +**handoff_to_{{ scenario.key }}**: {{ scenario.description }} +{% endfor -%} + +## Decision Process +- **Clear match**: Hand off to the appropriate scenario agent +- **No match**: Handle the request yourself using available tools +- **Uncertain**: Ask clarifying questions or handle yourself + +## Handoff Guidelines +- Hand off early rather than late if you detect scenario-specific intent +- Provide context about why you're making the handoff in your reasoning +- Never mention the handoff process to the user - handle seamlessly # Response Format CRITICAL: Always format your responses as valid JSON: