Architecture and flow

For a conversation response, the client first stores a user message, then submits a separate run request. Saving the message alone does not start a run.

Events record progress while the runtime works, then the result is stored in the conversation. Project-owned agent runs can also execute without conversation messages.

Flow

StepWhat happens
1A user message is stored in the conversation.
2The client requests a run to produce the assistant response.
3Events record streaming output, tool calls, state, and terminal status.
4The final answer is stored as an assistant message.

What persists

ObjectStores
ConversationThread metadata, project scope, active branch, and message count.
MessageUser prompts, assistant answers, tool output, files, citations, and typed parts.
RunExecution identity, owner, status, lineage, and terminal state.
Agent runAgent execution state and a message link when attached to a conversation.
Run eventOrdered execution history for streaming output, tool calls, state, errors, and completion.
Input requestStructured input needed while a run is waiting.

Why events matter

Clients replay stored events to reconstruct progress and inspect the outcome. Reading events does not resume execution. A waiting run needs the response or resume signal required by its current state.

See AG-UI event reference for event types.