Skip to content

Commit ea49443

Browse files
committed
wip
1 parent 1f4500f commit ea49443

File tree

7 files changed

+405
-178
lines changed

7 files changed

+405
-178
lines changed

docs/drafts/activity-events.mdx

Lines changed: 41 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,36 @@
11
---
22
title: Activity Events
3-
description: Proposal for representing ongoing agent progress between chat messages
3+
description:
4+
Proposal for representing ongoing agent progress between chat messages
45
---
56

67
# Activity Events Proposal
78

89
## Summary
910

1011
### Problem Statement
11-
Users want to render "activity" updates inline with chat, not just at run start or end. Currently, there's no standardized way to represent ongoing agent progress between chat messages.
12+
13+
Users want to render "activity" updates inline with chat, not just at run start
14+
or end. Currently, there's no standardized way to represent ongoing agent
15+
progress between chat messages.
1216

1317
### Motivation
14-
AG-UI is extended with **ActivityEvents** and **ActivityMessages** to represent ongoing agent progress in between chat messages. This allows frameworks to surface fine-grained activity updates chronologically, giving users immediate visibility into what an agent is doing without waiting for the next message or run boundary.
18+
19+
AG-UI is extended with **ActivityEvents** and **ActivityMessages** to represent
20+
ongoing agent progress in between chat messages. This allows frameworks to
21+
surface fine-grained activity updates chronologically, giving users immediate
22+
visibility into what an agent is doing without waiting for the next message or
23+
run boundary.
1524

1625
## Status
1726

1827
- **Status**: Draft
19-
- **Author(s)**: Markus Ecker ([email protected])
28+
- **Author(s)**: Markus Ecker ([email protected])
2029

2130
## Background
2231

23-
Users want real-time visibility into agent activities as they happen. Consider this example UI:
32+
Users want real-time visibility into agent activities as they happen. Consider
33+
this example UI:
2434

2535
```
2636
+------------------------------------------------------------+
@@ -41,19 +51,24 @@ Users want real-time visibility into agent activities as they happen. Consider t
4151
## Challenges
4252

4353
- **Flexibility**: Must handle arbitrary activity data from different frameworks
44-
- **Serializability**: Events must be replayable and rehydrated for session recovery
45-
- **Extensibility**: Developers should define custom renderers per activity type, with a generic fallback
54+
- **Serializability**: Events must be replayable and rehydrated for session
55+
recovery
56+
- **Extensibility**: Developers should define custom renderers per activity
57+
type, with a generic fallback
4658
- **Chronology**: Activities must interleave naturally with chat and run events
4759

4860
## Detailed Specification
4961

5062
### Overview
5163

5264
This proposal introduces two new concepts to the AG-UI protocol:
65+
5366
1. **ActivityEvent**: A new event type in the event stream
54-
2. **ActivityMessage**: A new message type alongside TextMessage, ToolMessage, etc.
67+
2. **ActivityMessage**: A new message type alongside TextMessage, ToolMessage,
68+
etc.
5569

56-
Frameworks may emit ActivityEvents, and frontends can render them inline with chat.
70+
Frameworks may emit ActivityEvents, and frontends can render them inline with
71+
chat.
5772

5873
### New Event: ActivityEvent
5974

@@ -83,6 +98,7 @@ type ActivityEvent = BaseEvent & {
8398
#### Example Events
8499
85100
Initial activity snapshot:
101+
86102
```json
87103
{
88104
"id": "evt_001",
@@ -97,6 +113,7 @@ Initial activity snapshot:
97113
```
98114
99115
Incremental update via patch:
116+
100117
```json
101118
{
102119
"id": "evt_002",
@@ -139,20 +156,25 @@ type ActivityMessage = {
139156
### Client SDK Changes
140157
141158
TypeScript SDK additions:
159+
142160
- New `ActivityEvent` type in `@ag-ui/core`
143161
- New `ActivityMessage` type in message unions
144162
- Activity renderer registry in `@ag-ui/client`
145163
146164
Python SDK additions:
165+
147166
- New `ActivityEvent` class in `ag_ui.core.events`
148167
- New `ActivityMessage` class in message types
149168
- Activity serialization/deserialization support
150169
151170
### Integration Impact
152171
153-
- **Planning Frameworks**: Can emit ActivityEvents during planning or tool execution phases
154-
- **Workflow Systems**: Can surface step-by-step workflow progress as ActivityEvents
155-
- **Other frameworks**: May emit ActivityEvents freely; AG-UI will serialize them like other events
172+
- **Planning Frameworks**: Can emit ActivityEvents during planning or tool
173+
execution phases
174+
- **Workflow Systems**: Can surface step-by-step workflow progress as
175+
ActivityEvents
176+
- **Other frameworks**: May emit ActivityEvents freely; AG-UI will serialize
177+
them like other events
156178
157179
## Examples and Use Cases
158180
@@ -167,9 +189,9 @@ agent.emitActivity({
167189
sources: [
168190
{ name: "Reddit", status: "pending" },
169191
{ name: "X.com", status: "pending" },
170-
{ name: "Google", status: "pending" }
171-
]
172-
}
192+
{ name: "Google", status: "pending" },
193+
],
194+
},
173195
})
174196

175197
// Update as search progresses
@@ -179,14 +201,15 @@ agent.emitActivity({
179201
patch: {
180202
op: "replace",
181203
path: "/sources/0/status",
182-
value: "complete"
183-
}
204+
value: "complete",
205+
},
184206
})
185207
```
186208

187209
### Use Case: Multi-Step Workflow Visibility
188210

189211
A data analysis agent performing multiple steps:
212+
190213
1. Loading dataset → ActivityEvent shows progress bar
191214
2. Cleaning data → ActivityEvent shows rows processed
192215
3. Running analysis → ActivityEvent shows current computation
@@ -205,4 +228,4 @@ Each step appears inline with chat, giving users real-time feedback.
205228

206229
- [JSON Patch RFC 6902](https://tools.ietf.org/html/rfc6902)
207230
- [AG-UI Events Documentation](/concepts/events)
208-
- [AG-UI Messages Documentation](/concepts/messages)
231+
- [AG-UI Messages Documentation](/concepts/messages)

0 commit comments

Comments
 (0)