Monitor Cortex Agent requests¶
Cortex Agents log detailed traces of all conversations for auditing and debugging purposes. With monitoring, you can access the conversation history of an Agent deployed via Snowflake Intelligence or Agent API. In addition to conversation history, you can review detailed tracing of the agent’s planning process, tool selection, execution results, and final response generation.
Information collected in Cortex Agent logs¶
Cortex Agent logs include the following information:
Conversation history associated with a thread
Agent’s execution trace with spans including:
LLM planning
Tool execution (Cortex Search, Cortex Analyst, web search)
LLM response generation
SQL execution
Chart generation
Inputs and outputs associated with each span
User feedback for each Agent response
Access Cortex Agent logs¶
To view Cortex Agent conversation logs in Snowsight, do the following:
Sign in to Snowsight.
In the navigation menu, select AI & ML » ui:
Cortex Analyst
.Select the Agent whose logs you wish to view.
Navigate to the Monitoring pane of the Agent view.
The monitoring logs associated with the Agent are stored in the event table SNOWFLAKE.LOCAL.AI_OBSERVABILITY_EVENTS. Entries in this table can’t be modified.
Administrators with the AI_OBSERVABILITY_ADMIN application role can delete entries in the SNOWFLAKE.LOCAL.AI_OBSERVABILITY_EVENTS table.
Access control and permissions¶
To view Cortex Agent logs, users must have the following privileges:
OWNERSHIP or MONITOR privileges on the AGENT object
The CORTEX_USER database role
Either the AI_OBSERVABILITY_EVENTS_LOOKUP or AI_OBSERVABILITY_ADMIN application role
The following example uses the ACCOUNTADMIN role to create a new role agent_monitoring_user_role
with the required permissions to view Cortex Agent logs. This new role is then assigned to some_user
.
USE ROLE ACCOUNTADMIN;
CREATE ROLE agent_monitoring_user_role;
GRANT MONITOR ON AGENT my_agent TO ROLE agent_monitoring_user_role;
GRANT DATABASE ROLE SNOWFLAKE.CORTEX_USER TO ROLE agent_monitoring_user_role;
GRANT APPLICATION ROLE SNOWFLAKE.AI_OBSERVABILITY_EVENTS_LOOKUP TO ROLE agent_monitoring_user_role;
GRANT ROLE agent_monitoring_user_role TO USER some_user;