Templates

Agent History & Debugging Mode

Agent History & Debugging

Install this snippet to monitor, analyze, and debug your agent's behavior. Gain critical insight into every agent run.

  • Logging Database Tables: Includes agents and agent_runs, agent_steps, agent_tool_calls tables to store detailed execution history.

  • Automated Logging Function: A dedicated function to easily log the inputs, outputs, and steps of each agent run.

  • Monitoring Dashboard: A utility API endpoint that provides a simple dashboard to review agent performance statistics and debug individual runs.

Configuration Instructions

1

Install the snippet into you workspace by clicking the card below

Cover

Agent History & Debugging Mode

Monitors, analyzes, and debugs your agent’s behavior by logging every run, step, and tool call. Includes a dashboard for performance stats and run details, plus automated logging to capture inputs, outputs, and execution history.

2

Go to the Agent History API group that was created during installation, and copy the group's Base URL

3

In the Dashboard API within the Agent History group, paste the Base URL into the api_group_base_url variable, and then Publish the endpoint.

4

In your database, add a record to the Agents table for the agent you want to monitor.

5

In the agent_user table, add a new user. This will provide secure access to the monitoring dashboard.

6

In any function stack, after your Call Agent statement, add the log_agent custom function to capture the agent's response.

Accessing the Dashboard

Each agent run will be recorded in your database.

To view the monitoring dashboard:

  • Open your browser and navigate to the URL of the dashboard endpoint.

Log in using the credentials you created in the agent_user table.

Conversation History

Install this snippet to manage and persist user interactions. It's the perfect starting point for any chatbot or conversational agent.

This snippet includes:

  • Authentication endpoints (auth/login and auth/me)

  • Database tables (conversations and messages, agent_user)

  • Chatbot API group

  • A chabot UI that you can use to test your agents.

Prerequisites

  • Agent must be configured with prompt type set to "Messages"

  • Agent messages value must be set to: {{ $args.messages|json_encode() }}

Configuration Instructions

1

Install the snippet to your workspace by clicking the card below

2

3

Copy the API group's base URL

4

5

Update the api_group_base_url variable with the copied URL

6

7

Add your agent using a Call AI Agent function within the group located at step 4

8

In step 5, update the agent_response variable to use the Call AI Agent statement's output

Accessing the Chatbot Example

To view the chatbot example:

  • Open your browser and navigate to the URL of the chatbot endpoint.

Last updated

Was this helpful?