Skip to main content

Documentation Index

Fetch the complete documentation index at: https://daily-mb-ui-agent.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Bus messages are the communication primitives for the multi-agent framework. They are organized into two priority levels:
  • Data messages (BusDataMessage): Normal-priority messages for routine communication.
  • System messages (BusSystemMessage): High-priority messages that preempt normal messages in subscriber queues (e.g. cancel, errors).
Some messages also implement BusLocalMessage, meaning they stay on the local bus and are never forwarded to remote buses.
from pipecat_subagents.bus import (
    BusActivateAgentMessage,
    BusDeactivateAgentMessage,
    BusEndMessage,
    BusCancelMessage,
    # ... etc
)

Base Types

TypeParentDescription
BusMessage-Mixin carrying source and target metadata
BusLocalMessage-Mixin: message stays on the local bus only
BusDataMessageBusMessage, DataFrameNormal-priority bus message
BusSystemMessageBusMessage, SystemFrameHigh-priority bus message

Common Fields

All messages inherit these fields from BusDataMessage or BusSystemMessage: | Field | Type | Default | Description | | -------- | ----- | ------- | ----------------------------------------------------- | ------------------------------------------------------- | | source | str | | Name of the agent or component that sent this message | | target | str | None | None | Name of the intended recipient, or None for broadcast |

Frame Transport

TypePriorityDescription
BusFrameMessageDataWraps a Pipecat Frame for transport over the bus

BusFrameMessage

| Field | Type | Default | Description | | ----------- | ---------------- | ------- | ------------------------------------------------------------- | ---------------------------------------------- | | source | str | | Sending agent name | | target | str | None | None | Recipient agent name | | frame | Frame | | The Pipecat frame to transport | | direction | FrameDirection | | Direction the frame should travel in the recipient’s pipeline | | bridge | str | None | None | Bridge name for routing in multi-bridge setups |

Agent Lifecycle

TypePriorityLocalDescription
BusActivateAgentMessageDataNoTells a targeted agent to become active
BusDeactivateAgentMessageDataNoTells a targeted agent to become inactive
BusEndMessageDataNoRequest a graceful end of the session
BusEndAgentMessageDataNoTells a targeted agent to end its pipeline
BusCancelMessageSystemNoRequest a hard cancel of the session
BusCancelAgentMessageSystemNoTells a targeted agent to cancel its pipeline

BusActivateAgentMessage

| Field | Type | Default | Description | | -------- | ----- | ------- | ------------------ | ------------------------------------------------ | | source | str | | Sending agent name | | target | str | None | None | Agent to activate | | args | dict | None | None | Activation arguments forwarded to on_activated |

BusEndMessage / BusEndAgentMessage

| Field | Type | Default | Description | | -------- | ----- | ------- | ------------------ | -------------------------------- | | source | str | | Sending agent name | | target | str | None | None | Recipient agent name | | reason | str | None | None | Human-readable reason for ending |

BusCancelMessage / BusCancelAgentMessage

| Field | Type | Default | Description | | -------- | ----- | ------- | ------------------ | -------------------------------------- | | source | str | | Sending agent name | | target | str | None | None | Recipient agent name | | reason | str | None | None | Human-readable reason for cancellation |

Registry & Errors

TypePriorityLocalDescription
BusAddAgentMessageSystemYesRequest to add an agent to the local runner
BusAgentRegistryMessageSystemNoSnapshot of agents managed by a runner
BusAgentReadyMessageDataNoAnnounces that an agent is ready
BusAgentErrorMessageSystemNoReports an error from a root agent
BusAgentLocalErrorMessageSystemYesReports an error from a child agent to its parent

BusAgentRegistryMessage

FieldTypeDefaultDescription
sourcestrSending runner name
runnerstrName of the runner that owns these agents
agentslist[AgentRegistryEntry]List of agent entries with their state

BusAgentReadyMessage

| Field | Type | Default | Description | | ------------ | ------ | ------- | -------------------------------------- | --------------------------------------------------- | | source | str | | Agent name | | runner | str | | Name of the runner managing this agent | | parent | str | None | None | Name of the parent agent, or None for root agents | | active | bool | False | Whether the agent started active | | bridged | bool | False | Whether the agent is bridged | | started_at | float | None | None | Unix timestamp when the agent became ready |

