Apr 13, 2026: Improved SQL generation in Cortex Agents¶
Cortex Agents that use Cortex Analyst semantic views as tools now generate SQL directly, rather than delegating SQL generation to the Cortex Analyst service as a separate step. This results in improved accuracy and lower latency for analytical queries.
The tool definition in your agent configuration remains the same. No changes to your agent configuration or semantic views are required. Other resources defined in your semantic view, such as Cortex Search services, continue to be used by the agent.
Changes to the response format¶
Tool use and tool result blocks of type
cortex_analyst_text_to_sqlare replaced by blocks of typesystem_execute_sql. Thesystem_execute_sqltool use block contains asqlfield with the SQL generated by the agent. The tool result block contains thequery_id,result_set, and finalsql.If your application parses the agent response for
cortex_analyst_text_to_sqlblocks, update it to look forsystem_execute_sqlinstead.
Changes to observability¶
In the CORTEX_AGENT_USAGE_HISTORY view, the
TOKENS_GRANULARandCREDITS_GRANULARcolumns no longer include entries with service typecortex_analyst. All token and credit usage is now reported undercortex_agents.In the agent monitoring logs, execution trace spans show
system_execute_sqlrather than a Cortex Analyst tool invocation. If your monitoring queries filter on tool type, update them accordingly.