pull/594/merge
Your Name 3 months ago
parent fbdc499993
commit b238ecf74c

@ -604,11 +604,27 @@ You can now easily plug this custom Griptape agent into the **Swarms Framework**
# Multi-Agent Orchestration: ## Understanding Swarms
Swarms was designed to facilitate the communication between many different and specialized agents from a vast array of other frameworks such as langchain, autogen, crew, and more.
In traditional swarm theory, there are many types of swarms usually for very specialized use-cases and problem sets. Such as Hiearchical and sequential are great for accounting and sales, because there is usually a boss coordinator agent that distributes a workload to other specialized agents. ### What is a Swarm?
A swarm, in the context of multi-agent systems, refers to a group of more than two agents working collaboratively to achieve a common goal. These agents can be software entities, such as llms that interact with each other to perform complex tasks. The concept of a swarm is inspired by natural systems like ant colonies or bird flocks, where simple individual behaviors lead to complex group dynamics and problem-solving capabilities.
### How Swarm Architectures Facilitate Communication
Swarm architectures are designed to establish and manage communication between agents within a swarm. These architectures define how agents interact, share information, and coordinate their actions to achieve the desired outcomes. Here are some key aspects of swarm architectures:
1. **Hierarchical Communication**: In hierarchical swarms, communication flows from higher-level agents to lower-level agents. Higher-level agents act as coordinators, distributing tasks and aggregating results. This structure is efficient for tasks that require top-down control and decision-making.
2. **Parallel Communication**: In parallel swarms, agents operate independently and communicate with each other as needed. This architecture is suitable for tasks that can be processed concurrently without dependencies, allowing for faster execution and scalability.
3. **Sequential Communication**: Sequential swarms process tasks in a linear order, where each agent's output becomes the input for the next agent. This ensures that tasks with dependencies are handled in the correct sequence, maintaining the integrity of the workflow.
4. **Mesh Communication**: In mesh swarms, agents are fully connected, allowing any agent to communicate with any other agent. This setup provides high flexibility and redundancy, making it ideal for complex systems requiring dynamic interactions.
5. **Federated Communication**: Federated swarms involve multiple independent swarms that collaborate by sharing information and results. Each swarm operates autonomously but can contribute to a larger task, enabling distributed problem-solving across different nodes.
Swarm architectures leverage these communication patterns to ensure that agents work together efficiently, adapting to the specific requirements of the task at hand. By defining clear communication protocols and interaction models, swarm architectures enable the seamless orchestration of multiple agents, leading to enhanced performance and problem-solving capabilities.
| **Name** | **Description** | **Code Link** | **Use Cases** | | **Name** | **Description** | **Code Link** | **Use Cases** |

@ -10,6 +10,7 @@ from swarms.agents.create_agents_from_yaml import (
) )
from swarms.agents.cli_prompt_generator_func import generate_prompt from swarms.agents.cli_prompt_generator_func import generate_prompt
import subprocess import subprocess
console = Console() console = Console()
@ -101,29 +102,43 @@ def check_login():
with open(cache_file, "w") as f: with open(cache_file, "w") as f:
f.write("logged_in") f.write("logged_in")
console.print("[bold green]Login successful![/bold green]") console.print("[bold green]Login successful![/bold green]")
def check_and_upgrade_version(): def check_and_upgrade_version():
console.print("[bold yellow]Checking for Swarms updates...[/bold yellow]") console.print(
"[bold yellow]Checking for Swarms updates...[/bold yellow]"
)
try: try:
# Check for updates using pip # Check for updates using pip
result = subprocess.run( result = subprocess.run(
["pip", "list", "--outdated", "--format=freeze"], ["pip", "list", "--outdated", "--format=freeze"],
capture_output=True, capture_output=True,
text=True text=True,
) )
outdated_packages = result.stdout.splitlines() outdated_packages = result.stdout.splitlines()
# Check if Swarms is outdated # Check if Swarms is outdated
for package in outdated_packages: for package in outdated_packages:
if package.startswith("swarms=="): if package.startswith("swarms=="):
console.print("[bold magenta]New version available! Upgrading...[/bold magenta]") console.print(
subprocess.run(["pip", "install", "--upgrade", "swarms"], check=True) "[bold magenta]New version available! Upgrading...[/bold magenta]"
console.print("[bold green]Swarms upgraded successfully![/bold green]") )
subprocess.run(
["pip", "install", "--upgrade", "swarms"],
check=True,
)
console.print(
"[bold green]Swarms upgraded successfully![/bold green]"
)
return return
console.print("[bold green]Swarms is up-to-date.[/bold green]") console.print(
"[bold green]Swarms is up-to-date.[/bold green]"
)
except Exception as e: except Exception as e:
console.print(f"[bold red]Error checking for updates: {e}[/bold red]") console.print(
f"[bold red]Error checking for updates: {e}[/bold red]"
)
# Main CLI handler # Main CLI handler
@ -190,7 +205,9 @@ def main():
yaml_file=args.yaml_file, return_type="tasks" yaml_file=args.yaml_file, return_type="tasks"
) )
elif args.command == "generate-prompt": elif args.command == "generate-prompt":
if args.prompt: # Corrected from args.prompt_task to args.prompt if (
args.prompt
): # Corrected from args.prompt_task to args.prompt
generate_prompt( generate_prompt(
num_loops=args.num_loops, num_loops=args.num_loops,
autosave=args.autosave, autosave=args.autosave,

Loading…
Cancel
Save