> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tracectrl.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Agno

> Instrument Agno agents with TraceCtrl

## Installation

Both packages are published to PyPI.

```bash theme={"dark"}
pip install tracectrl tracectrl-instrumentation-agno
```

## Usage

```python theme={"dark"}
import tracectrl
from tracectrl import tag_agent
from tracectrl.instrumentation.agno import AgnoInstrumentor

tracectrl.configure(service_name="my-agno-agent")
AgnoInstrumentor().instrument()

from agno.agent import Agent

agent = Agent(model="gpt-4o", tools=[...])
tag_agent(agent)

agent.run("Analyze this document")
```

`tag_agent(agent)` stamps the agent's identity onto subsequent spans so it shows up as a distinct node in TraceCtrl's topology view.

## What Gets Captured

Agno emits agent identity attributes natively. TraceCtrl's span processor reads them and re-stamps them under the TraceCtrl schema:

| Source attribute | TraceCtrl attribute    | Notes                                        |
| ---------------- | ---------------------- | -------------------------------------------- |
| `agno.agent.id`  | `tracectrl.agent.id`   | Primary agent identity                       |
| `agno.team.id`   | `tracectrl.agent.id`   | Fallback when `agno.agent.id` is absent      |
| `agent.name`     | `tracectrl.agent.name` | OpenInference-standard name attribute        |
| `session.id`     | `tracectrl.session_id` | Fallback when no TraceCtrl session is active |

`tracectrl.agent.framework` is set to `agno` whenever either `agno.agent.id` or `agno.team.id` is present on the span.

## API

### `AgnoInstrumentor()`

<ParamField path="instrument" type="method">
  `instrument(tracer_provider=None, skip_dep_check=False)` — Registers the TraceCtrl span processor and wraps the OpenInference Agno instrumentor.
</ParamField>

<ParamField path="uninstrument" type="method">
  `uninstrument()` — Shuts down the TraceCtrl processor and unwraps the OpenInference instrumentor.
</ParamField>

<ParamField path="instrumented" type="bool">
  Whether the instrumentor is currently active.
</ParamField>
