AgentBus
Abstract base for inter-agent and runner-agent communication. Provides pub/sub messaging where each subscriber receives messages independently through its own priority queue. System messages (e.g. cancel) are delivered before normal data messages.Methods
start
stop
subscribe
| Parameter | Type | Description |
|---|---|---|
subscriber | BusSubscriber | The subscriber to register |
unsubscribe
| Parameter | Type | Description |
|---|---|---|
subscriber | BusSubscriber | The subscriber to remove |
send
publish() for transport.
| Parameter | Type | Description |
|---|---|---|
message | BusMessage | The bus message to send |
publish
| Parameter | Type | Description |
|---|---|---|
message | BusMessage | The bus message to publish |
on_message_received
send() or from a network transport).
AsyncQueueBus
In-process bus that delivers messages via priority queues. This is the default bus used byAgentRunner when no bus is provided.
RedisBus
Distributed agent bus backed by Redis pub/sub for cross-process communication.Requires the redis extra:
pip install pipecat-ai-subagents[redis]Configuration
A
redis.asyncio.Redis client instance.The
MessageSerializer
for encoding/decoding messages. Defaults to
JSONMessageSerializer.The Redis pub/sub channel name.
BusBridgeProcessor
Bidirectional mid-pipeline bridge between a Pipecat pipeline and the bus. Placed in a transport or session agent’s pipeline to exchange frames with other agents via theAgentBus.
Configuration
The
AgentBus to exchange frames with.Name of this agent, used as message source.
When set, only exchange frames with this agent.
Optional bridge name for routing. When set, outgoing frames are tagged with
this name and only incoming frames with the same bridge name are accepted.
Extra frame types that should never cross the bus (on top of lifecycle frames
which are always excluded).
BusSubscriber
Mixin for objects that receive messages from anAgentBus. Implementors override on_bus_message() to handle incoming messages.