Artificial Intelligence

AI Agent Observability | Free Xano Template

Building AI agents is exciting — but knowing what they're actually doing at runtime is where things get serious. With the free AI Agent Observability snippet for Xano, you can track every run, step, and tool call your agents make, all from a sleek dashboard hosted right inside your Xano instance. Here's how to get it set up and start gaining real visibility into your agentic workflows.

Installing the Snippet

To get started, grab the snippet URL from the video description and add it to your Xano account. When prompted, select the instance and workspace where you want it installed. Once added, the snippet automatically brings in several components: a set of database tables, a pre-built API group, an AI agent, and a logging function.

Understanding the Database Structure

The snippet creates a handful of tables you'll want to familiarize yourself with. The most important is the agent table, where you register each agent you build. Each agent entry gets an ID that you'll reference later when logging runs. You'll also find tables for tracking runs, steps, and tool calls. There's a dedicated agent user table as well — separate from any existing user table in your app — which you'll use to authenticate with the dashboard.

Go ahead and add a record to the agent user table with a name, email, and password. You'll need these credentials to log into the dashboard.

Configuring Your API Key

The included agent uses Google Gemini, so you'll need to add your Gemini API key as an environment variable. Navigate to your Xano settings, open the Environment Variables card, and add a new variable named gemini_key with your API key as the value. This name must match exactly what's referenced inside the agent settings.

Using the Sample Air Log Endpoint

Inside the Agent History API group, you'll find a sample air log endpoint — a great starting point for wiring up observability. It accepts a message input, passes it to your agent, and then calls the included logging function to record the response, arguments, and agent ID. Make sure you're passing the correct agent ID (from your agent table) and your auth token as the user ID. Apply this logging function after every agent call to keep your records clean and organized.

Exploring the Agent Dashboard

To access the dashboard, grab the base URL from your API group and copy the dashboard endpoint URL. Open it in a browser and log in with the credentials you created. You'll see a real-time overview of total runs, token usage, and average tokens per run. Clicking into an individual agent lets you analyze specific runs — viewing each step, the tool calls made, the parameters passed in, and the results returned.

This level of detail becomes especially powerful once your agents start using tools. When you add a tool and trigger a multi-step run, the dashboard breaks down each step clearly, showing you exactly when and how tools were invoked.

Key Reminders

  • Add your gemini_key environment variable before testing
  • Register every new agent in the agent table and use its ID in your log function
  • Always call the logging function after each agent to ensure runs are captured
  • Grab your API group base URL and update it in the dashboard settings

With just a few minutes of setup, you'll have full observability across all your Xano AI agents.

Sign up for Xano

Join 100,000+ people already building with Xano.
Start today and scale to millions.