Understanding communication flows in Agency Swarm.
SendMessage
mechanism. This is fundamentally different from sequential handoffs:
output_type
, and control always returns to the Portfolio Manager who compiles the final recommendation.Updated version of the framework now also supports >
and <
symbols to define communication flows in a more intuitive and readable way.communication_flows
parameter. Each tuple defined as either (sender, receiver)
or (sender > receiver)
or (receiver < sender)
defines a directional communication path. Entry points are defined as positional arguments to the Agency constructor.The CEO can initiate communication and send tasks to the Developer and the Virtual Assistant, and they can respond back in the same thread, but the Developer or VA cannot initiate a conversation and assign tasks to the CEO.All agents added as entry points can talk to the user. You can add as many levels of communication as you want.SendMessage
tool to allow agents to communicate with each other. By defining communication flows, it adds new recipients to the SendMessage
function. If you’d like to modify the behavior of this tool, you can do so by creating your own Custom Communication Flows (Advanced).
It’s important to understand that each defined communication flow establishes a distinct context for interaction. When the SendMessage
tool is invoked by a sender agent (e.g., CEO) to a recipient agent (e.g., Developer), this happens within a dedicated conversation thread specific to that CEO-Developer pair. In this thread, the sender agent effectively takes on the role of a “user,” and the recipient agent responds as the “assistant.” This ensures that the history and context of communication between any two agents are isolated and maintained separately for each specific flow.