Skip to main content

Events

AG-UI uses a streaming event-based architecture. Events are the units of communication from an agent backend to a frontend UI. In .NET, every protocol event derives from BaseEvent and has a type discriminator.

Event Type Constants

AGUIEventTypes defines the SCREAMING_SNAKE_CASE wire discriminators:

BaseEvent

All events inherit from BaseEvent.

Lifecycle Events

Lifecycle events represent the run and step lifecycle.

RunStartedEvent

Signals the start of an agent run.

RunFinishedEvent

Signals the completion of an agent run.
RunFinishedOutcome is a polymorphic value with type: "success" or type: "interrupt". RunFinishedInterruptOutcome carries interrupts, an IList<AGUIInterrupt>.

RunErrorEvent

Signals an error during an agent run.

StepStartedEvent

Signals the start of a named step.

StepFinishedEvent

Signals the completion of a named step.

Text Message Events

Text message events stream assistant text as a start/content/end sequence.

TextMessageStartEvent

TextMessageContentEvent

TextMessageEndEvent

Tool Call Events

Tool call events stream tool invocation arguments and optional server-side results.

ToolCallStartEvent

ToolCallArgsEvent

ToolCallEndEvent

ToolCallResultEvent

State Management Events

State events synchronize frontend state and message history.

StateSnapshotEvent

Provides a complete state snapshot.

StateDeltaEvent

Provides incremental state changes, commonly as JSON Patch operations.

MessagesSnapshotEvent

Replaces the frontend conversation history with the server’s view.

Reasoning Events

Reasoning events expose a model or agent reasoning stream. They can create and update AGUIReasoningMessage entries in message history.

ReasoningStartEvent

ReasoningMessageStartEvent

ReasoningMessageContentEvent

ReasoningMessageEndEvent

ReasoningMessageChunkEvent

Compact reasoning message chunk event with optional fields.

ReasoningEndEvent

ReasoningEncryptedValueEvent

Attaches an encrypted value to a message or tool call.

Activity Events

Activity events carry structured progress state for UI renderers.

ActivitySnapshotEvent

ActivityDeltaEvent

Special Events

RawEvent

Passes through unprocessed external data.

CustomEvent

Carries application-specific data.

Serialization

BaseEvent uses a discriminator-based JSON converter keyed on the type field. All concrete event types are registered in AGUIJsonSerializerContext.