Skip to content

Commit b90e114

Browse files
committed
feat: more examples around sql
1 parent 7c32e6d commit b90e114

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

ee/hogai/graph/agent_modes/presets/sql.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@
3535

3636
POSITIVE_EXAMPLE_COMPANY_CHURN_ANALYSIS = """
3737
User: Has eleventy churned?
38-
Assistant: Let me first search for a company with name "eleventy".
39-
*Uses the search tool to find a property value with the "eleventy" value in the project*
40-
Assistant: I've found a property value with the "Eleventy.ai" value. I'm going to search for existing insights tracking the customer churn rate.
41-
*Uses the search tools to find insights tracking the customer churn rate in the project*
42-
Assistant: I've found 0 matching insights. Let me create a new insight checking if the company "Eleventy.ai" has churned. I'm going to create a todo list to track these changes.
43-
*Creates a todo list with specific steps to create a new insight*
38+
Assistant: Let me first check the insights or events and properties to understand how we can track churn.
39+
*Uses the search tool to find insights and the read_taxonomy tool to find events and properties that can be used to track churn*
40+
Assistant: I haven't found any combinations of events and properties that can be used to track churn. Let me check how we can identify the company by a name in the project.
41+
*Uses the read_taxonomy tool to find properties that can be used to identify the company by a name in the project*
42+
Assistant: I've found properties that can be used to identify the company by a name in the project. I'm going to create an SQL query to find a specific company by a name.
43+
*Creates a todo list with specific steps to create a new SQL query*
4444
""".strip()
4545

4646
POSITIVE_EXAMPLE_COMPANY_CHURN_ANALYSIS_REASONING = """
4747
The assistant used the todo list because:
4848
1. First, the assistant searched to understand the scope of the task
49-
2. After the assistant verified that there isn't an insight tracking the customer churn rate, it determined this was a complex task with multiple steps
49+
2. After the assistant verified that there isn't an insight or combination of events and properties tracking the customer churn rate, it determined this was a complex task with multiple steps
5050
3. The todo list helps ensure every instance is tracked and updated systematically
5151
""".strip()
5252

@@ -125,6 +125,6 @@ def default_tools(self) -> list[type["MaxTool"]]:
125125

126126
sql_agent = AgentDefinition(
127127
mode=AgentMode.SQL,
128-
mode_description="Specialized mode capable of generating and executing SQL queries.",
128+
mode_description="Specialized mode capable of generating and executing SQL queries. This mode allows you to query the ClickHouse database, which contains both data collected by PostHog (events, groups, persons, sessions) and data warehouse sources connected by the user, such as SQL tables, CRMs, and external systems. This mode can also be used to search for specific data that can be used in other modes.",
129129
toolkit_class=SQLAgentToolkit,
130130
)

ee/hogai/tools/execute_sql/tool.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ class ExecuteSQLToolArgs(BaseModel):
3939

4040
class ExecuteSQLTool(HogQLGeneratorMixin, MaxTool):
4141
name: str = "execute_sql"
42-
thinking_message: str = "Coming up with an SQL query"
4342
args_schema: type[BaseModel] = ExecuteSQLToolArgs
4443
context_prompt_template: str = SQL_ASSISTANT_ROOT_SYSTEM_PROMPT
4544
show_tool_call_message: bool = False

0 commit comments

Comments
 (0)