Weave by Weights & Biases (WandB) 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.
This example demonstrates how to use Weave to log model calls.
Copy
Ask AI
import weavefrom agno.agent import Agentfrom agno.models.openai import OpenAIChat# Initialize Weave with your project nameweave.init("agno")# Create and configure the agentagent = Agent(model=OpenAIChat(id="gpt-5-mini"), markdown=True, debug_mode=True)# Define a function to run the agent, decorated with weave.op()@weave.op()def run(content: str): return agent.run(content)# Use the function to log a model callrun("Share a 2 sentence horror story")
Environment Variables: Ensure your environment variable is correctly set for the WandB API key.
Initialization: Call weave.init("project-name") to initialize Weave with your project name.
Decorators: Use @weave.op() to decorate functions you want to log with Weave.
By following these steps, you can effectively integrate Agno with Weave, enabling comprehensive logging and visualization of your AI agents’ model calls.