haive.agents.supervisor.utils.registry ====================================== .. py:module:: haive.agents.supervisor.utils.registry .. autoapi-nested-parse:: Agent Registry for Haive Supervisor System. Manages agent lifecycle and routing model synchronization using DynamicChoiceModel. Provides runtime agent registration/deregistration with automatic routing updates. Classes ------- .. autoapisummary:: haive.agents.supervisor.utils.registry.AgentRegistry Module Contents --------------- .. py:class:: AgentRegistry(routing_model) Manages agent lifecycle and routing model synchronization. This class provides a centralized registry for managing agents in a supervisor system, with automatic synchronization to a DynamicChoiceModel for routing. Features: - Runtime agent registration/deregistration - Automatic routing model updates - Agent capability tracking - Conflict detection and resolution - Rich visualization of registry state Initialize agent registry. :param routing_model: DynamicChoiceModel to synchronize with agent changes .. py:method:: clear_all() Remove all registered agents. Warning: This will clear the entire registry! .. py:method:: get_agent(name) Get agent by name. :param name: Agent name :returns: Agent instance or None if not found .. py:method:: get_agent_capabilities() Get mapping of agent names to their capabilities. :returns: Dict mapping agent names to capability descriptions .. py:method:: get_agent_capability(agent_name) Get capability description for specific agent. :param agent_name: Name of agent :returns: Capability description or None if agent not found .. py:method:: get_agent_count() Get number of registered agents. :returns: Number of currently registered agents .. py:method:: get_available_agents() Get list of currently available agent names. :returns: List of agent names available for routing .. py:method:: get_registry_stats() Get registry statistics. :returns: Dictionary with registry statistics .. py:method:: get_routing_options() Get all routing options including END. :returns: List of all valid routing choices .. py:method:: is_agent_registered(agent_name) Check if agent is registered. :param agent_name: Agent name to check :returns: True if agent is registered, False otherwise .. py:method:: mark_rebuilt() Mark that supervisor graph has been rebuilt. .. py:method:: needs_rebuild() Check if supervisor graph needs rebuilding. :returns: True if agents have been added/removed since last check .. py:method:: print_registry_state() Print comprehensive registry state information. .. py:method:: register(agent, capability_description = None) Register an agent and update routing model. :param agent: Agent instance to register :param capability_description: Optional description of agent capabilities :returns: True if registration successful, False if agent name conflict :rtype: bool :raises ValueError: If agent has no name or invalid configuration .. py:method:: unregister(agent_name) Remove an agent and update routing model. :param agent_name: Name of agent to remove :returns: True if removal successful, False if agent not found :rtype: bool .. py:method:: validate_routing_choice(choice) Validate if a routing choice is valid. :param choice: Routing choice to validate :returns: True if choice is valid, False otherwise