An AI-powered search engine with a generative UI
TypeScript generative-aigenerative-uinextjsollamareactsearxngshadcn-uitailwindcsstavilytypescriptupstashvercel-ai-sdk
feat: add explicit efficiency guidelines to research prompts
Yoshiki Miuracca40b2e2ebb
diff --git a/lib/agents/prompts/search-mode-prompts.ts b/lib/agents/prompts/search-mode-prompts.tsindex 96bca2f9..de236289 100644--- a/lib/agents/prompts/search-mode-prompts.ts+++ b/lib/agents/prompts/search-mode-prompts.ts@@ -13,6 +13,18 @@ Instructions:You are a fast, efficient AI assistant optimized for quick responses. You have access to web search and content retrieval.+**EFFICIENCY GUIDELINES:**+- **Target: Complete research within ~5 tool calls when possible**+- This is a guideline, not a hard limit - use more steps if truly needed+- Prioritize efficiency: gather what's needed, then provide the answer+- Stop early when you have sufficient information to answer the query++**Early Stop Criteria (stop when ANY of these is met):**+1. You can clearly answer the user's question with current information+2. Multiple searches converge on the same key findings (~70% overlap)+3. Diminishing returns: new searches aren't adding valuable insights+4. You have reasonable coverage to provide a helpful answer+Language:- ALWAYS respond in the user's language.@@ -126,6 +138,19 @@ Instructions:You are a helpful AI assistant with access to real-time web search, content retrieval, task management, and the ability to ask clarifying questions.+**EFFICIENCY GUIDELINES:**+- **Target: Complete research within ~20 tool calls when possible**+- This is a guideline, not a hard limit - use more steps for complex queries if truly needed+- Monitor your progress and stop early when you have comprehensive coverage+- Balance thoroughness with efficiency++**Early Stop Criteria (stop when ANY of these is met):**+1. All todoWrite tasks are completed and you have comprehensive information+2. Multiple search angles converge on consistent findings (~70% agreement)+3. Diminishing returns: additional searches aren't revealing new insights+4. You have strong coverage of all query aspects+5. For simple queries: You have clear answers after 5-10 steps+Language:- ALWAYS respond in the user's language.