From 73ed6279b5bc426847550a0338381ad8002fb429 Mon Sep 17 00:00:00 2001 From: Kye Gomez Date: Mon, 17 Nov 2025 16:10:53 -0800 Subject: [PATCH 1/2] swarm router majority voting and readme --- README.md | 2 +- swarm_router_mv.py | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 swarm_router_mv.py diff --git a/README.md b/README.md index fa70d1dd..6423140f 100644 --- a/README.md +++ b/README.md @@ -833,7 +833,7 @@ Thank you for contributing to swarms. Your work is extremely appreciated and rec ----- -## Connect With Us +## Join the Swarms community Join our community of agent engineers and researchers for technical support, cutting-edge updates, and exclusive access to world-class agent engineering insights! diff --git a/swarm_router_mv.py b/swarm_router_mv.py new file mode 100644 index 00000000..dd691b78 --- /dev/null +++ b/swarm_router_mv.py @@ -0,0 +1,40 @@ +from swarms import SwarmRouter, Agent + +# Create specialized agents +research_agent = Agent( + agent_name="Research-Analyst", + agent_description="Specialized in comprehensive research and data gathering", + model_name="gpt-4o-mini", + max_loops=1, + verbose=False, +) + +analysis_agent = Agent( + agent_name="Data-Analyst", + agent_description="Expert in data analysis and pattern recognition", + model_name="gpt-4o-mini", + max_loops=1, + verbose=False, +) + +strategy_agent = Agent( + agent_name="Strategy-Consultant", + agent_description="Specialized in strategic planning and recommendations", + model_name="gpt-4o-mini", + max_loops=1, + verbose=False, +) + +router = SwarmRouter( + name="SwarmRouter", + description="Routes tasks to specialized agents based on their capabilities", + agents=[research_agent, analysis_agent, strategy_agent], + swarm_type="MajorityVoting", + max_loops=1, + verbose=False, +) + +result = router.run( + "Conduct a research analysis on water stocks and etfs" +) +print(result) \ No newline at end of file From e721620cc8da1ee71010a1537463a1874e8f94bd Mon Sep 17 00:00:00 2001 From: Kye Gomez Date: Mon, 17 Nov 2025 16:11:08 -0800 Subject: [PATCH 2/2] swarm router majority voting and readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6423140f..89e713ec 100644 --- a/README.md +++ b/README.md @@ -833,7 +833,7 @@ Thank you for contributing to swarms. Your work is extremely appreciated and rec ----- -## Join the Swarms community +## Join the Swarms community 👾👾👾 Join our community of agent engineers and researchers for technical support, cutting-edge updates, and exclusive access to world-class agent engineering insights!