Skip to content

An AI-powered search engine with a generative UI

feat: improve search mode prompts for flexible response length

Yoshiki Miurafbbd96b6f62c
diff --git a/lib/agents/prompts/search-mode-prompts.ts b/lib/agents/prompts/search-mode-prompts.ts
index de236289..b08861a4 100644
--- a/lib/agents/prompts/search-mode-prompts.ts
+++ b/lib/agents/prompts/search-mode-prompts.ts
@@ -32,7 +32,11 @@ Your approach:
1. Start with the search tool using optimized results. When the question has multiple aspects, split it into focused sub-queries and run each search back-to-back before writing the answer.
2. Provide concise, direct answers based on search results
3. Focus on the most relevant information without extensive detail
-4. Keep outputs tight: aim for crisp paragraphs or bullets with actionable context (target ~80–150 words)
+4. Keep outputs efficient and focused:
+ - Include all essential information needed to answer the question thoroughly
+ - Use concrete examples and specific data when available
+ - Avoid unnecessary elaboration while maintaining clarity
+ - Scale response length naturally based on query complexity
5. **CRITICAL: You MUST cite sources inline using the [number](#toolCallId) format**
Tool preamble (keep very brief):
@@ -106,7 +110,12 @@ OUTPUT FORMAT (MANDATORY):
- Only use fenced code blocks if the user explicitly asks for code or commands.
- Prefer natural, conversational tone while maintaining informativeness.
- Always end with a brief conclusion that synthesizes the main points into a cohesive summary.
-- Aim for ~200–300 words with content that directly answers the user's question, including specific data and examples when available.
+- **CRITICAL: Do NOT include follow-up suggestions or questions at the end** (e.g., "If you want, I can..." or "Would you like me to..."). The application provides related questions separately.
+- Response length guidance:
+ - Simple definitions or facts: Keep concise and direct
+ - Comparisons or multi-faceted topics: Provide comprehensive coverage
+ - Complex analyses: Include all relevant details and perspectives
+ - Always prioritize completeness and clarity over arbitrary length targets
Emoji usage:
- You may use emojis in headings when they naturally represent the content and aid comprehension
@@ -303,7 +312,13 @@ OUTPUT FORMAT (MANDATORY):
- Adapt length and structure to query complexity: simple topics can be concise, complex topics should be thorough.
- Place all citations at the end of the sentence they support.
- Always include a brief conclusion that synthesizes the key points.
-- Length scales with complexity (simple ~150–250 words; medium ~200–350; complex ~300–600).
+- **CRITICAL: Do NOT include follow-up suggestions or questions at the end** (e.g., "If you want, I can..." or "Would you like me to..."). The application provides related questions separately.
+- Response length guidance:
+ - Scale naturally with query complexity
+ - Simple queries: Concise and direct answers
+ - Medium complexity: Comprehensive coverage of key aspects
+ - Complex queries: Thorough exploration with multiple perspectives
+ - Always prioritize completeness and accuracy over specific word counts
Emoji usage:
- You may use emojis in headings when they naturally represent the content and aid comprehension