agents.dynamic_supervisor.promptsΒΆ

Prompt templates for dynamic supervisor agent.

This module contains prompt templates and system messages used by the dynamic supervisor for task routing and agent management.

Constants:

SUPERVISOR_SYSTEM_PROMPT: Main system prompt for supervisor CAPABILITY_ANALYSIS_PROMPT: Prompt for analyzing required capabilities ROUTING_DECISION_PROMPT: Prompt for making routing decisions

Functions:

format_supervisor_prompt: Format the main supervisor prompt with agents format_agent_list: Format agent list for inclusion in prompts

FunctionsΒΆ

format_agent_list(agents)

Format agent list for inclusion in prompts.

format_missing_capability(task, capability, reason, ...)

Format a missing capability message.

format_supervisor_prompt(agents)

Format the supervisor system prompt with current agents.

Module ContentsΒΆ

agents.dynamic_supervisor.prompts.format_agent_list(agents)ΒΆ

Format agent list for inclusion in prompts.

Creates a formatted list showing agent names, descriptions, capabilities, and status.

Parameters:

agents (dict[str, haive.agents.dynamic_supervisor.models.AgentInfo]) – Dictionary of agent name to AgentInfo

Returns:

Formatted agent list string

Return type:

str

Example

Agent list format:

- search_agent: Web search specialist
  Capabilities: search, research, web
  Status: Active

- math_agent: Mathematics expert
  Capabilities: math, calculation, statistics
  Status: Inactive
agents.dynamic_supervisor.prompts.format_missing_capability(task, capability, reason, requirements)ΒΆ

Format a missing capability message.

Parameters:
  • task (str) – The task that needs the capability

  • capability (str) – The missing capability

  • reason (str) – Why this capability is needed

  • requirements (list[str]) – What the ideal agent would need to do

Returns:

Formatted message about missing capability

Return type:

str

agents.dynamic_supervisor.prompts.format_supervisor_prompt(agents)ΒΆ

Format the supervisor system prompt with current agents.

Parameters:

agents (dict[str, haive.agents.dynamic_supervisor.models.AgentInfo]) – Dictionary of agent name to AgentInfo

Returns:

Formatted system prompt

Return type:

str

Example

Formatting prompt with agents:

prompt = format_supervisor_prompt(state.agents)
# Use in supervisor engine configuration