Skip to main content

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

FieldTypeDefaultDescription
namestrrequiredMust match the dict key in agents={}
descriptionstr""Shown to the coordinator when it decides who to delegate to
promptstr""Additional system prompt injected for this sub-agent
toolslist[str][]Tool allow-list; empty = inherit coordinator's tool config
providerstr | NoneNoneOverride LLM provider (inherits coordinator's if None)
modelstr | NoneNoneOverride model (inherits coordinator's if None)
memorystr"none"Persistent memory scope: "none", "user", "project", "local"
skillslist[str] | NoneNoneNone = default skill discovery; explicit list restricts available skills
mcp_serversdict{}Sub-agent-specific MCP configs — not inherited from the coordinator
disallow_system_skillslist[str][]Built-in skills to exclude; ["all"] disables all system skills
agent_typestr | NoneNoneOptional 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.