Stream call as a properly sequenced AG-UI event stream. Events like RUN_STARTED, TEXT_MESSAGE_CONTENT, TOOL_CALL_START, and REASONING_MESSAGE_CONTENT are produced in the correct order during every Stream call. Any frontend built on the AG-UI client SDK — including CopilotKit and custom React clients — works out of the box.
Serialize any event with event.ToJSON() and forward it over SSE, WebSocket, or Redis to your frontend. The receiving client handles rendering, tool display, and state — your Go server just forwards bytes.
Basic integration
When using conversation, pass the session ID inAgentStreamOptions — the AG-UI client uses it to thread messages correctly across turns:
event.ToJSON() on any AgentEvent to get AG-UI-compatible JSON.
Reference app
Agent Chat — production-shaped split API/worker app with Postgres, SSE streaming, and CopilotKit UI.Example
AG-UI
Go SSE server + CopilotKit UI
Related
Streaming
Stream API and event types
Approvals
CUSTOM events and AgentStream.Approve