showcase/shell-docs/src/content/ag-ui/drafts/meta-events.mdx
Currently, AG-UI events are tightly coupled to agent runs. There's no standardized way to attach user feedback, annotations, or external signals to the event stream that are independent of the agent's execution lifecycle.
AG-UI is extended with MetaEvents, a new class of events that can occur at any point in the event stream, independent of agent runs. MetaEvents provide a way to attach annotations, signals, or feedback to a serialized stream. They may originate from users, clients, or external systems rather than from agents. Examples include reactions such as thumbs up/down on a message.
This proposal introduces:
type MetaEvent = BaseEvent & {
type: EventType.META;
/**
* Application-defined type of the meta event.
* Examples: "thumbs_up", "thumbs_down", "tag", "note"
*/
metaType: string;
/**
* Application-defined payload.
* May reference other entities (e.g., messageId) or contain freeform data.
*/
payload: Record<string, unknown>;
};
Thumbs Up:
{
"id": "evt_123",
"ts": 1714063982000,
"type": "META",
"metaType": "thumbs_up",
"payload": {
"messageId": "msg_456",
"userId": "user_789"
}
}
Thumbs Down with Reason:
{
"id": "evt_124",
"ts": 1714063985000,
"type": "META",
"metaType": "thumbs_down",
"payload": {
"messageId": "msg_456",
"userId": "user_789",
"reason": "inaccurate",
"comment": "The calculation seems incorrect"
}
}
User Note:
{
"id": "evt_789",
"ts": 1714064001000,
"type": "META",
"metaType": "note",
"payload": {
"text": "Important question to revisit",
"relatedRunId": "run_001",
"author": "user_123"
}
}
Tag Assignment:
{
"id": "evt_890",
"ts": 1714064100000,
"type": "META",
"metaType": "tag",
"payload": {
"tags": ["important", "follow-up"],
"threadId": "thread_001"
}
}
Analytics Event:
{
"id": "evt_901",
"ts": 1714064200000,
"type": "META",
"metaType": "analytics",
"payload": {
"event": "conversation_shared",
"properties": {
"shareMethod": "link",
"recipientCount": 3
}
}
}
Moderation Flag:
{
"id": "evt_902",
"ts": 1714064300000,
"type": "META",
"metaType": "moderation",
"payload": {
"action": "flag",
"messageId": "msg_999",
"category": "inappropriate_content",
"confidence": 0.95
}
}
While applications can define their own types, these are commonly used:
| MetaType | Description | Typical Payload |
|---|---|---|
thumbs_up | Positive feedback | { messageId, userId } |
thumbs_down | Negative feedback | { messageId, userId, reason? } |
note | User annotation | { text, relatedId?, author } |
tag | Categorization | { tags[], targetId } |
bookmark | Save for later | { messageId, userId } |
copy | Content copied | { messageId, content } |
share | Content shared | { messageId, method } |
rating | Numeric rating | { messageId, rating, maxRating } |
Capture user reactions to agent responses for quality improvement.
Allow users to add notes, tags, or bookmarks to important parts of conversations.
Record user interactions and behaviors without affecting agent execution.
Flag or mark content for review by external moderation systems.
Enable multiple users to annotate or comment on shared conversations.
Create a complete record of all interactions, not just agent responses.
TypeScript SDK:
MetaEvent type in @ag-ui/corePython SDK:
MetaEvent class implementation