Swarms on SwarmZero.ai allow you to group multiple AI Agents into a coordinated workflow to handle more complex tasks. Each agent within a Swarm has a specific function but works collaboratively to achieve a larger goal. This approach allows users to combine various specialized agents to process information, interact with external services, and automate tasks seamlessly and efficiently.
SwarmZero makes it simple to create Swarms using a no-code or low-code interface. Users can visually organize their agents, specify their interactions, and set up workflows that respond to real-time data. By utilizing AI, Machine Learning, and Large Language Models (LLMs), Swarms can operate autonomously or with user inputs, depending on the task complexity.
Installation
To get started, install the necessary framework via pip:
You can create a swarm of agents to collaborate on complex tasks. Here's an example of how to set up and use a swarm:
from hive_agent.swarm import HiveSwarmfrom hive_agent.agent import HiveAgentfrom hive_agent.sdk_context import SDKContextfrom hive_agent.llms.utils import llm_from_configfrom hive_agent.utils import tools_from_funcsfrom hive_agent.llms.claude import ClaudeLLMimport asyncio# Create SDK Contextsdk_context =SDKContext(config_path="./hive_config_example.toml")defsave_report():return"save_item_to_csv"defsearch_on_web():return"search_on_web"#You can use the default config using default_config or the config of a specific agent by using the get_config method.llm =llm_from_config(sdk_context.get_config("target_agent_id"))tools =tools_from_funcs([search_on_web])claude =ClaudeLLM(llm=llm, tools=tools)# Create individual agentsagent1 = HiveAgent(name="Research Agent", instruction="Conduct research on given topics", sdk_context=sdk_context, functions=[search_on_web], llm=claude)
agent2 = HiveAgent(name="Analysis Agent", instruction="Analyze data and provide insights", sdk_context=sdk_context, functions=[save_report])
agent3 = HiveAgent(name="Report Agent", instruction="Compile findings into a report", sdk_context=sdk_context, functions=[])
# Create swarmswarm =HiveSwarm(name="Research Team", description="A swarm of agents that collaborate on research tasks", instruction="Be helpful and collaborative", functions=[], agents=[agent1, agent2, agent3], sdk_context=sdk_context)
asyncdefchat_with_swarm():returnawait swarm.chat("Can you analyze the following data: [1, 2, 3, 4, 5]")if__name__=="__main__": asyncio.run(chat_with_swarm())
Interested in Building Interesting Swarms with SwarmZero.ai?