Skip to main content

Integrating Agno with Weave by WandB

Weave provides a powerful platform for logging and visualizing model calls. By integrating Agno with Weave, you can track and analyze your agent’s performance and behavior.

Prerequisites

  1. Install Dependencies
Ensure you have the necessary packages installed:
  1. Create a WandB Account
  1. Set Environment Variables
Configure your environment with the WandB API key:

Sending Traces to Weave

  • Example: Using weave.op decorator

This method requires installing the weave package and then utilising @weave.op decorator over any function you wish to automatically trace. This works by creating wrappers around the functions.
  • Example: Using OpenTelemetry

In this method, we utilize weave’s support for OpenTelemetry based trace logging. This method does not require installing weave Python SDK as a dependency. First, install the required OpenTelemetry dependencies:
This example demonstrates how to instrument your Agno agent with OpenInference and send traces to Weave:

Notes

  • Environment Variables: Ensure your environment variables are correctly set for the WandB API key.
  • Project Configuration: Replace <your-entity>/<your-project> with your actual WandB entity and project name for OpenTelemetry setup.
  • Entity Name: You can find your entity name by visiting your WandB dashboard and checking the Teams field in the left sidebar.
  • Method Selection: Use weave.op decorator for simpler setup, or OpenTelemetry for richer logging and better dashboard reporting.
By following these steps, you can effectively integrate Agno with Weave, enabling comprehensive logging and visualization of your AI agents’ model calls.