Advanced/compatible programmatic examples. Fragments illustrate mechanisms; HostEnv or workspace does not provide isolation. New projects start with Quickstart, Session and explicit resource configuration.
What You’ll Build
A coordinator agent that uses thefanout tool to spawn multiple explorer
agents in parallel, each investigating a different directory. Results are
aggregated and synthesized.
Prerequisites
- QitOS installed (
pip install qitos) - An OpenAI-compatible API key
Step 1: Define Your Sub-Agent
First, create an explorer agent that can investigate directories: Illustrative fragment (not a standalone program; use the complete example linked on this page).Step 2: Register the Agent
UseAgentSpec and AgentRegistry to register your sub-agent:
Illustrative fragment (not a standalone program; use the complete example linked on this page).
Step 3: Create the Coordinator
The coordinator agent has coding tools plus thefanout tool:
Illustrative fragment (not a standalone program; use the complete example linked on this page).
Step 4: Run It
Illustrative fragment (not a standalone program; use the complete example linked on this page).fanout(tasks=[{"agent":"explorer","task":"Explore /auth"}, ...]),
spawning three parallel explorers.
Quick Start with Patterns
For common patterns, use the built-in templates: Illustrative fragment (not a standalone program; use the complete example linked on this page).What’s Next
- Try
ContextStrategy.FULLto pass parent context to sub-agents - Use
DelegateToolfor 1:1 delegation with result return - Use
Decision.handoff()for workflow-style agent chains
