This example combines three Swarms features into one voice-driven agent:
max_loops="auto" — the autonomous plan → execute → summary loop.
selected_tools="all" — the agent picks up every available tool, including the built-in bash terminal.
StreamingTTSCallback — every token from every loop phase is narrated in real time.
The result is an agent that talks through its plan, the commands it runs, and its final summary — useful for accessibility, demos, and ambient operations dashboards.
Step 1: Install dependencies
Step 2: Build the autonomous agent
max_loops="auto" runs the agent through three phases — plan, execute, summary — looping until it decides the task is done. selected_tools="all" exposes every tool the autonomous looper has access to (bash, file ops, etc.).
Step 3: Wire up the streaming TTS callback
Step 4: Run the agent
The TTS callback receives tokens from every phase of the autonomous loop — the planning step, each tool-call/synthesis turn, and the final summary.
Full example
An autonomous agent with selected_tools="all" can execute bash commands. Run it inside a sandbox or scoped working directory if the task is untrusted.
See also