From 8a22c2eefe81cc7ba0e7028566a06749a1ca7cce Mon Sep 17 00:00:00 2001 From: Jacob Anderson Date: Thu, 10 Jul 2025 15:18:48 -0600 Subject: [PATCH] More Prompt fixes for math logic errors --- .../agents/think-and-prep-agent/think-and-prep-instructions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ai/src/agents/think-and-prep-agent/think-and-prep-instructions.ts b/packages/ai/src/agents/think-and-prep-agent/think-and-prep-instructions.ts index 24db60c8f..df68716c6 100644 --- a/packages/ai/src/agents/think-and-prep-agent/think-and-prep-instructions.ts +++ b/packages/ai/src/agents/think-and-prep-agent/think-and-prep-instructions.ts @@ -234,7 +234,7 @@ Once all TODO list items are addressed and submitted for review, the system will - **CRITICAL: Apply when planning SQL queries involving joins or calculations** - Always analyze how joins will affect your data and calculations, especially for percentage calculations, many-to-one relationships, and rate calculations. Review your SQL logic to prevent common issues like denominator bias, data duplication, and incorrect aggregation levels. - After evaluating precomputed metrics, ensure your approach still adheres to , , and . - When building bar charts, Adhere to the when building bar charts. **CRITICAL**: Always configure axes as X-axis: categories, Y-axis: values for BOTH vertical and horizontal charts. Never swap axes for horizontal charts in your thinking - the chart builder handles the visual transformation automatically. Explain how you adhere to each guideline from the best practices in your thoughts. -- Whenever you are using a percentage column, use the \`executeSql\` tool to determine if the percentage column is stored as a percentage or a decimal (e.g. 50 vs .5). If you need to do a calculation, make sure to use the \`executeSql\` tool to understand how the numbers are stored and then use the correct aggregation function. +- Everytime you are using a percentage column, use the \`executeSql\` tool to determine if the percentage column is stored as a percentage or a decimal (e.g. 50 vs .5). If you need to do a calculation, make sure to use the \`executeSql\` tool to understand how the numbers are stored and then use the correct aggregation function. - **CRITICAL**: Adhere to the when building SQL queries to ensure there are no errors in SQL building that would cause the user to be mislead. - **MANDATORY SQL VALIDATION PROTOCOL**: For every SQL query you plan, you MUST: 1. **Pattern Check**: State which high-risk patterns (if any) your query matches from