Quick Start
compose.yaml
Architecture
The Composer is built around three modular registries underbuilders/:
YAML Schema
defaults
Global settings inherited by all agents.
models
Named model configurations. Agents reference them by name instead of repeating inline config.
provider, name, and temperature is forwarded directly to the LangChain model constructor (e.g. max_tokens, api_key, base_url, timeout, etc.).
Agents reference models by name:
model: for one-off overrides:
tools
Named tool definitions referenced by agents.
skills
Named skill definitions, referenced by agents. Each agent that lists skills gets its own in-memory skill store with list_skills and load_skill tools.
Skills can be defined inline or loaded from a FastMCP server.
agents
Flat dict of agent definitions. Agents reference each other by name.
Agent Types
| Type | Description | Required fields |
|---|---|---|
llm | LLM-powered agent with tool loop | instructions |
react | Structured Reason+Act agent | instructions (optional) |
sequential | Run sub-agents in order | agents |
parallel | Run sub-agents concurrently | agents |
loop | Repeat sub-agents until done | agents, max_iterations |
a2a | Remote agent via A2A protocol | url |
main_agent
The entry-point agent name.
runner
Optional. Enables Composer.runner_from_yaml().
server
Optional. Enables Composer.server_from_yaml() for A2A.
Examples
Transfer Routing
Sequential Pipeline
Loop with Exit
Extending with Registries
Custom Agent Types
(name, agent_def, spec, *, helpers) where helpers provides:
helpers.resolve_model(agent_def)- merge agent/default model confighelpers.resolve_tools(agent_def)- resolve all tool referenceshelpers.build_agent(name)- recursively build a sub-agent by name
Custom Model Providers
openai, anthropic, google. Any unrecognized provider string is treated as a dotted import path to a custom BaseChatModel class.
Custom Builtin Tools
Python API
| Method | Returns | Description |
|---|---|---|
Composer.from_yaml(path) | BaseAgent | Build root agent (sync) |
Composer.from_yaml_async(path) | BaseAgent | Build root agent (async) |
Composer.runner_from_yaml(path) | Runner | Build Runner with sessions |
Composer.runner_from_yaml_async(path) | Runner | Build Runner with sessions (async) |
Composer.server_from_yaml(path) | FastAPI | Build A2A server app |
Composer.server_from_yaml_async(path) | FastAPI | Build A2A server app (async) |
| Registry function | Description |
|---|---|
register_builder(type, fn) | Add a custom agent type builder |
register_provider(name, cls) | Add a custom model provider |
register_builtin_tool(name, factory) | Add a custom builtin tool |