agents.experiments.static_supervisor_with_sync

Static supervisor inheriting from ReactAgent with tool node modifications.

This supervisor uses ReactAgent’s looping behavior but modifies the tool node to execute agent handoffs stored in state.

Classes

AgentEntry

Represents a registered agent in the supervisor state.

StaticSupervisor

Supervisor that inherits ReactAgent behavior with modified tool node.

SupervisorReactState

State schema for ReactAgent-based supervisor with agent registry.

Module Contents

class agents.experiments.static_supervisor_with_sync.AgentEntry(/, **data)

Bases: pydantic.BaseModel

Represents a registered agent in the supervisor state.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

classmethod from_agent(name, description, agent)

Create an AgentEntry from an agent instance.

Parameters:
  • name (str)

  • description (str)

  • agent (haive.agents.base.agent.Agent)

Return type:

AgentEntry

get_agent()

Deserialize and return the agent instance.

Return type:

haive.agents.base.agent.Agent

class agents.experiments.static_supervisor_with_sync.StaticSupervisor(**kwargs)

Bases: haive.agents.react.agent.ReactAgent

Supervisor that inherits ReactAgent behavior with modified tool node.

This supervisor uses ReactAgent’s looping behavior but overrides the tool node to execute agent handoffs from state instead of regular tools.

Initialize supervisor with custom state schema.

build_graph()

Build graph using ReactAgent pattern with custom tool execution.

Return type:

haive.core.graph.state_graph.base_graph2.BaseGraph

register_agent(name, description, agent)

Register an agent with the supervisor.

This updates the state and triggers tool synchronization.

Parameters:
  • name (str)

  • description (str)

  • agent (haive.agents.base.agent.Agent)

Return type:

None

setup_agent()

Setup the supervisor with dynamic tools.

Return type:

None

class agents.experiments.static_supervisor_with_sync.SupervisorReactState(/, **data)

Bases: haive.core.schema.state_schema.StateSchema

State schema for ReactAgent-based supervisor with agent registry.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

sync_tools_with_agents()

Ensure handoff tools are synchronized with registered agents.

This validator runs after field assignment to ensure tools always match the registered agents.

Return type:

SupervisorReactState