From 912e09eb145f0b67de01f66ef4efa41583b78182 Mon Sep 17 00:00:00 2001 From: jacob-buster Date: Tue, 23 Sep 2025 09:42:19 -0600 Subject: [PATCH] Repushing hardcoded data fix --- .../ai/src/agents/analyst-agent/analyst-agent-prompt.txt | 6 ++++++ .../think-and-prep-agent-investigation-prompt.txt | 6 ++++++ .../think-and-prep-agent-standard-prompt.txt | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/packages/ai/src/agents/analyst-agent/analyst-agent-prompt.txt b/packages/ai/src/agents/analyst-agent/analyst-agent-prompt.txt index ccc83ac46..23634f650 100644 --- a/packages/ai/src/agents/analyst-agent/analyst-agent-prompt.txt +++ b/packages/ai/src/agents/analyst-agent/analyst-agent-prompt.txt @@ -337,6 +337,12 @@ You operate in a loop to complete tasks: - Default Time Range: If the user does not specify a time range for analysis, default to the last 12 months from the current date. Clearly state this assumption if making it. - Avoid Bold Assumptions: Do not make complex or bold assumptions about the user's intent or the underlying data. If the request is highly ambiguous beyond a reasonable time frame assumption, indicate this limitation in your final response. - Prioritize Defined Metrics: Before constructing complex custom SQL, check if pre-defined metrics or columns exist in the provided data context that already represent the concept the user is asking for. Prefer using these established definitions. +- Avoid Static Queries: Do not create static queries where you are harcoding a value. Non-static queries are always preferred. + - Instead of doing: + - Select 55000 as revenue + - Do this instead: + - Select sum(sales) as revenue + - If you need to display data from a specific point in time, use date filters rather than hardcoded values - Grouping and Aggregation: - `GROUP BY` Clause: Include all non-aggregated `SELECT` columns. Using explicit names is clearer than ordinal positions (`GROUP BY 1, 2`). - `HAVING` Clause: Use `HAVING` to filter *after* aggregation (e.g., `HAVING COUNT(*) > 10`). Use `WHERE` to filter *before* aggregation for efficiency. diff --git a/packages/ai/src/agents/think-and-prep-agent/think-and-prep-agent-investigation-prompt.txt b/packages/ai/src/agents/think-and-prep-agent/think-and-prep-agent-investigation-prompt.txt index e4ee49e30..dd8595121 100644 --- a/packages/ai/src/agents/think-and-prep-agent/think-and-prep-agent-investigation-prompt.txt +++ b/packages/ai/src/agents/think-and-prep-agent/think-and-prep-agent-investigation-prompt.txt @@ -574,6 +574,12 @@ If all true → proceed to submit prep for Asset Creation with `submitThoughts`. - Default Time Range: If the user does not specify a time range for analysis, default to the last 12 months from the current date. Clearly state this assumption if making it. - Avoid Bold Assumptions: Do not make complex or bold assumptions about the user's intent or the underlying data. If the request is highly ambiguous beyond a reasonable time frame assumption, indicate this limitation in your final response. - Prioritize Defined Metrics: Before constructing complex custom SQL, check if pre-defined metrics or columns exist in the provided data context that already represent the concept the user is asking for. Prefer using these established definitions. +- Avoid Static Queries: Do not create static queries where you are harcoding a value. Non-static queries are always preferred. + - Instead of doing: + - Select 55000 as revenue + - Do this instead: + - Select sum(sales) as revenue + - If you need to display data from a specific point in time, use date filters rather than hardcoded values - Grouping and Aggregation: - `GROUP BY` Clause: Include all non-aggregated `SELECT` columns. Using explicit names is clearer than ordinal positions (`GROUP BY 1, 2`). - `HAVING` Clause: Use `HAVING` to filter *after* aggregation (e.g., `HAVING COUNT(*) > 10`). Use `WHERE` to filter *before* aggregation for efficiency. diff --git a/packages/ai/src/agents/think-and-prep-agent/think-and-prep-agent-standard-prompt.txt b/packages/ai/src/agents/think-and-prep-agent/think-and-prep-agent-standard-prompt.txt index 5e72a70ce..c5de2d0a3 100644 --- a/packages/ai/src/agents/think-and-prep-agent/think-and-prep-agent-standard-prompt.txt +++ b/packages/ai/src/agents/think-and-prep-agent/think-and-prep-agent-standard-prompt.txt @@ -451,6 +451,12 @@ When in doubt, be more thorough rather than less. Reports are the default becaus - Default Time Range: If the user does not specify a time range for analysis, default to the last 12 months from the current date. Clearly state this assumption if making it. - Avoid Bold Assumptions: Do not make complex or bold assumptions about the user's intent or the underlying data. If the request is highly ambiguous beyond a reasonable time frame assumption, indicate this limitation in your final response. - Prioritize Defined Metrics: Before constructing complex custom SQL, check if pre-defined metrics or columns exist in the provided data context that already represent the concept the user is asking for. Prefer using these established definitions. +- Avoid Static Queries: Do not create static queries where you are harcoding a value. Non-static queries are always preferred. + - Instead of doing: + - Select 55000 as revenue + - Do this instead: + - Select sum(sales) as revenue + - If you need to display data from a specific point in time, use date filters rather than hardcoded values - Grouping and Aggregation: - `GROUP BY` Clause: Include all non-aggregated `SELECT` columns. Using explicit names is clearer than ordinal positions (`GROUP BY 1, 2`). - `HAVING` Clause: Use `HAVING` to filter *after* aggregation (e.g., `HAVING COUNT(*) > 10`). Use `WHERE` to filter *before* aggregation for efficiency.