Skip to content

strands.multiagent.spec

Multi-Agent Specification and Resolution.

Provides the authority-mode system for model-driven multi-agent patterns, where the model configures child agents at runtime. The developer sets axis policies that shape the parameters the model sees and govern what values it can supply:

  • Fixed — developer-pinned value; hidden from the model.
  • Inherit — value taken from the parent agent; hidden from the model.
  • Open — model supplies a free-form value.
  • Choice — model picks from a developer-supplied set.

_resolve_spec merges model-supplied arguments, preset defaults, and axis policies into a fully resolved AgentSpec used to build child agents. Inherit axes resolve to None (meaning “inherit all”); the class is a self-documenting marker.

@dataclass(frozen=True)
class Fixed()

Defined in: src/strands/multiagent/spec.py:39

The developer pins the value; the axis contributes no model-facing parameter.

@dataclass(frozen=True)
class Inherit()

Defined in: src/strands/multiagent/spec.py:46

The child takes the parent’s value; the axis contributes no model-facing parameter.

@dataclass(frozen=True)
class Open()

Defined in: src/strands/multiagent/spec.py:51

The model writes the value freely; the axis contributes a string parameter.

@dataclass(frozen=True)
class Option()

Defined in: src/strands/multiagent/spec.py:56

A selectable entry in a Choice.

@dataclass(frozen=True)
class Choice()

Defined in: src/strands/multiagent/spec.py:65

The model picks from a developer-supplied set.

Each entry is a bare name or an Option. Set multiple=True to let the model pick more than one.

def normalized() -> list[Option]

Defined in: src/strands/multiagent/spec.py:75

The options as Options with value resolved, wrapping any bare name.

def to_schema_property(description: str = "") -> dict[str, Any]

Defined in: src/strands/multiagent/spec.py:87

Render this axis as a JSON Schema property for a tool’s inputSchema.

Produces a string enum (or array of enum when multiple), with per-option descriptions folded into the property’s description.

def value_for(name: str) -> Any

Defined in: src/strands/multiagent/spec.py:109

The resolved value behind name, or name itself if unknown.

@dataclass(frozen=True)
class Preset()

Defined in: src/strands/multiagent/spec.py:118

A named role: a partially applied child configuration selected via agent_type.

@dataclass
class AgentSpec()

Defined in: src/strands/multiagent/spec.py:128

The resolved child configuration handed to the builder.