Skip to content

pyagent-patterns — Structural (Tier 3)

pyagent_patterns.structural.role_based.RoleBased

Bases: Pattern

Agents with distinct roles collaborate in structured rounds.

Parameters:

Name Type Description Default
agents list[Agent]

List of role-specialized agents (order matters for turn-taking).

required
rounds int

Number of communication rounds.

1
shared_context bool

If True, all agents see all prior messages. If False, each agent only sees the immediately preceding message.

True

pyagent_patterns.structural.layered.Layered

Bases: Pattern

Hierarchical layers of agents with increasing abstraction.

Parameters:

Name Type Description Default
layers list[Layer]

Ordered list of layers from bottom (data) to top (synthesis).

required

pyagent_patterns.structural.topology.Topology

Bases: Pattern

Configurable agent communication topology.

Parameters:

Name Type Description Default
agents list[Agent]

List of agents participating in the topology.

required
topology TopologyType

The communication structure (chain, star, mesh).

CHAIN
hub_index int

For star topology, the index of the hub agent. Defaults to 0.

0
rounds int

For mesh topology, number of communication rounds.

1

pyagent_patterns.structural.blackboard.Blackboard

Bases: Pattern

Shared-state communication via a blackboard store.

Parameters:

Name Type Description Default
agents list[BlackboardAgent]

List of BlackboardAgent wrappers specifying read/write keys.

required
rounds int

Number of rounds agents process the blackboard.

1
initial_state dict[str, Any] | None

Optional initial blackboard values.

None