From 7012784c914361e9d46a0114a6eba556261ad00e Mon Sep 17 00:00:00 2001 From: Hugh <155223694+hughiwnl@users.noreply.github.com> Date: Tue, 2 Dec 2025 11:47:50 -0800 Subject: [PATCH 1/4] removed mentions of linear --- docs/llm.txt | 50 ------------------- docs/swarms/examples/unique_swarms.md | 50 ------------------- .../utils/unique_swarms_examples.py | 24 --------- swarms/structs/swarming_architectures.py | 44 ---------------- 4 files changed, 168 deletions(-) diff --git a/docs/llm.txt b/docs/llm.txt index 51f90399..c6a7e85e 100644 --- a/docs/llm.txt +++ b/docs/llm.txt @@ -24130,32 +24130,6 @@ flowchart LR - Maintains strict ordering of task processing -### Linear Swarm -```python -def linear_swarm(agents: AgentListType, tasks: List[str], return_full_history: bool = True) -``` - -**Information Flow:** -```mermaid -flowchart LR - Input[Task Input] --> A1 - subgraph Sequential Processing - A1((Agent 1)) --> A2((Agent 2)) - A2 --> A3((Agent 3)) - A3 --> A4((Agent 4)) - A4 --> A5((Agent 5)) - end - A5 --> Output[Final Result] -``` - -**Best Used When:** - -- Tasks need sequential, pipeline-style processing - -- Each agent performs a specific transformation step - -- Order of processing is critical - ### Star Swarm ```python def star_swarm(agents: AgentListType, tasks: List[str], return_full_history: bool = True) @@ -24389,7 +24363,6 @@ flowchart TD ## Common Use Cases 1. **Data Processing Pipelines** - - Linear Swarm - Circular Swarm 2. **Distributed Computing** @@ -24528,29 +24501,6 @@ def run_healthcare_grid_swarm(): print("\nGrid swarm processing completed") print(result) -def run_finance_linear_swarm(): - """Loan approval process using linear swarm""" - print_separator() - print("FINANCE - LOAN APPROVAL PROCESS (Linear Swarm)") - - agents = create_finance_agents()[:3] - tasks = [ - "Review loan application and credit history", - "Assess risk factors and compliance requirements", - "Generate final loan recommendation" - ] - - print("\nTasks:") - for i, task in enumerate(tasks, 1): - print(f"{i}. {task}") - - result = linear_swarm(agents, tasks) - print("\nResults:") - for log in result['history']: - print(f"\n{log['agent_name']}:") - print(f"Task: {log['task']}") - print(f"Response: {log['response']}") - def run_healthcare_star_swarm(): """Complex medical case management using star swarm""" print_separator() diff --git a/docs/swarms/examples/unique_swarms.md b/docs/swarms/examples/unique_swarms.md index 00f55e95..245653af 100644 --- a/docs/swarms/examples/unique_swarms.md +++ b/docs/swarms/examples/unique_swarms.md @@ -61,32 +61,6 @@ flowchart LR - Maintains strict ordering of task processing -### Linear Swarm -```python -def linear_swarm(agents: AgentListType, tasks: List[str], return_full_history: bool = True) -``` - -**Information Flow:** -```mermaid -flowchart LR - Input[Task Input] --> A1 - subgraph Sequential Processing - A1((Agent 1)) --> A2((Agent 2)) - A2 --> A3((Agent 3)) - A3 --> A4((Agent 4)) - A4 --> A5((Agent 5)) - end - A5 --> Output[Final Result] -``` - -**Best Used When:** - -- Tasks need sequential, pipeline-style processing - -- Each agent performs a specific transformation step - -- Order of processing is critical - ### Star Swarm ```python def star_swarm(agents: AgentListType, tasks: List[str], return_full_history: bool = True) @@ -320,7 +294,6 @@ flowchart TD ## Common Use Cases 1. **Data Processing Pipelines** - - Linear Swarm - Circular Swarm 2. **Distributed Computing** @@ -459,29 +432,6 @@ def run_healthcare_grid_swarm(): print("\nGrid swarm processing completed") print(result) -def run_finance_linear_swarm(): - """Loan approval process using linear swarm""" - print_separator() - print("FINANCE - LOAN APPROVAL PROCESS (Linear Swarm)") - - agents = create_finance_agents()[:3] - tasks = [ - "Review loan application and credit history", - "Assess risk factors and compliance requirements", - "Generate final loan recommendation" - ] - - print("\nTasks:") - for i, task in enumerate(tasks, 1): - print(f"{i}. {task}") - - result = linear_swarm(agents, tasks) - print("\nResults:") - for log in result['history']: - print(f"\n{log['agent_name']}:") - print(f"Task: {log['task']}") - print(f"Response: {log['response']}") - def run_healthcare_star_swarm(): """Complex medical case management using star swarm""" print_separator() diff --git a/examples/multi_agent/utils/unique_swarms_examples.py b/examples/multi_agent/utils/unique_swarms_examples.py index 7f577e0b..6c315e25 100644 --- a/examples/multi_agent/utils/unique_swarms_examples.py +++ b/examples/multi_agent/utils/unique_swarms_examples.py @@ -121,30 +121,6 @@ def run_healthcare_grid_swarm(): print(result) -def run_finance_linear_swarm(): - """Loan approval process using linear swarm""" - print_separator() - print("FINANCE - LOAN APPROVAL PROCESS (Linear Swarm)") - - agents = create_finance_agents()[:3] - tasks = [ - "Review loan application and credit history", - "Assess risk factors and compliance requirements", - "Generate final loan recommendation", - ] - - print("\nTasks:") - for i, task in enumerate(tasks, 1): - print(f"{i}. {task}") - - result = linear_swarm(agents, tasks) - print("\nResults:") - for log in result["history"]: - print(f"\n{log['agent_name']}:") - print(f"Task: {log['task']}") - print(f"Response: {log['response']}") - - def run_healthcare_star_swarm(): """Complex medical case management using star swarm""" print_separator() diff --git a/swarms/structs/swarming_architectures.py b/swarms/structs/swarming_architectures.py index c286b653..033a083f 100644 --- a/swarms/structs/swarming_architectures.py +++ b/swarms/structs/swarming_architectures.py @@ -106,50 +106,6 @@ def grid_swarm( return history_output_formatter(conversation, output_type) - -# Linear Swarm: Agents process tasks in a sequential linear manner -def linear_swarm( - agents: AgentListType, - tasks: List[str], - output_type: OutputType = "dict", -) -> Union[Dict[str, Any], List[str]]: - """ - Implements a linear swarm where agents process tasks in a sequential manner. - - Args: - agents (AgentListType): A list of Agent objects to participate in the swarm. - tasks (List[str]): A list of tasks to be processed by the agents. - output_type (OutputType, optional): The format of the output. Defaults to "dict". - - Returns: - Union[Dict[str, Any], List[str]]: The formatted output of the swarm's processing. - If output_type is "dict", returns a dictionary containing the conversation history. - If output_type is "list", returns a list of responses. - - Raises: - ValueError: If agents or tasks lists are empty. - """ - if not agents or not tasks: - raise ValueError("Agents and tasks lists cannot be empty.") - - conversation = Conversation() - - for agent in agents: - if tasks: - task = tasks.pop(0) - conversation.add( - role="User", - content=task, - ) - response = agent.run(conversation.get_str()) - conversation.add( - role=agent.agent_name, - content=response, - ) - - return history_output_formatter(conversation, output_type) - - # Star Swarm: A central agent first processes all tasks, followed by others def star_swarm( agents: AgentListType, From 15a8349fbb5587185b8e46fe391445c5070163d6 Mon Sep 17 00:00:00 2001 From: Hugh <155223694+hughiwnl@users.noreply.github.com> Date: Tue, 2 Dec 2025 11:50:33 -0800 Subject: [PATCH 2/4] removed mentions of linear swarm --- docs/llm.txt | 2 - docs/swarms/examples/unique_swarms.md | 2 - .../utils/unique_swarms_examples.py | 2 - swarms/structs/__init__.py | 2 - swarms/structs/various_alt_swarms.py | 54 ------------------- tests/structs/test_swarm_architectures.py | 16 ------ 6 files changed, 78 deletions(-) diff --git a/docs/llm.txt b/docs/llm.txt index c6a7e85e..d6674264 100644 --- a/docs/llm.txt +++ b/docs/llm.txt @@ -24393,7 +24393,6 @@ from swarms.structs.swarming_architectures import ( exponential_swarm, fibonacci_swarm, grid_swarm, - linear_swarm, mesh_swarm, one_to_three, prime_swarm, @@ -24634,7 +24633,6 @@ async def run_all_examples(): # Finance examples run_finance_circular_swarm() - run_finance_linear_swarm() run_finance_mesh_swarm() run_mathematical_finance_swarms() diff --git a/docs/swarms/examples/unique_swarms.md b/docs/swarms/examples/unique_swarms.md index 245653af..af3b30e1 100644 --- a/docs/swarms/examples/unique_swarms.md +++ b/docs/swarms/examples/unique_swarms.md @@ -324,7 +324,6 @@ from swarms.structs.swarming_architectures import ( exponential_swarm, fibonacci_swarm, grid_swarm, - linear_swarm, mesh_swarm, one_to_three, prime_swarm, @@ -565,7 +564,6 @@ async def run_all_examples(): # Finance examples run_finance_circular_swarm() - run_finance_linear_swarm() run_finance_mesh_swarm() run_mathematical_finance_swarms() diff --git a/examples/multi_agent/utils/unique_swarms_examples.py b/examples/multi_agent/utils/unique_swarms_examples.py index 6c315e25..09788cbf 100644 --- a/examples/multi_agent/utils/unique_swarms_examples.py +++ b/examples/multi_agent/utils/unique_swarms_examples.py @@ -8,7 +8,6 @@ from swarms.structs.swarming_architectures import ( exponential_swarm, fibonacci_swarm, grid_swarm, - linear_swarm, mesh_swarm, one_to_three, prime_swarm, @@ -263,7 +262,6 @@ async def run_all_examples(): # Finance examples run_finance_circular_swarm() - run_finance_linear_swarm() run_finance_mesh_swarm() run_mathematical_finance_swarms() diff --git a/swarms/structs/__init__.py b/swarms/structs/__init__.py index ec292632..18f46c5c 100644 --- a/swarms/structs/__init__.py +++ b/swarms/structs/__init__.py @@ -90,7 +90,6 @@ from swarms.structs.swarming_architectures import ( geometric_swarm, grid_swarm, harmonic_swarm, - linear_swarm, log_swarm, mesh_swarm, one_to_one, @@ -128,7 +127,6 @@ __all__ = [ "geometric_swarm", "grid_swarm", "harmonic_swarm", - "linear_swarm", "log_swarm", "mesh_swarm", "one_to_one", diff --git a/swarms/structs/various_alt_swarms.py b/swarms/structs/various_alt_swarms.py index c4b34f9f..589e9ad2 100644 --- a/swarms/structs/various_alt_swarms.py +++ b/swarms/structs/various_alt_swarms.py @@ -119,60 +119,6 @@ class CircularSwarm(BaseSwarm): return self._format_return() -class LinearSwarm(BaseSwarm): - """ - Implements a linear swarm where agents process tasks sequentially. - """ - - def __init__( - self, - agents: AgentListType, - name: str = "LinearSwarm", - description: str = "A linear swarm where agents process tasks sequentially", - output_type: str = "dict", - ): - """ - Initialize the LinearSwarm. - - Args: - agents: List of Agent objects or nested list of Agent objects - name: Name of the swarm - description: Description of the swarm's purpose - output_type: Type of output format, one of 'dict', 'list', 'string', 'json', 'yaml', 'xml', etc. - """ - super().__init__(agents, name, description, output_type) - - def run(self, tasks: List[str]) -> Union[Dict, List, str]: - """ - Run the linear swarm with the given tasks - - Args: - tasks: List of tasks to be processed - - Returns: - Union[Dict, List, str]: The conversation history in the requested format - """ - if not self.agents or not tasks: - raise ValueError( - "Agents and tasks lists cannot be empty." - ) - - tasks_copy = tasks.copy() - responses = [] - - for agent in self.agents: - if tasks_copy: - task = tasks_copy.pop(0) - response = agent.run(task) - self.conversation.add( - role=agent.agent_name, - content=response, - ) - responses.append(response) - - return self._format_return() - - class StarSwarm(BaseSwarm): """ Implements a star swarm where a central agent processes all tasks, followed by others. diff --git a/tests/structs/test_swarm_architectures.py b/tests/structs/test_swarm_architectures.py index cbe7d4d8..7be89129 100644 --- a/tests/structs/test_swarm_architectures.py +++ b/tests/structs/test_swarm_architectures.py @@ -8,7 +8,6 @@ from swarms.structs.swarming_architectures import ( geometric_swarm, grid_swarm, harmonic_swarm, - linear_swarm, log_swarm, mesh_swarm, one_to_one, @@ -69,21 +68,6 @@ def test_grid_swarm(): assert len(result) > 0 -def test_linear_swarm(): - """Test linear swarm sequential processing""" - agents = create_test_agents(3) - tasks = ["Research task", "Write content", "Review output"] - - result = linear_swarm(agents, tasks) - - assert isinstance(result, list) - assert len(result) > 0 - - for log in result: - assert "role" in log - assert "content" in log - - def test_star_swarm(): """Test star swarm with central and peripheral agents""" agents = create_test_agents(4) From 7482a9b9760868cdc69da5df76253bdf925207af Mon Sep 17 00:00:00 2001 From: Hugh <155223694+hughiwnl@users.noreply.github.com> Date: Tue, 2 Dec 2025 12:14:42 -0800 Subject: [PATCH 3/4] fixed merge conflicts --- docs/llm.txt | 2 -- docs/swarms/examples/unique_swarms.md | 1 - swarms/structs/swarming_architectures.py | 1 - 3 files changed, 4 deletions(-) diff --git a/docs/llm.txt b/docs/llm.txt index 2a0709b1..d6674264 100644 --- a/docs/llm.txt +++ b/docs/llm.txt @@ -24130,7 +24130,6 @@ flowchart LR - Maintains strict ordering of task processing - ### Star Swarm ```python def star_swarm(agents: AgentListType, tasks: List[str], return_full_history: bool = True) @@ -24364,7 +24363,6 @@ flowchart TD ## Common Use Cases 1. **Data Processing Pipelines** - - Linear Swarm - Circular Swarm 2. **Distributed Computing** diff --git a/docs/swarms/examples/unique_swarms.md b/docs/swarms/examples/unique_swarms.md index a4a37bb6..af3b30e1 100644 --- a/docs/swarms/examples/unique_swarms.md +++ b/docs/swarms/examples/unique_swarms.md @@ -294,7 +294,6 @@ flowchart TD ## Common Use Cases 1. **Data Processing Pipelines** - - Linear Swarm - Circular Swarm 2. **Distributed Computing** diff --git a/swarms/structs/swarming_architectures.py b/swarms/structs/swarming_architectures.py index f2c09bed..033a083f 100644 --- a/swarms/structs/swarming_architectures.py +++ b/swarms/structs/swarming_architectures.py @@ -106,7 +106,6 @@ def grid_swarm( return history_output_formatter(conversation, output_type) - # Star Swarm: A central agent first processes all tasks, followed by others def star_swarm( agents: AgentListType, From ad52f12dcd61bacec9d7bd97c50cfc93bba2ddb6 Mon Sep 17 00:00:00 2001 From: Hugh <155223694+hughiwnl@users.noreply.github.com> Date: Tue, 2 Dec 2025 11:50:33 -0800 Subject: [PATCH 4/4] removed mentions of linear swarm --- swarms/structs/various_alt_swarms.py | 54 ---------------------------- 1 file changed, 54 deletions(-) diff --git a/swarms/structs/various_alt_swarms.py b/swarms/structs/various_alt_swarms.py index c4b34f9f..589e9ad2 100644 --- a/swarms/structs/various_alt_swarms.py +++ b/swarms/structs/various_alt_swarms.py @@ -119,60 +119,6 @@ class CircularSwarm(BaseSwarm): return self._format_return() -class LinearSwarm(BaseSwarm): - """ - Implements a linear swarm where agents process tasks sequentially. - """ - - def __init__( - self, - agents: AgentListType, - name: str = "LinearSwarm", - description: str = "A linear swarm where agents process tasks sequentially", - output_type: str = "dict", - ): - """ - Initialize the LinearSwarm. - - Args: - agents: List of Agent objects or nested list of Agent objects - name: Name of the swarm - description: Description of the swarm's purpose - output_type: Type of output format, one of 'dict', 'list', 'string', 'json', 'yaml', 'xml', etc. - """ - super().__init__(agents, name, description, output_type) - - def run(self, tasks: List[str]) -> Union[Dict, List, str]: - """ - Run the linear swarm with the given tasks - - Args: - tasks: List of tasks to be processed - - Returns: - Union[Dict, List, str]: The conversation history in the requested format - """ - if not self.agents or not tasks: - raise ValueError( - "Agents and tasks lists cannot be empty." - ) - - tasks_copy = tasks.copy() - responses = [] - - for agent in self.agents: - if tasks_copy: - task = tasks_copy.pop(0) - response = agent.run(task) - self.conversation.add( - role=agent.agent_name, - content=response, - ) - responses.append(response) - - return self._format_return() - - class StarSwarm(BaseSwarm): """ Implements a star swarm where a central agent processes all tasks, followed by others.