Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions develop-docs/sdk/telemetry/traces/modules/ai-agents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,57 @@ Sentry Conventions is the single source of truth.

</Alert>


## Span Relationships
Comment thread
alexander-alderman-webb marked this conversation as resolved.
Resolved

An agent invocation span has tool execution and chat span children, but chat spans need not have an agent invocation parent (not all chat requests are triggered by an agent).
Agents can have other children such as extraction, decision and memory spans, depending on what's considered part of an agent execution in a given application.
Automatic instrumentation considers an agent execution to be one run of the agent as represented by the supported library.

All span types can be children of a tool execution span because tools can be arbitrary functions (including starting subagents and performing handoffs).
Chat, extraction and decision spans are basic building blocks and should not have GenAI spans as children.

Valid examples:

### Agent execution with extraction, decision and memory children

```
gen_ai.invoke_agent
├── gen_ai.chat
├── gen_ai.memory
├── gen_ai.extraction
├── gen_ai.chat
├── gen_ai.execute_tool
├── gen_ai.chat
└── gen_ai.decide
```

### Chat, memory, decision, and extraction spans outside of an agent execution

```
gen_ai.chat
gen_ai.extraction
gen_ai.invoke_agent
├── gen_ai.chat
├── gen_ai.execute_tool
└── gen_ai.chat
gen_ai.decide
gen_ai.memory
```

### Subagent

```
gen_ai.invoke_agent
├── gen_ai.chat
├── gen_ai.execute_tool
│ └── gen_ai.invoke_agent
│ ├── gen_ai.chat
│ ├── gen_ai.execute_tool
│ └── gen_ai.chat
└── gen_ai.chat
```

## Invoke Agent Span

Describes AI agent invocation.
Expand Down
Loading