This folder contains comprehensive examples demonstrating all the new features introduced in the January 2026 Swarms release. Each example is a standalone script that showcases specific functionality.
| # | Example File | Feature | Category |
|---|---|---|---|
| 01 | 01_dynamic_skills_loader.py | DynamicSkillsLoader Integration | Agent Enhancement |
| 02 | 02_autonomous_agent_loop.py | Autonomous Agent Loop Architecture | Agent Architecture |
| 03 | 03_agent_handoffs.py | Enhanced Function Calling for Agent Handoffs | Multi-Agent |
| 04 | 04_api_key_validation.py | API Key Validation System | Infrastructure |
| 05 | 05_max_loops_parameter.py | Max Loops Parameter Refactoring | Agent Configuration |
| 06 | 06_multi_tool_agent_tutorial.py | Multi-Tool Agent Tutorial with X402 | Tools Integration |
| 07 | 07_hierarchical_voice_agent.py | Hierarchical Voice Agent | Voice Agents |
| 08 | 08_agent_rearrange_patterns.py | Agent Rearrange Patterns | Workflow Orchestration |
Install the required packages:
# Core package
pip install -U swarms
# Optional dependencies for specific examples
pip install swarms-tools # For multi-tool examples (06)
pip install voice-agents # For voice agent examples (07)Set your API keys as environment variables:
# Required for most examples
export OPENAI_API_KEY="your-openai-api-key"
# Required for marketplace examples (04)
export SWARMS_API_KEY="your-swarms-api-key"Each example is a standalone Python script. Run any example directly:
# From the project root
python examples/guides/changelog_890/01_dynamic_skills_loader.py
# Or from this directory
cd examples/guides/changelog_890
python 01_dynamic_skills_loader.pyFeature: DynamicSkillsLoader Integration Description: Automatic skill loading based on task requirements using similarity matching.
Feature: Max Loops Parameter Refactoring Description: Demonstrates the max_loops parameter (renamed from max_iterations) with backwards compatibility.
Feature: Autonomous Agent Loop Architecture Description: Plan-think-act-continue pattern for independent agent operation with max_loops="auto".
Feature: Enhanced Function Calling for Agent Handoffs Description: Improved inter-agent communication with type-safe handoffs and context preservation.
Feature: Agent Rearrange Patterns Description: Dynamic agent reconfiguration with sequential and concurrent execution patterns.
Feature: API Key Validation System Description: Proactive API key validation to prevent runtime authentication errors.
Feature: Multi-Tool Agent Tutorial with X402 Description: Comprehensive guide for building agents with multiple X402 tools for complex workflows.
Feature: Hierarchical Voice Agent Description: Voice-enabled hierarchical swarms with distinct TTS voices for each agent.
To run all examples sequentially:
# From the examples directory
cd examples/guides/changelog_890
# Run all examples
for file in *.py; do
echo "Running $file..."
python "$file"
echo "---"
doneEach example will execute immediately and produce output demonstrating the featured functionality.
-
Import Errors
- Ensure
swarmsis installed:pip install -U swarms - Check that optional dependencies are installed for specific examples
- Ensure
-
API Key Errors
- Verify environment variables are set correctly
- Check that API keys are valid and have sufficient credits
-
Voice Agent Issues
- Ensure
voice-agentspackage is installed - Verify OpenAI API key has TTS access
- Ensure
-
Tool Integration Errors
- Install
swarms-tools:pip install swarms-tools - Check that external service APIs are accessible
- Install
Note: All examples are designed to be simple and educational. They demonstrate core functionality without complex error handling or production-ready patterns. Adapt them to your specific use cases as needed.