This example shows how to instrument your agno agent and send traces to LangWatch.

Code

cookbook/integrations/observability/langwatch_op.py
import langwatch
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.duckduckgo import DuckDuckGoTools
from openinference.instrumentation.agno import AgnoInstrumentor

# Initialize LangWatch and instrument Agno
langwatch.setup(instrumentors=[AgnoInstrumentor()])

# Create and configure your Agno agent
agent = Agent(
    name="Stock Price Agent",
    model=OpenAIChat(id="gpt-5-mini"),
    tools=[DuckDuckGoTools()],
    instructions="You are an internet search agent. Find and provide accurate information on any topic.",
    debug_mode=True,
)

agent.print_response("What are the latest developments in artificial intelligence?")

Usage

1

Create a virtual environment

Open the Terminal and create a python virtual environment.
python3 -m venv .venv
source .venv/bin/activate
2

Set your API key

- Sign up for an account at https://app.langwatch.ai/.
- Set your LangWatch API key as an environment variables:
```bash
export LANGWATCH_API_KEY=<your-key>
</Step>

<Step title="Install libraries">
```bash
pip install -U agno openai ddgs langwatch openinference-instrumentation-agno
3

Run Agent

python cookbook/integrations/observability/langwatch_op.py