[Resource] Analyzing Agent Behavior & Token Costs in Real-Time with BigQuery


Hi all! 👋

Just wanted to drop a resource for anyone building agents with Google’s ADK. The team just released a BigQuery Agent Analytics plugin that solves a huge chunk of the "observability" problem.

What it does: It acts as a flight recorder for your agent. It logs every prompt, tool execution, and LLM response into a structured BigQuery table.

What you can do with the data:

  1. Debug hallucinations: Trace exactly which tool output caused the model to go off the rails.
  2. Optimize costs: Write a SQL query to find your most expensive sessions or users.
  3. Improve quality: Use BigQuery’s vector search on your logs to find semantically similar failure cases.

It’s open source (part of the ADK) and uses the async Storage Write API so it doesn't slow down your generation speed.

Links:

Let me know if you have questions about the schema or setup!

Leave a Reply