AgentDefinition
Defines a sub-agent for multi-agent orchestration. Sub-agents are registered on the coordinator's AgentixAgentOptions.agents dict.
from agentix import AgentDefinition, AgentixAgentOptions
options = AgentixAgentOptions(
name="coordinator",
agents={
"researcher": AgentDefinition(
name="researcher",
description="Searches the web and gathers factual information.",
tools=["WebSearch", "WebFetch"],
),
}
)
Fields
| Field | Type | Default | Description |
|---|---|---|---|
name | str | required | Must match the dict key in agents={} |
description | str | "" | Shown to the coordinator when it decides who to delegate to |
prompt | str | "" | Additional system prompt injected for this sub-agent |
tools | list[str] | [] | Tool allow-list; empty = inherit coordinator's tool config |
provider | str | None | None | Override LLM provider (inherits coordinator's if None) |
model | str | None | None | Override model (inherits coordinator's if None) |
memory | str | "none" | Persistent memory scope: "none", "user", "project", "local" |
skills | list[str] | None | None | None = default skill discovery; explicit list restricts available skills |
mcp_servers | dict | {} | Sub-agent-specific MCP configs — not inherited from the coordinator |
disallow_system_skills | list[str] | [] | Built-in skills to exclude; ["all"] disables all system skills |
agent_type | str | None | None | Optional label used to differentiate sub-agents in hooks |
Validation
With strict_agent_validation=True, the following raise ConfigurationError:
- Empty
description - Unknown tool names in
tools
options = AgentixAgentOptions(
strict_agent_validation=True,
agents={
"writer": AgentDefinition(
name="writer",
description="", # ← raises ConfigurationError
)
}
)
File-based sub-agents
Sub-agents can also be defined as Markdown files under .agentix/agents/. The body of the file becomes the sub-agent's prompt.
---
name: researcher
description: Searches the web and summarises findings.
tools:
- WebSearch
- WebFetch
memory: project
---
You are a research specialist. Always cite your sources.
The coordinator discovers file-based agents automatically when cwd is set. Programmatic AgentDefinition objects take precedence over file-based definitions with the same name.