Skip to content

strands.plugins.multiagent_registry

MultiAgentPlugin registry for managing plugins attached to a multi-agent orchestrator.

This module provides the _MultiAgentPluginRegistry class for tracking and managing plugins that have been initialized with an orchestrator instance.

class _MultiAgentPluginRegistry()

Defined in: src/strands/plugins/multiagent_registry.py:20

Registry for managing plugins attached to a multi-agent orchestrator.

The _MultiAgentPluginRegistry tracks plugins that have been initialized with an orchestrator, providing methods to add plugins and invoke their initialization.

The registry handles:

  1. Calling the plugin’s init_multi_agent() method for custom initialization
  2. Auto-registering discovered @hook decorated methods with the orchestrator

Example:

registry = _MultiAgentPluginRegistry(orchestrator)
class MyPlugin(MultiAgentPlugin):
name = "my-plugin"
@hook
def on_event(self, event: BeforeNodeCallEvent):
pass # Auto-registered by registry
def init_multi_agent(self, orchestrator: MultiAgentBase) -> None:
# Custom logic
pass
plugin = MyPlugin()
registry.add_and_init(plugin)
def __init__(orchestrator: "MultiAgentBase") -> None

Defined in: src/strands/plugins/multiagent_registry.py:50

Initialize a plugin registry with an orchestrator reference.

Arguments:

  • orchestrator - The orchestrator instance that plugins will be initialized with.
def add_and_init(plugin: MultiAgentPlugin) -> None

Defined in: src/strands/plugins/multiagent_registry.py:67

Add and initialize a plugin with the orchestrator.

This method:

  1. Registers the plugin in the registry
  2. Calls the plugin’s init_multi_agent method for custom initialization
  3. Auto-registers all discovered @hook methods with the orchestrator’s hook registry

Handles both sync and async init_multi_agent implementations automatically.

Arguments:

  • plugin - The plugin to add and initialize.

Raises:

  • ValueError - If a plugin with the same name is already registered.