|
|
1 day ago | |
|---|---|---|
| .. | ||
| aop_examples | 1 day ago | |
| deployment | 1 day ago | |
| guides | 1 day ago | |
| mcp | 1 day ago | |
| models | 3 months ago | |
| multi_agent | 1 day ago | |
| rag | 1 month ago | |
| reasoning_agents | 4 weeks ago | |
| single_agent | 1 day ago | |
| swarms_api_examples | 1 month ago | |
| tools | 1 day ago | |
| ui | 2 months ago | |
| utils | 1 day ago | |
| README.md | 1 day ago | |
README.md
Swarms Examples
This directory contains comprehensive examples demonstrating various capabilities and use cases of the Swarms framework. Each subdirectory focuses on specific aspects of multi-agent systems, single agents, tools, and integrations.
Directory Overview
Multi-Agent Systems
- multi_agent/ - Advanced multi-agent patterns including agent rearrangement, auto swarm builder (ASB), batched workflows, board of directors, caching, concurrent processing, councils, debates, elections, forest swarms, graph workflows, group chats, heavy swarms, hierarchical swarms, majority voting, orchestration examples, social algorithms, simulations, spreadsheet examples, and swarm routing.
- README.md - Complete multi-agent examples documentation
Single Agent Systems
- single_agent/ - Single agent implementations including demos, external agent integrations, LLM integrations (Azure, Claude, DeepSeek, Mistral, OpenAI, Qwen), onboarding, RAG, reasoning agents, tools integration, utils, and vision capabilities.
- README.md - Complete single agent examples documentation
- simple_agent.py - Basic single agent example
Tools & Integrations
- tools/ - Tool integration examples including agent-as-tools, base tool implementations, browser automation, Claude integration, Exa search, Firecrawl, multi-tool usage, and Stagehand integration.
- README.md - Complete tools examples documentation
- agent_as_tools.py - Using agents as tools
Model Integrations
- models/ - Various model integrations including Cerebras, GPT-5, GPT-OSS, Llama 4, Lumo, and Ollama implementations with concurrent processing examples and provider-specific configurations.
- README.md - Model integration documentation
- simple_example_ollama.py - Ollama integration example
- cerebas_example.py - Cerebras model example
- lumo_example.py - Lumo model example
API & Protocols
-
swarms_api_examples/ - Swarms API usage examples including agent overview, batch processing, client integration, team examples, analysis, and rate limiting.
- README.md - API examples documentation
- client_example.py - API client example
- batch_example.py - Batch processing example
-
mcp/ - Model Context Protocol (MCP) integration examples including agent implementations, multi-connection setups, server configurations, and utility functions.
- README.md - MCP examples documentation
- multi_mcp_example.py - Multi-MCP connection example
-
aop_examples/ - Agents over Protocol (AOP) examples demonstrating MCP server setup, agent discovery, client interactions, queue-based task submission, and medical AOP implementations.
Advanced Capabilities
-
reasoning_agents/ - Advanced reasoning capabilities including agent judge evaluation systems, O3 model integration, and mixture of agents (MOA) sequential examples.
- README.md - Reasoning agents documentation
- example_o3.py - O3 model example
- moa_seq_example.py - MOA sequential example
-
rag/ - Retrieval Augmented Generation (RAG) implementations with vector database integrations including Qdrant examples.
- README.md - RAG documentation
- qdrant_rag_example.py - Qdrant RAG example
Guides & Tutorials
- guides/ - Comprehensive guides and tutorials including generation length blog, geo guesser agent, graph workflow guide, hierarchical marketing team, nano banana Jarvis agent, smart database, web scraper agents, and workshop examples (840_update, 850_workshop).
- README.md - Guides documentation
- hiearchical_marketing_team.py - Hierarchical marketing team example
Deployment
- deployment/ - Deployment strategies and patterns including cron job implementations and FastAPI deployment examples.
- README.md - Deployment documentation
- fastapi/ - FastAPI deployment examples
- cron_job_examples/ - Cron job examples
Utilities
- utils/ - Utility functions and helper implementations including agent loader, communication examples, concurrent wrappers, miscellaneous utilities, and telemetry.
- README.md - Utils documentation
User Interface
- ui/ - User interface examples and implementations including chat interfaces.
Quick Start
- New to Swarms? Start with single_agent/simple_agent.py for basic concepts
- Want multi-agent workflows? Check out multi_agent/duo_agent.py
- Need tool integration? Explore tools/agent_as_tools.py
- Interested in AOP? Try aop_examples/client/example_new_agent_tools.py for agent discovery
- Want to see social algorithms? Check out multi_agent/social_algorithms_examples/
- Looking for guides? Visit guides/ for comprehensive tutorials
- Need RAG? Try rag/qdrant_rag_example.py
- Want reasoning agents? Check out reasoning_agents/example_o3.py
Key Examples by Category
Multi-Agent Patterns
- Duo Agent - Two-agent collaboration
- Hierarchical Swarm - Hierarchical agent structures
- Group Chat - Multi-agent conversations
- Graph Workflow - Graph-based workflows
- Social Algorithms - Various social algorithm patterns
Single Agent Examples
- Simple Agent - Basic agent setup
- Reasoning Agents - Advanced reasoning patterns
- Vision Agents - Vision and multimodal capabilities
- RAG Agents - Retrieval augmented generation
Tool Integrations
- Agent as Tools - Using agents as tools
- Browser Automation - Browser control
- Exa Search - Search integration
- Stagehand - UI automation
Model Integrations
- OpenAI - OpenAI models
- Claude - Claude models
- DeepSeek - DeepSeek models
- Azure - Azure OpenAI
- Ollama - Local Ollama models
Documentation
Each subdirectory contains its own README.md file with detailed descriptions and links to all available examples. Click on any folder above to explore its specific examples and use cases.
Related Resources
Contributing
Found an interesting example or want to add your own? Check out our contributing guidelines and feel free to submit pull requests with new examples or improvements to existing ones.
This examples directory is continuously updated with new patterns, integrations, and use cases. Check back regularly for the latest examples!