Activity Events Proposal
Summary
Problem Statement
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.Motivation
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.Status
- Status: Draft
- Author(s): Markus Ecker (mail@mme.xyz)
Background
Users want real-time visibility into agent activities as they happen. Consider this example UI:Use Cases
- Workflows: Step-by-step progress through workflow execution
- Planning: Intermediate planning or tool use visibility
- Custom frameworks: Signals representing ongoing work in any agent system
Challenges
- Flexibility: Must handle arbitrary activity data from different frameworks
- Serializability: Events must be replayable and rehydrated for session recovery
- Extensibility: Developers should define custom renderers per activity type, with a generic fallback
- Chronology: Activities must interleave naturally with chat and run events
Detailed Specification
Overview
This proposal introduces new concepts to the AG-UI protocol:- ActivitySnapshotEvent and ActivityDeltaEvent: Two new event types following the established state management pattern
- ActivityMessage: A new message type alongside TextMessage, ToolMessage, etc.
New Events: ActivitySnapshotEvent and ActivityDeltaEvent
Following the established pattern in AG-UI (similar toStateSnapshotEvent
and StateDeltaEvent
), activities are represented using two complementary events:
ActivitySnapshotEvent
Provides the complete activity state at a point in time.ActivityDeltaEvent
Provides incremental updates to the activity state.Example Events
Initial activity snapshot:New Message: ActivityMessage
Rendering Strategy
- Generic renderer: Displays raw snapshot/patch as JSON or formatted text
- Custom renderer: Developers can register a renderer per
activityType
:"PLAN"
→ Interactive checklist component"SEARCH"
→ Live status with progress indicators"WORKFLOW"
→ Step-by-step workflow visualization
Implementation Considerations
Client SDK Changes
TypeScript SDK additions:- New
ActivitySnapshotEvent
andActivityDeltaEvent
types in@ag-ui/core
- New
ActivityMessage
type in message unions - Activity renderer registry in
@ag-ui/client
- JSON Patch utilities for activity updates
- New
ActivitySnapshotEvent
andActivityDeltaEvent
classes inag_ui.core.events
- New
ActivityMessage
class in message types - Activity serialization/deserialization support
- JSON Patch utilities for activity updates
Integration Impact
- Planning Frameworks: Can emit ActivitySnapshotEvent/ActivityDeltaEvent during planning or tool execution phases
- Workflow Systems: Can surface step-by-step workflow progress as ActivitySnapshotEvent/ActivityDeltaEvent
- Other frameworks: May emit ActivitySnapshotEvent/ActivityDeltaEvent freely; AG-UI will serialize them like other events
Examples and Use Cases
Example 1: Web Search Activity
Use Case: Multi-Step Workflow Visibility
A data analysis agent performing multiple steps:- Loading dataset → ActivitySnapshotEvent/ActivityDeltaEvent shows progress bar
- Cleaning data → ActivitySnapshotEvent/ActivityDeltaEvent shows rows processed
- Running analysis → ActivitySnapshotEvent/ActivityDeltaEvent shows current computation
- Generating report → ActivitySnapshotEvent/ActivityDeltaEvent shows sections completed
Testing Strategy
- Unit tests for ActivitySnapshotEvent/ActivityDeltaEvent serialization/deserialization
- Integration tests with mock frameworks emitting ActivitySnapshotEvent/ActivityDeltaEvent
- E2E tests in AG-UI Dojo demonstrating activity rendering
- Performance benchmarks for high-frequency activity updates
- JSON Patch application correctness tests