> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2-studio-tools-doc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Weave

> Integrate Agno with Weave by WandB to send traces and gain insights into your agent's performance.

## Integrating Agno with Weave by WandB

[Weave by Weights & Biases (WandB)](https://weave-docs.wandb.ai/) 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 Weave**

   Ensure you have the Weave package installed:

   ```bash theme={null}
   uv pip install weave
   ```

2. **Authentication**
   Go to [WandB](https://wandb.ai) and copy your API key
   ```bash theme={null}
   export WANDB_API_KEY=<your-api-key>
   ```

## Logging Model Calls with Weave

This example demonstrates how to use Weave to log model calls.

```python theme={null}
import weave
from agno.agent import Agent
from agno.models.openai import OpenAIResponses

# Initialize Weave with your project name
weave.init("agno")

# Create and configure the agent
agent = Agent(model=OpenAIResponses(id="gpt-5.2"), 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 call
run("Share a 2 sentence horror story")
```

## Notes

* **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.
