register() call at import time — no subclassing, no forks, no monkey-patching.
All four live in
orxhestra.composer:
Custom agent types
Register an async build function under a YAMLtype: key.
myapp/agents.py
orx.yaml
Custom model providers
Register any class that implements LangChain’sBaseChatModel. Reference it by name via model.provider.
myapp/models.py
orx.yaml
The composer ships with 20+ lazily-loaded providers (
openai, anthropic, google, groq, ollama, etc.) — you probably only need register_provider for genuinely new integrations. Any unrecognised provider string is also treated as a dotted import path, so provider: myapp.models.OllamaChat works without registration.Custom built-in tools
A “built-in” is a zero-arg factory returning one or more LangChain tools. Great for project-scoped helpers that every agent in the compose spec wants.myapp/tools.py
orx.yaml
redact imports something expensive, agents that don’t reference it don’t pay the cost.
Custom tool types
If the five built-inToolDef shapes (function, mcp, builtin, agent, transfer) don’t fit, register a whole new type of tool. The YAML escape hatch is ToolDef.custom — an arbitrary dict with a type key that the composer dispatches to your resolver.
Resolvers can be sync or async; the composer awaits whichever shape you return.
myapp/webhook_tool.py
orx.yaml
BaseTool or a list of them — useful when one YAML entry expands into a whole tool surface (e.g. a REST client that exposes each endpoint as a separate tool).
Where to register
Registration is a module-level side effect — the composer looks at the registry state at build time, so any code path that callsComposer.from_yaml(...) must have already imported the module that calls register_*.
Two common patterns:
- Import before build
- Entry-point convention
- Per-spec registration
Inspection APIs
Each registry exposes a read-only listing so you can verify what’s plugged in:type: or custom.type:, the message enumerates every registered name so you see exactly what’s legal.
See also
- Composer overview — narrative walkthrough with YAML examples.
- YAML schema reference — flat field-by-field reference.
orxhestra/composer/__init__.py— canonical source for the fourregister_*functions.