6. For specific questions, provide detailed information from the user's notes that directly addresses the question
7. Always prioritize information from the user's notes over your own knowledge, as the user's notes are likely more up-to-date and personally relevant
When using tools, follow these best practices:
1. If a tool returns an error or no results, DO NOT give up immediately
2. Instead, try different parameters that might yield better results:
- For search tools: Try broader search terms, fewer filters, or synonyms
- For note navigation: Try parent or sibling notes if a specific note isn't found
- For content analysis: Try rephrasing or generalizing the query
3. When searching for information, start with specific search terms but be prepared to broaden your search if no results are found
4. If multiple attempts with different parameters still yield no results, clearly explain to the user that the information they're looking for might not be in their notes
5. When suggesting alternatives, be explicit about what parameters you've tried and what you're changing
6. Remember that empty results from tools don't mean the user's request can't be fulfilled - it often means the parameters need adjustment
CRITICAL INSTRUCTIONS FOR TOOL USAGE:
1. YOU MUST TRY MULTIPLE TOOLS AND SEARCH VARIATIONS before concluding information isn't available
2. ALWAYS PERFORM AT LEAST 3 DIFFERENT SEARCHES with different parameters before giving up on finding information
3. If a search returns no results, IMMEDIATELY TRY ANOTHER SEARCH with different parameters:
- Use broader terms: If "Kubernetes deployment" fails, try just "Kubernetes" or "container orchestration"
- Try synonyms: If "meeting notes" fails, try "conference", "discussion", or "conversation"
- Remove specific qualifiers: If "quarterly financial report 2024" fails, try just "financial report"
- Try semantic variations: If keyword_search fails, use vector_search which finds conceptually related content
4. CHAIN TOOLS TOGETHER: Use the results of one tool to inform parameters for the next tool
5. NEVER respond with "there are no notes about X" until you've tried at least 3 different search variations
6. DO NOT ask the user what to do next when searches fail - AUTOMATICALLY try different approaches
7. ALWAYS EXPLAIN what you're doing: "I didn't find results for X, so I'm now searching for Y instead"
8. If all reasonable search variations fail (minimum 3 attempts), THEN you may inform the user that the information might not be in their notes
directiveMessage+=`IMMEDIATELY RUN ANOTHER SEARCH TOOL with broader search terms, alternative keywords, or related concepts. `;
directiveMessage+=`Try synonyms, more general terms, or related topics. `;
}
if(emptyToolNames.includes('keyword_search')){
directiveMessage+=`IMMEDIATELY TRY VECTOR_SEARCH INSTEAD as it might find semantic matches where keyword search failed. `;
}
directiveMessage+=`DO NOT ask the user what to do next or if they want general information. CONTINUE SEARCHING with different parameters.`;
updatedMessages.push({
role:'system',
content:`The previous tool execution(s) completed but returned no useful results. Consider trying different parameters for better results. For search tools, try broader search terms, fewer filters, or synonyms. For navigation tools, try exploring parent or sibling notes.`
content: directiveMessage
});
}
@ -517,7 +570,7 @@ export class ToolCallingStage extends BasePipelineStage<ToolExecutionInput, { re