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_sql are replaced by blocks of type system_execute_sql. The system_execute_sql tool use block contains a sql field with the SQL generated by the agent. The tool result block contains the query_id, result_set, and final sql.

  • If your application parses the agent response for cortex_analyst_text_to_sql blocks, update it to look for system_execute_sql instead.

Changes to observability

  • In the CORTEX_AGENT_USAGE_HISTORY view, the TOKENS_GRANULAR and CREDITS_GRANULAR columns no longer include entries with service type cortex_analyst. All token and credit usage is now reported under cortex_agents.

  • In the agent monitoring logs, execution trace spans show system_execute_sql rather than a Cortex Analyst tool invocation. If your monitoring queries filter on tool type, update them accordingly.