Work with orchestration
Use orchestration when you need to compose dynamic agent teams, wire up execution strategies, and manage workflow and template registries.
Prerequisites
- Access to the project source code under
src/attune/orchestration/ - Familiarity with the
ExecutionStrategybase class and theAgentTemplatedata model
Steps
-
Identify the entry point for your goal. Match your goal to the function that owns that responsibility:
Goal Function Location Retrieve a strategy by name get_strategy()src/attune/orchestration/_strategies/__init__.pyRegister a new strategy class register_strategy()src/attune/orchestration/_strategies/__init__.pyRegister a workflow for nested references register_workflow()src/attune/orchestration/_strategies/nesting.pyRetrieve a registered workflow by ID get_workflow()src/attune/orchestration/_strategies/nesting.pyRetrieve an agent template by ID get_template()src/attune/orchestration/agent_templates/registry.pyList all registered templates get_all_templates()src/attune/orchestration/agent_templates/registry.pyFilter templates by capability get_templates_by_capability()src/attune/orchestration/agent_templates/registry.pyFilter templates by tier get_templates_by_tier()src/attune/orchestration/agent_templates/registry.py -
Read the function's signature and docstring. Confirm the parameter types, return type, and any exceptions the function raises. For example,
get_strategy()raisesValueErrorwith the message'Unknown strategy: {...}. Available: {...}'when the name is not registered, andget_workflow()raises a similarValueErrorfor unknown workflow IDs. -
Make your change in the target function. Apply the naming conventions, error-handling style, and logging patterns already present in that file. If you are registering a new strategy, pass a
namestring and a class that subclassesExecutionStrategy. If you are registering a workflow, pass aWorkflowDefinitioninstance. -
Run the targeted test suite. Execute
pytest -k "orchestration"to catch regressions before they affect other developers.
Key files
src/attune/orchestration/_strategies/__init__.py— strategy registry andget_strategy/register_strategysrc/attune/orchestration/_strategies/nesting.py— workflow registry and nested execution strategiessrc/attune/orchestration/agent_templates/registry.py— agent template registrysrc/attune/coordination/— coordination layer that consumes orchestration strategies
Verify success
After running pytest -k "orchestration", all tests pass with no failures or errors. If you registered a new strategy, call get_strategy("<your_strategy_name>") in a Python REPL and confirm it returns an instance of your class without raising ValueError. If you registered a workflow, call get_workflow("<your_workflow_id>") and confirm it returns your WorkflowDefinition.