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

# Weave Integration

> Wrap an Agno agent run in a @weave.op() decorator to log calls to a Weave project.

Demonstrates logging Agno model calls with Weave.

```python weave_op.py theme={null}
"""
Weave Integration
=================

Demonstrates logging Agno model calls with Weave.
"""

import weave
from agno.agent import Agent
from agno.models.openai import OpenAIChat

# ---------------------------------------------------------------------------
# Setup
# ---------------------------------------------------------------------------
weave.init("agno")


# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------
agent = Agent(model=OpenAIChat(id="gpt-5.6-luna"), markdown=True)


@weave.op()
def run(content: str):
    return agent.run(content)


# ---------------------------------------------------------------------------
# Run Example
# ---------------------------------------------------------------------------
if __name__ == "__main__":
    run("Share a 2 sentence horror story")
```

## Run the Example

<Snippet file="create-venv-step.mdx" />

**1. Install dependencies**

```bash theme={null}
uv pip install -U agno openai weave
```

**2. Export your API keys**

```bash Mac/Linux theme={null}
export OPENAI_API_KEY="your_openai_api_key_here"
export WANDB_API_KEY="your_wandb_api_key_here"
```

```bash Windows theme={null}
$Env:OPENAI_API_KEY="your_openai_api_key_here"
$Env:WANDB_API_KEY="your_wandb_api_key_here"
```

**3. Run the example**

Save the code above as `weave_op.py`, then run:

```bash theme={null}
python weave_op.py
```

Full source: [cookbook/observability/weave\_op.py](https://github.com/agno-agi/agno/blob/v3.0.4/cookbook/observability/weave_op.py)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.