BusAgentErrorMessage / BusAgentLocalErrorMessage

FieldTypeDescription
sourcestrAgent name
errorstrDescription of the error

Task Messages

TypePriorityDescription
BusTaskRequestMessageDataRequests a task agent to start work
BusTaskResponseMessageDataResponse from a task agent
BusTaskResponseUrgentMessageSystemHigh-priority response from a task agent
BusTaskUpdateMessageDataProgress update from a task agent
BusTaskUpdateUrgentMessageSystemHigh-priority progress update
BusTaskUpdateRequestMessageDataRequest a progress update from a task agent
BusTaskCancelMessageSystemCancel a running task

BusTaskRequestMessage

| Field | Type | Default | Description | | ----------- | ----- | ------- | ---------------------- | --------------------------------------- | | source | str | | Requester agent name | | target | str | None | None | Worker agent name | | task_id | str | | Unique task identifier | | task_name | str | None | None | Task name for routing to named handlers | | payload | dict | None | None | Structured data describing the work |

BusTaskResponseMessage / BusTaskResponseUrgentMessage

| Field | Type | Default | Description | | ---------- | ----------------------------------------------------------------- | ------- | ------------------- | -------------------- | | source | str | | Worker agent name | | target | str | None | None | Requester agent name | | task_id | str | | The task identifier | | status | TaskStatus | | Completion status | | response | dict | None | None | Result data |

BusTaskUpdateMessage / BusTaskUpdateUrgentMessage

| Field | Type | Default | Description | | --------- | ----- | ------- | ------------------- | -------------------- | | source | str | | Worker agent name | | target | str | None | None | Requester agent name | | task_id | str | | The task identifier | | update | dict | None | None | Progress data |

BusTaskCancelMessage

| Field | Type | Default | Description | | --------- | ----- | ------- | -------------------- | -------------------------------------- | | source | str | | Requester agent name | | target | str | None | None | Worker agent name | | task_id | str | | The task identifier | | reason | str | None | None | Human-readable reason for cancellation |

Task Streaming

TypePriorityDescription
BusTaskStreamStartMessageDataSignals the start of a streaming task response
BusTaskStreamDataMessageDataA chunk of streaming task data
BusTaskStreamEndMessageDataSignals the end of a streaming task response

BusTaskStreamStartMessage / BusTaskStreamDataMessage / BusTaskStreamEndMessage

| Field | Type | Default | Description | | --------- | ----- | ------- | ------------------- | ---------------------------------------------------------------------- | | source | str | | Worker agent name | | target | str | None | None | Requester agent name | | task_id | str | | The task identifier | | data | dict | None | None | Stream metadata (start), chunk payload (data), or final metadata (end) |

UI Messages

TypePriorityDescription
BusUIEventMessageDataUI event from the client to a server-side UIAgent
BusUICommandMessageDataUI command from a UIAgent to the client
BusUITaskGroupStartedMessageDataA user-facing task group has been dispatched (forwarded to the client as ui-task group_started)
BusUITaskUpdateMessageDataPer-worker progress (ui-task task_update)
BusUITaskCompletedMessageDataA worker in a user-facing task group has completed (ui-task task_completed)
BusUITaskGroupCompletedMessageDataA user-facing task group has finished (ui-task group_completed)
The bus messages are subagents-internal carriers that the bridge installed by attach_ui_bridge translates to/from the on-the-wire RTVI types. They live in pipecat_subagents.agents.ui.ui_messages.

BusUIEventMessage

Emitted by attach_ui_bridge when the client dispatches an event via PipecatClient.sendUIEvent(event, payload). UIAgent subclasses dispatch these to @on_ui_event(name) handlers. | Field | Type | Default | Description | | ------------ | ----- | ------- | -------------------------------- | -------------------------------------- | | source | str | | Sending component (the bridge) | | target | str | None | None | Recipient agent name (None broadcasts) | | event_name | str | "" | App-defined event name | | payload | Any | None | App-defined payload. Schemaless. |

BusUICommandMessage

