Skip to main content

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:
FieldTypeDefaultDescription
sourcestrName of the agent or component that sent this message
targetOptional[str]NoneName of the intended recipient, or None for broadcast

Frame Transport

TypePriorityDescription
BusFrameMessageDataWraps a Pipecat Frame for transport over the bus

BusFrameMessage

FieldTypeDefaultDescription
sourcestrSending agent name
targetOptional[str]NoneRecipient agent name
frameFrameThe Pipecat frame to transport
directionFrameDirectionDirection the frame should travel in the recipient’s pipeline
bridgeOptional[str]NoneBridge 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

FieldTypeDefaultDescription
sourcestrSending agent name
targetOptional[str]NoneAgent to activate
argsOptional[dict]NoneActivation arguments forwarded to on_activated

BusEndMessage / BusEndAgentMessage

FieldTypeDefaultDescription
sourcestrSending agent name
targetOptional[str]NoneRecipient agent name
reasonOptional[str]NoneHuman-readable reason for ending

BusCancelMessage / BusCancelAgentMessage

FieldTypeDefaultDescription
sourcestrSending agent name
targetOptional[str]NoneRecipient agent name
reasonOptional[str]NoneHuman-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

FieldTypeDefaultDescription
sourcestrAgent name
runnerstrName of the runner managing this agent
parentOptional[str]NoneName of the parent agent, or None for root agents
activeboolFalseWhether the agent started active
bridgedboolFalseWhether the agent is bridged
started_atOptional[float]NoneUnix 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

FieldTypeDefaultDescription
sourcestrRequester agent name
targetOptional[str]NoneWorker agent name
task_idstrUnique task identifier
task_nameOptional[str]NoneTask name for routing to named handlers
payloadOptional[dict]NoneStructured data describing the work

BusTaskResponseMessage / BusTaskResponseUrgentMessage

FieldTypeDefaultDescription
sourcestrWorker agent name
targetOptional[str]NoneRequester agent name
task_idstrThe task identifier
statusTaskStatusCompletion status
responseOptional[dict]NoneResult data

BusTaskUpdateMessage / BusTaskUpdateUrgentMessage

FieldTypeDefaultDescription
sourcestrWorker agent name
targetOptional[str]NoneRequester agent name
task_idstrThe task identifier
updateOptional[dict]NoneProgress data

BusTaskCancelMessage

FieldTypeDefaultDescription
sourcestrRequester agent name
targetOptional[str]NoneWorker agent name
task_idstrThe task identifier
reasonOptional[str]NoneHuman-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

FieldTypeDefaultDescription
sourcestrWorker agent name
targetOptional[str]NoneRequester agent name
task_idstrThe task identifier
dataOptional[dict]NoneStream metadata (start), chunk payload (data), or final metadata (end)