collaboration
¤
Collaboration protocol models for CrewMaster v2.0.0.
| MODULE | DESCRIPTION |
|---|---|
protocol |
Collaboration protocol implementations for CrewMaster v2.0.0. |
protocol_test |
Tests for CollaborationProtocol implementations. |
| CLASS | DESCRIPTION |
|---|---|
BlackboardConfig |
Configuration for the blackboard collaboration protocol. |
BlackboardProtocol |
Blackboard protocol: all participants see all messages. |
CollaborationProtocol |
Base protocol for multi-agent collaboration strategies. |
CollaborationResult |
The result of executing a collaboration protocol. |
ConsensusConfig |
Configuration for the consensus collaboration protocol. |
ConsensusItem |
A single proposal or vote item in the consensus protocol. |
ConsensusProtocol |
Consensus protocol: participants propose and vote until consensus. |
DebateConfig |
Configuration for the debate collaboration protocol. |
DebateProtocol |
Debate protocol: two debaters argue, optional judge decides winner. |
GrillMeConfig |
Configuration for the grill_me collaboration protocol. |
GrillMeProtocol |
Grill-me protocol: critic and respondent alternate turns. |
SupervisorConfig |
Configuration for the supervisor collaboration protocol. |
SupervisorProtocol |
Supervisor protocol: supervisor assigns, workers execute, supervisor reviews. |
__all__
module-attribute
¤
__all__ = ['BlackboardConfig', 'BlackboardProtocol', 'CollaborationProtocol', 'CollaborationResult', 'ConsensusConfig', 'ConsensusItem', 'ConsensusProtocol', 'DebateConfig', 'DebateProtocol', 'GrillMeConfig', 'GrillMeProtocol', 'SupervisorConfig', 'SupervisorProtocol']
BlackboardConfig
¤
Configuration for the blackboard collaboration protocol.
| ATTRIBUTE | DESCRIPTION |
|---|---|
participants |
List of agents that contribute to the blackboard. |
max_rounds |
Maximum number of rounds of contributions.
TYPE:
|
participants
class-attribute
instance-attribute
¤
BlackboardProtocol
¤
BlackboardProtocol(config: BlackboardConfig)
Blackboard protocol: all participants see all messages.
Flow::
round 1: agent_1 -> agent_2 -> ... -> agent_N
round 2: agent_1 -> agent_2 -> ... -> agent_N
...
History is indexed by round and contributor. All participants see all messages from all prior contributions.
| METHOD | DESCRIPTION |
|---|---|
execute |
Public entry point — delegates to |
| ATTRIBUTE | DESCRIPTION |
|---|---|
config |
|
CollaborationProtocol
¤
Base protocol for multi-agent collaboration strategies.
Collaboration protocols orchestrate multiple agents through structured interaction patterns. Each protocol implementation manages turn state internally and produces a single typed output artifact.
Usage::
class GrillMeProtocol:
async def execute(self, operation, runtime, context_store):
# Run N rounds of critique -> revision
...
return CollaborationResult(output=final_artifact)
| METHOD | DESCRIPTION |
|---|---|
execute |
Execute the collaboration protocol. |
execute
async
¤
execute(operation: Any, runtime: Any, context_store: Any) -> CollaborationResult
Execute the collaboration protocol.
| PARAMETER | DESCRIPTION |
|---|---|
|
The Operation that triggered this collaboration.
TYPE:
|
|
The RuntimeDriver to use for agent invocations.
TYPE:
|
|
The ContextStore for resolving context projectors.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CollaborationResult
|
A CollaborationResult with the final typed artifact. |
CollaborationResult
¤
The result of executing a collaboration protocol.
| ATTRIBUTE | DESCRIPTION |
|---|---|
output |
The final typed artifact produced by the collaboration.
TYPE:
|
protocol_type |
The name of the protocol that produced this result.
TYPE:
|
turn_count |
Total number of turns taken during execution.
TYPE:
|
participant_outputs |
Individual outputs from each participant indexed by agent name. |
participant_outputs
class-attribute
instance-attribute
¤
ConsensusConfig
¤
Configuration for the consensus collaboration protocol.
| ATTRIBUTE | DESCRIPTION |
|---|---|
participants |
List of agents that vote/propose. |
max_rounds |
Maximum number of voting rounds before forced decision.
TYPE:
|
consensus_threshold |
Fraction (0-1) of participants that must agree.
TYPE:
|
ConsensusItem
¤
ConsensusProtocol
¤
ConsensusProtocol(config: ConsensusConfig)
Consensus protocol: participants propose and vote until consensus.
Flow::
round 1: each participant proposes -> vote on proposals -> check consensus
round 2: participants revise proposals -> vote -> check consensus
...
Consensus is reached when consensus_threshold fraction of participants
agree on the same proposal. If max_rounds is reached without consensus,
the majority position is returned.
| METHOD | DESCRIPTION |
|---|---|
execute |
Public entry point — delegates to |
| ATTRIBUTE | DESCRIPTION |
|---|---|
config |
|
DebateConfig
¤
Configuration for the debate collaboration protocol.
| ATTRIBUTE | DESCRIPTION |
|---|---|
debater_a |
First debater agent.
TYPE:
|
debater_b |
Second debater agent.
TYPE:
|
judge |
Optional judge agent who determines the winner.
TYPE:
|
max_turns |
Maximum number of debate rounds.
TYPE:
|
debater_a
class-attribute
instance-attribute
¤
debater_a: Any = Field(description='AgentConfig for debater A')
debater_b
class-attribute
instance-attribute
¤
debater_b: Any = Field(description='AgentConfig for debater B')
DebateProtocol
¤
DebateProtocol(config: DebateConfig)
Debate protocol: two debaters argue, optional judge decides winner.
Flow::
debater_a -> debater_b -> debater_a -> ... -> judge -> winner
If no judge is provided, the last debater's position is returned.
| METHOD | DESCRIPTION |
|---|---|
execute |
Public entry point — delegates to |
| ATTRIBUTE | DESCRIPTION |
|---|---|
config |
|
GrillMeConfig
¤
Configuration for the grill_me collaboration protocol.
| ATTRIBUTE | DESCRIPTION |
|---|---|
critic |
The agent who critiques.
TYPE:
|
respondent |
The agent who produces and revises.
TYPE:
|
max_turns |
Maximum number of critique->revision cycles.
TYPE:
|
stalemate_threshold |
Stop if respondent output doesn't change for this many consecutive turns.
TYPE:
|
finalize_step |
Optional agent that does a final polish pass.
TYPE:
|
critic
class-attribute
instance-attribute
¤
critic: Any = Field(description='AgentConfig for the critic')
respondent
class-attribute
instance-attribute
¤
respondent: Any = Field(description='AgentConfig for the respondent')
stalemate_threshold
class-attribute
instance-attribute
¤
stalemate_threshold: int = Field(default=2, ge=1)
GrillMeProtocol
¤
GrillMeProtocol(config: GrillMeConfig)
Grill-me protocol: critic and respondent alternate turns.
Flow::
respondent produces -> critic critiques -> respondent revises -> ...
Terminates when max_turns is reached, or when the respondent's output
is unchanged for stalemate_threshold consecutive turns.
| METHOD | DESCRIPTION |
|---|---|
execute |
Public entry point — delegates to |
| ATTRIBUTE | DESCRIPTION |
|---|---|
config |
|
SupervisorConfig
¤
Configuration for the supervisor collaboration protocol.
| ATTRIBUTE | DESCRIPTION |
|---|---|
supervisor |
The agent that assigns tasks and reviews results.
TYPE:
|
workers |
List of worker agents that execute assigned tasks. |
max_iterations |
Maximum number of assign->execute->review cycles.
TYPE:
|
SupervisorProtocol
¤
SupervisorProtocol(config: SupervisorConfig)
Supervisor protocol: supervisor assigns, workers execute, supervisor reviews.
Flow::
supervisor assigns task -> worker executes -> supervisor reviews -> iterate
The supervisor receives the worker's output and decides whether to accept it or request a revision. The final output is the consolidated result produced by the supervisor.
| METHOD | DESCRIPTION |
|---|---|
execute |
Public entry point — delegates to |
| ATTRIBUTE | DESCRIPTION |
|---|---|
config |
|