Published by UIAgent.send_command. The bridge installed by attach_ui_bridge turns this into an RTVIUICommandFrame on the root agent’s pipeline; the RTVIObserver wraps the frame into a ui-command envelope on the wire and the client’s PipecatClient emits RTVIEvent.UICommand and invokes the onUICommand callback, where apps can dispatch by command name. | Field | Type | Default | Description | | -------------- | ----- | ------- | --------------------------------------------------------------- | -------------------------------------- | | source | str | | Sending agent name | | target | str | None | None | Recipient agent name (None broadcasts) | | command_name | str | "" | App-defined command name | | payload | Any | None | Plain dict by the time it lands on the bus (see send_command) |

BusUITaskGroupStartedMessage

Published by UIAgent.user_task_group(...) on entry. The bridge forwards it to the client as a ui-task envelope with kind = "group_started".
FieldTypeDefaultDescription
task_idstr""Shared task identifier for the group.
agentslist[str] | NoneNoneNames of the agents the work was dispatched to.
labelstr | NoneNoneOptional human-readable label for the group.
cancellableboolTrueWhether the client may request cancellation.
atint0Epoch milliseconds when the group started.

BusUITaskUpdateMessage

Forwarded by UIAgent whenever a worker emits a BusTaskUpdateMessage whose task_id matches a registered user task group. The bridge forwards to the client as a ui-task envelope with kind = "task_update".
FieldTypeDefaultDescription
task_idstr""The shared task identifier.
agent_namestr""The worker that produced the update.
dataAnyNoneThe worker’s update payload, forwarded verbatim.
atint0Epoch milliseconds when the update was emitted.

BusUITaskCompletedMessage

Forwarded by UIAgent whenever a worker’s BusTaskResponseMessage arrives for a registered user task group. The bridge forwards to the client as a ui-task envelope with kind = "task_completed".
FieldTypeDefaultDescription
task_idstr""The shared task identifier.
agent_namestr""The worker that produced the response.
statusstr""Completion status as a string (TaskStatus value).
responseAnyNoneThe worker’s response payload.
atint0Epoch milliseconds when the response was received.

BusUITaskGroupCompletedMessage

Published when UIAgent.user_task_group(...) exits, after every worker has responded (or the group has been cancelled). The bridge forwards to the client as a ui-task envelope with kind = "group_completed".
FieldTypeDefaultDescription
task_idstr""The shared task identifier.
atint0Epoch milliseconds when the group completed.

Wire-format type strings

The on-the-wire type strings ("ui-event", "ui-command", "ui-snapshot", "ui-cancel-task", "ui-task") live exclusively as Literal[...] defaults on the matching pydantic envelope models in pipecat.processors.frameworks.rtvi.models. There are no standalone UI_*_MESSAGE_TYPE constants. Client-side, the strings are members of the RTVIMessageType enum (e.g. RTVIMessageType.UI_EVENT).

attach_ui_bridge

def attach_ui_bridge(agent: BaseAgent, *, target: str | None = None) -> None
Wire the root agent’s pipeline to the UI Agent Protocol. Call this from the root agent’s on_ready hook. The root agent’s pipeline task must be built with enable_rtvi=True.
from pipecat_subagents.agents import attach_ui_bridge

class RootAgent(BaseAgent):
    async def on_ready(self) -> None:
        await super().on_ready()
        attach_ui_bridge(self, target="ui")
Side effects:
  • Inbound: subscribes to the RTVIProcessor’s on_ui_message handler. Every ui-event and ui-snapshot message is republished onto the bus as a BusUIEventMessage (snapshots are routed to UIAgent via a reserved internal event name; ui-cancel-task is routed similarly to cancel_task).
  • Outbound: subscribes to the bus. When a BusUICommandMessage arrives, the bridge pushes an RTVIUICommandFrame downstream; when one of the BusUITask* messages arrives, it pushes an RTVIUITaskFrame carrying the matching UITask*Data. The RTVIObserver wraps each frame into the ui-command / ui-task envelope on the wire.
| Parameter | Type | Default | Description | | --------- | ----------- | ------- | ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | agent | BaseAgent | | The root agent owning the pipeline task and RTVI processor. | | target | str | None | None | Optional target agent name for republished BusUIEventMessage. When None, the message is broadcast to every UIAgent on the bus. Pass the UI agent’s name (e.g. "ui") for direct delivery. | Raises: RuntimeError if the agent’s pipeline task has no RTVI processor.