Skip to content

chimera.agents

chimera.agents is the declarative agent layer: define an agent as a dataclass (or a markdown file with YAML frontmatter), then call build() to wire it up.

For a narrative walk-through, see modules/agents-config. This page is the canonical export list.

from chimera.agents import (
AgentConfig,
AgentLoader,
AgentRegistry,
FileAgentDef,
AgentFactory,
)
from chimera.assembly.coding_agent import CodingAgent # canonical preset entry point
SymbolPurpose
AgentConfigDataclass describing tools, loop, permissions, model, prompt. AgentConfig.from_markdown(path) parses YAML frontmatter; .build(provider) returns a wired Agent.
AgentLoaderDiscovers agents on disk with priority order project > user > built-in.
AgentRegistryName → factory registry. .register(name, factory), .get(name), .list(), .load_directory(path).
FileAgentDefParsed markdown agent definition (frontmatter + system prompt body).
AgentFactoryCallable that constructs an agent from a config + provider/env.

Five preset agent definitions ship under chimera/agents/presets/:

Preset markdownDescription
build.pyBuild/implement loop with full tool set.
plan.pyPlan-only loop, read-only tools.
explore.pyRead-only exploration agent.
general.pyGeneral-purpose default.
review.pyMulti-perspective code reviewer.

Plus a directory of subagent markdown definitions under chimera/agents/presets/subagents/.

The legacy AgentPreset class (chimera.agents.presets.AgentPreset) still exists for backwards-compatible tests, but new code should use CodingAgent.from_preset(name) from chimera.assembly.coding_agent:

from chimera.assembly.coding_agent import CodingAgent
agent = CodingAgent.from_preset("coding_agent") # canonical full preset
agent = CodingAgent.from_preset("codex") # Codex-style
agent = CodingAgent.from_preset("kimi") # Kimi-style action-first
agent = CodingAgent.from_preset("swebench") # SWE-bench tuned
agent = CodingAgent.from_preset("minimal") # minimal tools
agent = CodingAgent.from_preset("explore") # read-only

The deprecated claude_code alias maps to coding_agent and emits a DeprecationWarning.

FieldTypeDefaultDescription
namestr(required)Unique agent id.
descriptionstr(required)Human-readable summary.
system_promptstr(required)System prompt text.
toolslist[str][]Tool names resolved from the internal tool registry.
permissionsstr"auto_approve"Permission preset name.
loopstr"react"Loop type name.
max_stepsint50Max ReAct iterations.
modelstr | NoneNoneModel override (otherwise inherited from provider/env).