Skip to content

Agents & Config

chimera.agents provides a declarative system for defining and building agents. An AgentConfig dataclass describes what an agent needs — tools, loop, permissions, model — and the build() method resolves everything by name through internal registries.

Heads-up. For full coding-agent assemblies (permissions, hooks, transcripts, compaction, streaming wired together) prefer chimera.assembly.coding_agent.CodingAgent.from_preset(...). This page covers the lower-level AgentConfig building block — useful when you want to spell out the exact tool / loop / permission set yourself or load it from Markdown frontmatter. See Agent Presets for the high-level path.

FieldTypeDefaultDescription
namestr(required)Unique agent identifier
descriptionstr(required)Human-readable summary
system_promptstr(required)System prompt text
toolslist[str][]Tool names resolved from _TOOL_REGISTRY
permissionsstr"auto_approve"Permission preset name
loopstr"react"Loop type name
max_stepsint50Max loop iterations
modelstr | NoneNoneModel override

Parses a .md file with YAML frontmatter. The body after the second --- delimiter becomes the system_prompt.

---
name: my-agent
description: A custom agent
tools: [read_file, bash, search]
permissions: interactive
loop: react
max_steps: 30
---
You are a custom agent that helps with file management.
Always confirm before deleting files.

Constructs a fully wired Agent by resolving all names through the registries:

from chimera.agents import AgentConfig
from chimera.providers import create_provider
config = AgentConfig.from_markdown("agents/my-agent.md")
agent = config.build(create_provider())
result = agent.run("Refactor the utils module.")

Three internal dictionaries map string names to import paths.

NameImport path
read_filechimera.tools:read_file
write_filechimera.tools:write_file
edit_filechimera.tools:edit_file
bashchimera.tools:bash
searchchimera.tools:search
list_fileschimera.tools:list_files
testchimera.tools:test
web_fetchchimera.tools:web_fetch
gitchimera.tools:git
replace_in_filechimera.tools:replace_in_file
verifychimera.tools:verify
repo_mapchimera.tools.repo_map:RepoMapTool

For the full agent tool set (23 tools including apply_patch, write_guard, notebook_edit, enter_worktree / exit_worktree, cron_create / cron_list / cron_delete) use chimera.AGENT_TOOLS directly instead of resolving by name. See AGENT_TOOLS.

NameImport path
reactchimera.core.loop:ReAct
plan_executechimera.core.loops.plan_execute:PlanAndExecute
reflexionchimera.core.loops.reflexion:Reflexion

The other loop variants (AgentLoop, RetryLoop, LintFeedbackLoop, PlanActLoop, TreeOfThought, AutonomousLoop) are not currently spellable from frontmatter; instantiate them directly. See Loops.

Permission Registry (_PERMISSION_REGISTRY)

Section titled “Permission Registry (_PERMISSION_REGISTRY)”
NameImport path
auto_approvechimera.permissions.presets:AutoApprove
always_denychimera.permissions.presets:AlwaysDeny
read_onlychimera.permissions.presets:ReadOnly
interactivechimera.permissions.presets:Interactive

For the standard 5-mode --permission-mode surface (read-only / suggest / auto / yolo / strict) use chimera.permissions.modes.policy_for_mode(...) instead. See Permissions.

An in-memory registry for looking up AgentConfig instances by name.

MethodDescription
register(config)Add or overwrite a config keyed by config.name
get(name)Return the config or None
list()Return all registered names in insertion order
load_directory(path)Bulk-load every .md file in a directory
from chimera.agents import AgentRegistry
registry = AgentRegistry()
registry.load_directory("./agents/")
config = registry.get("my-agent")
agent = config.build(provider)

Default Registry (create_default_registry)

Section titled “Default Registry (create_default_registry)”

chimera.agents.loader.create_default_registry() returns a registry pre-loaded with 9 agents:

  • 5 long-lived presets: build, explore, general, plan, review
  • 4 packaged subagent profiles (W13-G8): planner, researcher, executor, reviewer

This is the registry consumed by every CLI’s /agent slash command and the --agent <name> flag. See Agent Spawner for the subagent contract.

Five factory functions create pre-configured agents. Each wraps an AgentConfig and accepts **overrides to customise fields.

FactoryToolsPermissionsLoop
BuildAgentread, write, edit, bash, search, list, testinteractivereact (100 steps)
PlanAgentread, search, list, repo_mapread_onlyplan_execute
ExploreAgentread, search, list, repo_mapread_onlyreact
GeneralAgentread, write, edit, bash, search, list, test, gitauto_approvereact
ReviewAgentread, search, list, git, repo_mapread_onlyreact
from chimera.agents import BuildAgent, ExploreAgent
from chimera.providers import create_provider
provider = create_provider()
# Default build agent
agent = BuildAgent(provider)
# Explore agent with custom step limit
agent = ExploreAgent(provider, max_steps=20)