Skip to content

Commit dac6ecc

Browse files
authored
update agent (#233)
1 parent b48f7b2 commit dac6ecc

File tree

1 file changed

+98
-79
lines changed

1 file changed

+98
-79
lines changed

agent-semantic-convention/ai-agent-spans.md

Lines changed: 98 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -32,116 +32,135 @@ Semantic conventions for individual AI Agent systems and frameworks MAY specify
3232

3333
## AI Agent attributes
3434

35+
### Workflow
36+
- ai_agent.workflow.name
37+
- ai_agent.workflow.start_time
38+
- ai_agent.workflow.end_time
39+
- ai_agent.workflow.end_state
40+
- ai_agent.workflow.end_reason
41+
- ai_agent.workflow.tags
42+
- ai_agent.workflow.host_env
43+
- ai_agent.workflow.system
44+
45+
46+
### Tools
47+
48+
### Agent
49+
50+
- ai_agent.agent.name
51+
- ai_agent.agent.workflow_name
52+
- ai_agent.agent.name
53+
- ai_agent.agent.model
54+
- ai_agent.agent.tools
55+
56+
### Task
57+
58+
- ai_agent.task.name
59+
- ai_agent.task.agent_name
60+
- ai_agent.task.description
61+
- ai_agent.task.priority
62+
- ai_agent.task.state
63+
- ai_agent.task.duration
64+
65+
### Interaction
66+
67+
- ai_agent.interaction.type
68+
- ai_agent.interaction.source
69+
- ai_agent.interaction.target
70+
- ai_agent.interaction.status
71+
72+
### Workflow Attributes
73+
74+
| Attribute | Type | Description | Example |
75+
|-------------------------------|--------|------------------------------------------------------------------|----------------------------------|
76+
| `ai_agent.agent.id` | string | Unique identifier for the agent. | `agent-12345` |
77+
| `ai_agent.agent.name` | string | Human-readable name of the agent. | `Data Processor` |
78+
| `ai_agent.agent.type` | string | Type of the agent (e.g., `CrewAI`, `LangGraph`, `AutoGen`). | `CrewAI` |
79+
| `ai_agent.session.id` | string | Unique identifier for the session. | `session-67890` |
80+
| `ai_agent.session.project_id` | string | Identifier for the project associated with the session. | `project-abcde` |
81+
| `ai_agent.session.start_time` | string | Timestamp marking the beginning of the session. | `2024-12-04T14:53:01Z` |
82+
| `ai_agent.session.end_time` | string | Timestamp indicating when the session concluded. | `2024-12-04T15:53:01Z` |
83+
| `ai_agent.session.end_state` | string | End state of the session (e.g., `success`, `failure`). | `success` |
84+
| `ai_agent.session.end_reason` | string | Reason for the session's end (e.g., `error`, `user_interrupt`). | `user_interrupt` |
85+
| `ai_agent.session.tags` | array | List of tags categorizing the session. | `["tag1", "tag2"]` |
86+
| `ai_agent.session.host_env` | string | Information about the system where the session ran. | `Ubuntu 20.04` |
87+
| `ai_agent.session.video` | string | URL to the video recording of the session, if applicable. | `http://example.com/session.mp4` |
88+
| `ai_agent.environment` | string | Environment in which the agent operates (e.g., `production`). | `production` |
89+
| `ai_agent.lifecycle.state` | string | Current lifecycle state of the agent (e.g., `initializing`). | `running` |
90+
| `ai_agent.execution.mode` | string | Execution mode of the agent (e.g., `autonomous`, `interactive`). | `autonomous` |
91+
3592
### Common Attributes
3693

3794
The following attributes apply to all spans related to agent operations:
3895

3996
| Attribute | Type | Description | Example |
4097
|-------------------------------|--------|------------------------------------------------------------------|----------------------------------|
41-
| `agentops.agent.id` | string | Unique identifier for the agent. | `agent-12345` |
42-
| `agentops.agent.name` | string | Human-readable name of the agent. | `Data Processor` |
43-
| `agentops.agent.type` | string | Type of the agent (e.g., `CrewAI`, `LangGraph`, `AutoGen`). | `CrewAI` |
44-
| `agentops.session.id` | string | Unique identifier for the session. | `session-67890` |
45-
| `agentops.session.project_id` | string | Identifier for the project associated with the session. | `project-abcde` |
46-
| `agentops.session.start_time` | string | Timestamp marking the beginning of the session. | `2024-12-04T14:53:01Z` |
47-
| `agentops.session.end_time` | string | Timestamp indicating when the session concluded. | `2024-12-04T15:53:01Z` |
48-
| `agentops.session.end_state` | string | End state of the session (e.g., `success`, `failure`). | `success` |
49-
| `agentops.session.end_reason` | string | Reason for the session's end (e.g., `error`, `user_interrupt`). | `user_interrupt` |
50-
| `agentops.session.tags` | array | List of tags categorizing the session. | `["tag1", "tag2"]` |
51-
| `agentops.session.host_env` | string | Information about the system where the session ran. | `Ubuntu 20.04` |
52-
| `agentops.session.video` | string | URL to the video recording of the session, if applicable. | `http://example.com/session.mp4` |
53-
| `agentops.environment` | string | Environment in which the agent operates (e.g., `production`). | `production` |
54-
| `agentops.lifecycle.state` | string | Current lifecycle state of the agent (e.g., `initializing`). | `running` |
55-
| `agentops.execution.mode` | string | Execution mode of the agent (e.g., `autonomous`, `interactive`). | `autonomous` |
98+
| `ai_agent.agent.id` | string | Unique identifier for the agent. | `agent-12345` |
99+
| `ai_agent.agent.name` | string | Human-readable name of the agent. | `Data Processor` |
100+
| `ai_agent.agent.type` | string | Type of the agent (e.g., `CrewAI`, `LangGraph`, `AutoGen`). | `CrewAI` |
101+
| `ai_agent.session.id` | string | Unique identifier for the session. | `session-67890` |
102+
| `ai_agent.session.project_id` | string | Identifier for the project associated with the session. | `project-abcde` |
103+
| `ai_agent.session.start_time` | string | Timestamp marking the beginning of the session. | `2024-12-04T14:53:01Z` |
104+
| `ai_agent.session.end_time` | string | Timestamp indicating when the session concluded. | `2024-12-04T15:53:01Z` |
105+
| `ai_agent.session.end_state` | string | End state of the session (e.g., `success`, `failure`). | `success` |
106+
| `ai_agent.session.end_reason` | string | Reason for the session's end (e.g., `error`, `user_interrupt`). | `user_interrupt` |
107+
| `ai_agent.session.tags` | array | List of tags categorizing the session. | `["tag1", "tag2"]` |
108+
| `ai_agent.session.host_env` | string | Information about the system where the session ran. | `Ubuntu 20.04` |
109+
| `ai_agent.session.video` | string | URL to the video recording of the session, if applicable. | `http://example.com/session.mp4` |
110+
| `ai_agent.environment` | string | Environment in which the agent operates (e.g., `production`). | `production` |
111+
| `ai_agent.lifecycle.state` | string | Current lifecycle state of the agent (e.g., `initializing`). | `running` |
112+
| `ai_agent.execution.mode` | string | Execution mode of the agent (e.g., `autonomous`, `interactive`). | `autonomous` |
56113

57114
### Task Execution Attributes
58115
For spans that represent the execution of a task by an agent:
59116
| Attribute | Type | Description | Example |
60117
|--------------------------|---------|-------------------------------------------------------------------------|------------------|
61-
| `agentops.task.id` | string | Unique identifier for the task. | `task-abcde` |
62-
| `agentops.task.name` | string | Human-readable name of the task. | `Data Ingestion` |
63-
| `agentops.task.priority` | string | Priority level of the task (e.g., `low`, `medium`, `high`). | `high` |
64-
| `agentops.task.state` | string | Current state of the task (e.g., `queued`, `in_progress`, `completed`). | `in_progress` |
65-
| `agentops.task.duration` | integer | Duration of the task execution in milliseconds. | `1500` |
118+
| `ai_agent.task.id` | string | Unique identifier for the task. | `task-abcde` |
119+
| `ai_agent.task.name` | string | Human-readable name of the task. | `Data Ingestion` |
120+
| `ai_agent.task.priority` | string | Priority level of the task (e.g., `low`, `medium`, `high`). | `high` |
121+
| `ai_agent.task.state` | string | Current state of the task (e.g., `queued`, `in_progress`, `completed`). | `in_progress` |
122+
| `ai_agent.task.duration` | integer | Duration of the task execution in milliseconds. | `1500` |
66123

67124
### Interaction Attributes
68125
For spans capturing interactions between agents:
69126

70127
| Attribute | Type | Description | Example |
71128
|-------------------------------|--------|---------------------------------------------------------------------|--------------------|
72-
| `agentops.interaction.type` | string | Type of interaction (e.g., `message_exchange`, `resource_request`). | `message_exchange` |
73-
| `agentops.interaction.source` | string | Identifier of the source agent. | `agent-01` |
74-
| `agentops.interaction.target` | string | Identifier of the target agent. | `agent-02` |
75-
| `agentops.interaction.status` | string | Outcome of the interaction (e.g., `success`, `error`, `timeout`). | `success` |
129+
| `ai_agent.interaction.type` | string | Type of interaction (e.g., `message_exchange`, `resource_request`). | `message_exchange` |
130+
| `ai_agent.interaction.source` | string | Identifier of the source agent. | `agent-01` |
131+
| `ai_agent.interaction.target` | string | Identifier of the target agent. | `agent-02` |
132+
| `ai_agent.interaction.status` | string | Outcome of the interaction (e.g., `success`, `error`, `timeout`). | `success` |
76133

77134
## Examples
78135

79136
### Example 1: Task Execution by a CrewAI Agent
80137

81138
- **Span Name**: `task.execution CrewAI`
82139
- **Attributes**:
83-
- `agentops.agent.id`: `agent-12345`
84-
- `agentops.agent.name`: `Data Aggregator`
85-
- `agentops.agent.type`: `CrewAI`
86-
- `agentops.session.id`: `session-67890`
87-
- `agentops.task.id`: `task-abcde`
88-
- `agentops.task.name`: `Data Ingestion`
89-
- `agentops.task.state`: `in_progress`
90-
- `agentops.task.duration`: `1500`
140+
- `ai_agent.agent.id`: `agent-12345`
141+
- `ai_agent.agent.name`: `Data Aggregator`
142+
- `ai_agent.agent.type`: `CrewAI`
143+
- `ai_agent.session.id`: `session-67890`
144+
- `ai_agent.task.id`: `task-abcde`
145+
- `ai_agent.task.name`: `Data Ingestion`
146+
- `ai_agent.task.state`: `in_progress`
147+
- `ai_agent.task.duration`: `1500`
91148

92149
### Example 2: Interaction Between LangGraph Agents
93150

94151
- **Span Name**: `interaction LangGraph`
95152
- **Attributes**:
96-
- `agentops.agent.id`: `agent-01`
97-
- `agentops.agent.name`: `Research Assistant`
98-
- `agentops.agent.type`: `LangGraph`
99-
- `agentops.session.id`: `session-12345`
100-
- `agentops.interaction.type`: `message_exchange`
101-
- `agentops.interaction.source`: `agent-01`
102-
- `agentops.interaction.target`: `agent-02`
103-
- `agentops.interaction.status`: `success`
153+
- `ai_agent.agent.id`: `agent-01`
154+
- `ai_agent.agent.name`: `Research Assistant`
155+
- `ai_agent.agent.type`: `LangGraph`
156+
- `ai_agent.session.id`: `session-12345`
157+
- `ai_agent.interaction.type`: `message_exchange`
158+
- `ai_agent.interaction.source`: `agent-01`
159+
- `ai_agent.interaction.target`: `agent-02`
160+
- `ai_agent.interaction.status`: `success`
104161

105162
In this example, a `Research Assistant` agent (`agent-01`) of type `LangGraph` engages in a `message_exchange` interaction with another agent (`agent-02`). The interaction is part of `session-12345` and completes successfully.
106163

107164
For a practical implementation of multi-agent collaboration using LangGraph, you can refer to the [Multi-Agent Collaboration Example](https://github.com/langchain-ai/langgraph/blob/main/examples/multi_agent/multi-agent-collaboration.ipynb) provided by LangGraph.
108165

109-
## Others
110-
111-
### Workflow
112-
- ai_agent.workflow.name
113-
- ai_agent.workflow.start_time
114-
- ai_agent.workflow.end_time
115-
- ai_agent.workflow.end_state
116-
- ai_agent.workflow.end_reason
117-
- ai_agent.workflow.tags
118-
- ai_agent.workflow.host_env
119-
- ai_agent.workflow.system
120-
121-
### Event
122-
123-
### Tools
124-
125-
### Agent
126-
127-
- ai_agent.agent.name
128-
- ai_agent.agent.workflow_name
129-
- ai_agent.agent.name
130-
- ai_agent.agent.llm_id
131-
132-
### Task
133-
134-
- ai_agent.task.name
135-
- ai_agent.task.agent_name
136-
- ai_agent.task.description
137-
- ai_agent.task.name
138-
- ai_agent.task.priority
139-
- ai_agent.task.state
140-
- ai_agent.task.duration
141-
142-
### Interaction
143-
144-
- ai_agent.interaction.type
145-
- ai_agent.interaction.source
146-
- ai_agent.interaction.target
147-
- ai_agent.interaction.status
166+
## Others

0 commit comments

Comments
 (0)