Weave for Agents is in public preview. Features, APIs, and the Agents view UI may change before general availability.
Trace Google ADK agents with Weave
The Weave SDK autopatches with Google ADK so you can capture traces from your ADK agents with minimal setup. This guide shows how to initialize Weave and then run a multi-turn research agent built with Google ADK so that Weave captures every agent invocation, model call, and tool call across the session.Prerequisites
- A W&B account and API key set as a
WANDB_API_KEYenvironment variable. - A Google API key for Gemini.
- Python 3.10+.
Install packages
Install the following packages in your developer environment. These provide the Weave SDK, the Google ADK framework, and the HTTP client used by the example tool:Initialize Weave in your code
Addweave.init to the project, along with your W&B team and project names, and then build an agent the way you normally would. The following code creates a research_assistant agent that uses gemini-2.5-flash and a wikipedia_search tool, then runs three questions through a single ADK session while Weave captures the trace.
See your agent traces in the Agents view
After the script runs, open your project’s Agents view to confirm that Weave captured the session.weave.init() prints a link to your project when it runs. In the Agents view, inspect the following:
- A row in the Agents tab for
research_assistant. - A single session containing three turns.
- Each turn rendered as an
invoke_agentspan with nested model calls and tool calls. - The full input, model, output, token usage, and Wikipedia results at each step.