overview for multi-agent docs

dependabot/pip/transformers-gte-4.39.0-and-lt-4.53.0
Kye Gomez 3 weeks ago
parent bdf6885cbc
commit e1e3edd221

@ -225,12 +225,12 @@ nav:
- How to Create New Swarm Architectures: "swarms/structs/create_new_swarm.md" - How to Create New Swarm Architectures: "swarms/structs/create_new_swarm.md"
- Introduction to Hiearchical Swarm Architectures: "swarms/structs/multi_swarm_orchestration.md" - Introduction to Hiearchical Swarm Architectures: "swarms/structs/multi_swarm_orchestration.md"
- Swarm Architecture Documentation: - Swarm Architectures Documentation:
- Overview: "swarms/structs/index.md"
- MajorityVoting: "swarms/structs/majorityvoting.md" - MajorityVoting: "swarms/structs/majorityvoting.md"
- AgentRearrange: "swarms/structs/agent_rearrange.md" - AgentRearrange: "swarms/structs/agent_rearrange.md"
- RoundRobin: "swarms/structs/round_robin_swarm.md" - RoundRobin: "swarms/structs/round_robin_swarm.md"
- Mixture of Agents: "swarms/structs/moa.md" - Mixture of Agents: "swarms/structs/moa.md"
- GraphWorkflow: "swarms/structs/graph_workflow.md"
- GroupChat: "swarms/structs/group_chat.md" - GroupChat: "swarms/structs/group_chat.md"
- AgentRegistry: "swarms/structs/agent_registry.md" - AgentRegistry: "swarms/structs/agent_registry.md"
- SpreadSheetSwarm: "swarms/structs/spreadsheet_swarm.md" - SpreadSheetSwarm: "swarms/structs/spreadsheet_swarm.md"
@ -242,17 +242,21 @@ nav:
- MatrixSwarm: "swarms/structs/matrix_swarm.md" - MatrixSwarm: "swarms/structs/matrix_swarm.md"
- ModelRouter: "swarms/structs/model_router.md" - ModelRouter: "swarms/structs/model_router.md"
- MALT: "swarms/structs/malt.md" - MALT: "swarms/structs/malt.md"
- Auto Agent Builder: "swarms/structs/auto_agent_builder.md"
- Various Execution Methods: "swarms/structs/various_execution_methods.md" - Various Execution Methods: "swarms/structs/various_execution_methods.md"
- Hybrid Hierarchical-Cluster Swarm: "swarms/structs/hhcs.md"
- Deep Research Swarm: "swarms/structs/deep_research_swarm.md" - Deep Research Swarm: "swarms/structs/deep_research_swarm.md"
- Auto Swarm Builder: "swarms/structs/auto_swarm_builder.md"
- Swarm Matcher: "swarms/structs/swarm_matcher.md" - Swarm Matcher: "swarms/structs/swarm_matcher.md"
- Hiearchical Architectures:
- Auto Agent Builder: "swarms/structs/auto_agent_builder.md"
- Hybrid Hierarchical-Cluster Swarm: "swarms/structs/hhcs.md"
- Auto Swarm Builder: "swarms/structs/auto_swarm_builder.md"
- Workflows: - Workflows:
- ConcurrentWorkflow: "swarms/structs/concurrentworkflow.md" - ConcurrentWorkflow: "swarms/structs/concurrentworkflow.md"
- SequentialWorkflow: "swarms/structs/sequential_workflow.md" - SequentialWorkflow: "swarms/structs/sequential_workflow.md"
- Structs: - GraphWorkflow: "swarms/structs/graph_workflow.md"
- Conversation: "swarms/structs/conversation.md" - Communication Structure: "swarms/structs/conversation.md"
- Swarms Tools: - Swarms Tools:
- Overview: "swarms_tools/overview.md" - Overview: "swarms_tools/overview.md"

@ -2,349 +2,596 @@
## Introduction ## Introduction
The `Conversation` class is a powerful tool for managing and structuring conversation data in a Python program. It enables you to create, manipulate, and analyze conversations easily. This documentation will provide you with a comprehensive understanding of the `Conversation` class, its attributes, methods, and how to effectively use it. The `Conversation` class is a powerful tool for managing and structuring conversation data in a Python program. It enables you to create, manipulate, and analyze conversations easily. This documentation provides a comprehensive understanding of the `Conversation` class, its attributes, methods, and how to effectively use it.
## Table of Contents ## Table of Contents
1. **Class Definition** 1. [Class Definition](#1-class-definition)
2. [Initialization Parameters](#2-initialization-parameters)
3. [Methods](#3-methods)
4. [Examples](#4-examples)
- Overview ## 1. Class Definition
- Attributes ### Overview
- Initialization Parameters The `Conversation` class is designed to manage conversations by keeping track of messages and their attributes. It offers methods for adding, deleting, updating, querying, and displaying messages within the conversation. Additionally, it supports exporting and importing conversations, searching for specific keywords, and more.
2. **Core Methods**
- Message Management
- History Operations
- Export/Import ### Attributes
| Attribute | Type | Description |
|-----------|------|-------------|
| id | str | Unique identifier for the conversation |
| name | str | Name of the conversation |
| system_prompt | Optional[str] | System prompt for the conversation |
| time_enabled | bool | Flag to enable time tracking for messages |
| autosave | bool | Flag to enable automatic saving |
| save_filepath | str | File path for saving conversation history |
| conversation_history | list | List storing conversation messages |
| tokenizer | Any | Tokenizer for counting tokens |
| context_length | int | Maximum tokens allowed in conversation |
| rules | str | Rules for the conversation |
| custom_rules_prompt | str | Custom prompt for rules |
| user | str | User identifier for messages |
| auto_save | bool | Flag to enable auto-saving |
| save_as_yaml | bool | Flag to save as YAML |
| save_as_json_bool | bool | Flag to save as JSON |
| token_count | bool | Flag to enable token counting |
| cache_enabled | bool | Flag to enable prompt caching |
| cache_stats | dict | Statistics about cache usage |
| cache_lock | threading.Lock | Lock for thread-safe cache operations |
| conversations_dir | str | Directory to store cached conversations |
## 2. Initialization Parameters
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| id | str | generated | Unique conversation ID |
| name | str | None | Name of the conversation |
| system_prompt | Optional[str] | None | System prompt for the conversation |
| time_enabled | bool | False | Enable time tracking |
| autosave | bool | False | Enable automatic saving |
| save_filepath | str | None | File path for saving |
| tokenizer | Any | None | Tokenizer for counting tokens |
| context_length | int | 8192 | Maximum tokens allowed |
| rules | str | None | Conversation rules |
| custom_rules_prompt | str | None | Custom rules prompt |
| user | str | "User:" | User identifier |
| auto_save | bool | True | Enable auto-saving |
| save_as_yaml | bool | True | Save as YAML |
| save_as_json_bool | bool | False | Save as JSON |
| token_count | bool | True | Enable token counting |
| cache_enabled | bool | True | Enable prompt caching |
| conversations_dir | Optional[str] | None | Directory for cached conversations |
| provider | Literal["mem0", "in-memory"] | "in-memory" | Storage provider |
## 3. Methods
### `add(role: str, content: Union[str, dict, list], metadata: Optional[dict] = None)`
- Search and Query Adds a message to the conversation history.
- Cache Management | Parameter | Type | Description |
|-----------|------|-------------|
| role | str | Role of the speaker |
| content | Union[str, dict, list] | Message content |
| metadata | Optional[dict] | Additional metadata |
- Memory Management Example:
```python
conversation = Conversation()
conversation.add("user", "Hello, how are you?")
conversation.add("assistant", "I'm doing well, thank you!")
```
3. **Advanced Features** ### `add_multiple_messages(roles: List[str], contents: List[Union[str, dict, list]])`
- Token Counting Adds multiple messages to the conversation history.
- Memory Providers | Parameter | Type | Description |
|-----------|------|-------------|
| roles | List[str] | List of speaker roles |
| contents | List[Union[str, dict, list]] | List of message contents |
- Caching System Example:
```python
conversation = Conversation()
conversation.add_multiple_messages(
["user", "assistant"],
["Hello!", "Hi there!"]
)
```
- Batch Operations ### `delete(index: str)`
--- Deletes a message from the conversation history.
### 1. Class Definition | Parameter | Type | Description |
|-----------|------|-------------|
| index | str | Index of message to delete |
#### Overview Example:
```python
conversation = Conversation()
conversation.add("user", "Hello")
conversation.delete(0) # Deletes the first message
```
The `Conversation` class is designed to manage conversations by keeping track of messages and their attributes. It offers methods for adding, deleting, updating, querying, and displaying messages within the conversation. Additionally, it supports exporting and importing conversations, searching for specific keywords, and more. ### `update(index: str, role: str, content: Union[str, dict])`
#### Attributes Updates a message in the conversation history.
- `id (str)`: Unique identifier for the conversation | Parameter | Type | Description |
|-----------|------|-------------|
| index | str | Index of message to update |
| role | str | New role of speaker |
| content | Union[str, dict] | New message content |
- `name (str)`: Name of the conversation Example:
```python
conversation = Conversation()
conversation.add("user", "Hello")
conversation.update(0, "user", "Hi there!")
```
- `system_prompt (Optional[str])`: System prompt for the conversation ### `query(index: str)`
- `time_enabled (bool)`: Flag to enable time tracking for messages Retrieves a message from the conversation history.
- `autosave (bool)`: Flag to enable automatic saving | Parameter | Type | Description |
|-----------|------|-------------|
| index | str | Index of message to query |
- `save_filepath (str)`: File path for saving conversation history Example:
```python
conversation = Conversation()
conversation.add("user", "Hello")
message = conversation.query(0)
```
- `conversation_history (list)`: List storing conversation messages ### `search(keyword: str)`
- `tokenizer (Any)`: Tokenizer for counting tokens Searches for messages containing a keyword.
- `context_length (int)`: Maximum number of tokens allowed | Parameter | Type | Description |
|-----------|------|-------------|
| keyword | str | Keyword to search for |
- `rules (str)`: Rules for the conversation Example:
```python
conversation = Conversation()
conversation.add("user", "Hello world")
results = conversation.search("world")
```
- `custom_rules_prompt (str)`: Custom prompt for rules ### `display_conversation(detailed: bool = False)`
- `user (str)`: User identifier for messages Displays the conversation history.
- `auto_save (bool)`: Flag for auto-saving | Parameter | Type | Description |
|-----------|------|-------------|
| detailed | bool | Show detailed information |
- `save_as_yaml (bool)`: Flag to save as YAML Example:
```python
conversation = Conversation()
conversation.add("user", "Hello")
conversation.display_conversation(detailed=True)
```
### `export_conversation(filename: str)`
- `save_as_json_bool (bool)`: Flag to save as JSON Exports conversation history to a file.
- `token_count (bool)`: Flag to enable token counting | Parameter | Type | Description |
|-----------|------|-------------|
| filename | str | Output file path |
- `cache_enabled (bool)`: Flag to enable prompt caching Example:
```python
conversation = Conversation()
conversation.add("user", "Hello")
conversation.export_conversation("chat.txt")
```
- `cache_stats (dict)`: Statistics about cache usage ### `import_conversation(filename: str)`
- `provider (Literal["mem0", "in-memory"])`: Memory provider type Imports conversation history from a file.
#### Initialization Parameters | Parameter | Type | Description |
|-----------|------|-------------|
| filename | str | Input file path |
Example:
```python ```python
conversation = Conversation( conversation = Conversation()
id="unique_id", # Optional: Unique identifier conversation.import_conversation("chat.txt")
name="conversation_name", # Optional: Name of conversation
system_prompt="System message", # Optional: Initial system prompt
time_enabled=True, # Optional: Enable timestamps
autosave=True, # Optional: Enable auto-saving
save_filepath="path/to/save.json", # Optional: Save location
tokenizer=your_tokenizer, # Optional: Token counter
context_length=8192, # Optional: Max tokens
rules="conversation rules", # Optional: Rules
custom_rules_prompt="custom", # Optional: Custom rules
user="User:", # Optional: User identifier
auto_save=True, # Optional: Auto-save
save_as_yaml=True, # Optional: Save as YAML
save_as_json_bool=False, # Optional: Save as JSON
token_count=True, # Optional: Count tokens
cache_enabled=True, # Optional: Enable caching
conversations_dir="path/to/dir", # Optional: Cache directory
provider="in-memory" # Optional: Memory provider
)
``` ```
### 2. Core Methods ### `count_messages_by_role()`
#### Message Management
##### `add(role: str, content: Union[str, dict, list], metadata: Optional[dict] = None)` Counts messages by role.
Adds a message to the conversation history. Returns: Dict[str, int]
Example:
```python ```python
# Add a simple text message conversation = Conversation()
conversation.add("user", "Hello, how are you?") conversation.add("user", "Hello")
conversation.add("assistant", "Hi")
# Add a structured message counts = conversation.count_messages_by_role()
conversation.add("assistant", {
"type": "response",
"content": "I'm doing well!"
})
# Add with metadata
conversation.add("user", "Hello", metadata={"timestamp": "2024-03-20"})
``` ```
##### `add_multiple_messages(roles: List[str], contents: List[Union[str, dict, list]])` ### `return_history_as_string()`
Adds multiple messages at once. Returns conversation history as a string.
Returns: str
Example:
```python ```python
conversation.add_multiple_messages( conversation = Conversation()
roles=["user", "assistant"], conversation.add("user", "Hello")
contents=["Hello!", "Hi there!"] history = conversation.return_history_as_string()
)
``` ```
##### `add_tool_output_to_agent(role: str, tool_output: dict)` ### `save_as_json(filename: str)`
Saves conversation history as JSON.
Adds a tool output to the conversation. | Parameter | Type | Description |
|-----------|------|-------------|
| filename | str | Output JSON file path |
Example:
```python ```python
conversation.add_tool_output_to_agent( conversation = Conversation()
"tool", conversation.add("user", "Hello")
{"name": "calculator", "result": "42"} conversation.save_as_json("chat.json")
)
``` ```
#### History Operations ### `load_from_json(filename: str)`
##### `get_last_message_as_string() -> str` Loads conversation history from JSON.
Returns the last message as a string. | Parameter | Type | Description |
|-----------|------|-------------|
| filename | str | Input JSON file path |
Example:
```python ```python
last_message = conversation.get_last_message_as_string() conversation = Conversation()
# Returns: "assistant: Hello there!" conversation.load_from_json("chat.json")
``` ```
##### `get_final_message() -> str` ### `truncate_memory_with_tokenizer()`
Returns the final message from the conversation. Truncates conversation history based on token limit.
Example:
```python ```python
final_message = conversation.get_final_message() conversation = Conversation(tokenizer=some_tokenizer)
# Returns: "assistant: Goodbye!" conversation.truncate_memory_with_tokenizer()
``` ```
##### `get_final_message_content() -> str` ### `clear()`
Returns just the content of the final message. Clears the conversation history.
Example:
```python ```python
final_content = conversation.get_final_message_content() conversation = Conversation()
# Returns: "Goodbye!" conversation.add("user", "Hello")
conversation.clear()
``` ```
##### `return_all_except_first() -> list` ### `to_json()`
Converts conversation history to JSON string.
Returns all messages except the first one. Returns: str
Example:
```python ```python
messages = conversation.return_all_except_first() conversation = Conversation()
conversation.add("user", "Hello")
json_str = conversation.to_json()
``` ```
##### `return_all_except_first_string() -> str` ### `to_dict()`
Converts conversation history to dictionary.
Returns all messages except the first one as a string. Returns: list
Example:
```python ```python
messages_str = conversation.return_all_except_first_string() conversation = Conversation()
conversation.add("user", "Hello")
dict_data = conversation.to_dict()
``` ```
#### Export/Import ### `to_yaml()`
##### `to_json() -> str` Converts conversation history to YAML string.
Converts conversation to JSON string. Returns: str
Example:
```python ```python
json_str = conversation.to_json() conversation = Conversation()
conversation.add("user", "Hello")
yaml_str = conversation.to_yaml()
``` ```
##### `to_dict() -> list` ### `get_visible_messages(agent: "Agent", turn: int)`
Gets visible messages for an agent at a specific turn.
Converts conversation to dictionary. | Parameter | Type | Description |
|-----------|------|-------------|
| agent | Agent | The agent |
| turn | int | Turn number |
Returns: List[Dict]
Example:
```python ```python
dict_data = conversation.to_dict() conversation = Conversation()
visible_msgs = conversation.get_visible_messages(agent, 1)
``` ```
##### `to_yaml() -> str` ### `get_last_message_as_string()`
Gets the last message as a string.
Converts conversation to YAML string. Returns: str
Example:
```python ```python
yaml_str = conversation.to_yaml() conversation = Conversation()
conversation.add("user", "Hello")
last_msg = conversation.get_last_message_as_string()
``` ```
##### `return_json() -> str` ### `return_messages_as_list()`
Returns messages as a list of strings.
Returns conversation as formatted JSON string. Returns: List[str]
Example:
```python ```python
json_str = conversation.return_json() conversation = Conversation()
conversation.add("user", "Hello")
messages = conversation.return_messages_as_list()
``` ```
#### Search and Query ### `return_messages_as_dictionary()`
##### `get_visible_messages(agent: "Agent", turn: int) -> List[Dict]` Returns messages as a list of dictionaries.
Gets visible messages for a specific agent and turn. Returns: List[Dict]
Example:
```python ```python
visible_msgs = conversation.get_visible_messages(agent, turn=1) conversation = Conversation()
conversation.add("user", "Hello")
messages = conversation.return_messages_as_dictionary()
``` ```
#### Cache Management ### `add_tool_output_to_agent(role: str, tool_output: dict)`
##### `get_cache_stats() -> Dict[str, int]` Adds tool output to conversation.
Gets statistics about cache usage. | Parameter | Type | Description |
|-----------|------|-------------|
| role | str | Role of the tool |
| tool_output | dict | Tool output to add |
Example:
```python ```python
stats = conversation.get_cache_stats() conversation = Conversation()
# Returns: { conversation.add_tool_output_to_agent("tool", {"result": "success"})
# "hits": 10,
# "misses": 5,
# "cached_tokens": 1000,
# "total_tokens": 2000,
# "hit_rate": 0.67
# }
``` ```
#### Memory Management ### `return_json()`
##### `clear_memory()` Returns conversation as JSON string.
Clears the conversation memory. Returns: str
Example:
```python ```python
conversation.clear_memory() conversation = Conversation()
conversation.add("user", "Hello")
json_str = conversation.return_json()
``` ```
##### `clear()` ### `get_final_message()`
Clears the conversation history. Gets the final message.
Returns: str
Example:
```python ```python
conversation.clear() conversation = Conversation()
conversation.add("user", "Hello")
final_msg = conversation.get_final_message()
``` ```
### 3. Advanced Features ### `get_final_message_content()`
#### Token Counting Gets content of final message.
The class supports automatic token counting when enabled: Returns: str
Example:
```python ```python
conversation = Conversation(token_count=True) conversation = Conversation()
conversation.add("user", "Hello world") conversation.add("user", "Hello")
# Token count will be automatically calculated and stored content = conversation.get_final_message_content()
``` ```
#### Memory Providers ### `return_all_except_first()`
The class supports different memory providers: Returns all messages except first.
```python Returns: List[Dict]
# In-memory provider (default)
conversation = Conversation(provider="in-memory")
# Mem0 provider Example:
conversation = Conversation(provider="mem0") ```python
conversation = Conversation()
conversation.add("system", "Start")
conversation.add("user", "Hello")
messages = conversation.return_all_except_first()
``` ```
#### Caching System ### `return_all_except_first_string()`
Returns all messages except first as string.
The caching system can be enabled to improve performance: Returns: str
Example:
```python ```python
conversation = Conversation(cache_enabled=True) conversation = Conversation()
# Messages will be cached for faster retrieval conversation.add("system", "Start")
conversation.add("user", "Hello")
messages = conversation.return_all_except_first_string()
``` ```
#### Batch Operations ### `batch_add(messages: List[dict])`
The class supports batch operations for efficiency: Adds multiple messages in batch.
| Parameter | Type | Description |
|-----------|------|-------------|
| messages | List[dict] | List of messages to add |
Example:
```python ```python
# Batch add messages conversation = Conversation()
conversation.batch_add([ conversation.batch_add([
{"role": "user", "content": "Hello"}, {"role": "user", "content": "Hello"},
{"role": "assistant", "content": "Hi"} {"role": "assistant", "content": "Hi"}
]) ])
``` ```
### Class Methods ### `get_cache_stats()`
Gets cache usage statistics.
#### `load_conversation(name: str, conversations_dir: Optional[str] = None) -> "Conversation"` Returns: Dict[str, int]
Example:
```python
conversation = Conversation()
stats = conversation.get_cache_stats()
```
### `load_conversation(name: str, conversations_dir: Optional[str] = None)`
Loads a conversation from cache. Loads a conversation from cache.
| Parameter | Type | Description |
|-----------|------|-------------|
| name | str | Name of conversation |
| conversations_dir | Optional[str] | Directory containing conversations |
Returns: Conversation
Example:
```python ```python
conversation = Conversation.load_conversation("my_conversation") conversation = Conversation.load_conversation("my_chat")
``` ```
#### `list_cached_conversations(conversations_dir: Optional[str] = None) -> List[str]` ### `list_cached_conversations(conversations_dir: Optional[str] = None)`
Lists all cached conversations. Lists all cached conversations.
| Parameter | Type | Description |
|-----------|------|-------------|
| conversations_dir | Optional[str] | Directory containing conversations |
Returns: List[str]
Example:
```python ```python
conversations = Conversation.list_cached_conversations() conversations = Conversation.list_cached_conversations()
``` ```
## Conclusion ### `clear_memory()`
Clears the conversation memory.
Example:
```python
conversation = Conversation()
conversation.add("user", "Hello")
conversation.clear_memory()
```
## 4. Examples
The `Conversation` class provides a comprehensive set of tools for managing conversations in Python applications. With support for multiple memory providers, caching, token counting, and various export formats, it's suitable for a wide range of use cases from simple chat applications to complex AI systems. ### Basic Usage
```python
from swarms.structs import Conversation
# Create a new conversation
conversation = Conversation(
name="my_chat",
system_prompt="You are a helpful assistant",
time_enabled=True
)
# Add messages
conversation.add("user", "Hello!")
conversation.add("assistant", "Hi there!")
# Display conversation
conversation.display_conversation()
# Save conversation
conversation.save_as_json("my_chat.json")
```
### Advanced Usage with Token Counting
```python
from swarms.structs import Conversation
from some_tokenizer import Tokenizer
# Create conversation with token counting
conversation = Conversation(
tokenizer=Tokenizer(),
context_length=4096,
token_count=True
)
# Add messages
conversation.add("user", "Hello, how are you?")
conversation.add("assistant", "I'm doing well, thank you!")
# Get token statistics
stats = conversation.get_cache_stats()
print(f"Total tokens: {stats['total_tokens']}")
```
### Using Different Storage Providers
```python
# In-memory storage
conversation = Conversation(provider="in-memory")
conversation.add("user", "Hello")
# Mem0 storage
conversation = Conversation(provider="mem0")
conversation.add("user", "Hello")
```
## Conclusion
For more information or specific use cases, please refer to the examples above or consult the source code. The `Conversation` class provides a comprehensive set of tools for managing conversations in Python applications. It supports various storage backends, token counting, caching, and multiple export/import formats. The class is designed to be flexible and extensible, making it suitable for a wide range of use cases from simple chat applications to complex conversational AI systems.

@ -0,0 +1,69 @@
# Multi-Agent Architectures Overview
This page provides a comprehensive overview of all available multi-agent architectures in Swarms, their use cases, and functionality.
## Architecture Comparison
=== "Core Architectures"
| Architecture | Use Case | Key Functionality | Documentation |
|-------------|----------|-------------------|---------------|
| MajorityVoting | Decision making through consensus | Combines multiple agent opinions and selects the most common answer | [Docs](majorityvoting.md) |
| AgentRearrange | Optimizing agent order | Dynamically reorders agents based on task requirements | [Docs](agent_rearrange.md) |
| RoundRobin | Equal task distribution | Cycles through agents in a fixed order | [Docs](round_robin_swarm.md) |
| Mixture of Agents | Complex problem solving | Combines diverse expert agents for comprehensive analysis | [Docs](moa.md) |
| GroupChat | Collaborative discussions | Simulates group discussions with multiple agents | [Docs](group_chat.md) |
| AgentRegistry | Agent management | Central registry for managing and accessing agents | [Docs](agent_registry.md) |
| SpreadSheetSwarm | Data processing | Collaborative data processing and analysis | [Docs](spreadsheet_swarm.md) |
| ForestSwarm | Hierarchical decision making | Tree-like structure for complex decision processes | [Docs](forest_swarm.md) |
| SwarmRouter | Task routing | Routes tasks to appropriate agents based on requirements | [Docs](swarm_router.md) |
| TaskQueueSwarm | Task management | Manages and prioritizes tasks in a queue | [Docs](taskqueue_swarm.md) |
| SwarmRearrange | Dynamic swarm optimization | Optimizes swarm configurations for specific tasks | [Docs](swarm_rearrange.md) |
| MultiAgentRouter | Advanced task routing | Routes tasks to specialized agents based on capabilities | [Docs](multi_agent_router.md) |
| MatrixSwarm | Parallel processing | Matrix-based organization for parallel task execution | [Docs](matrix_swarm.md) |
| ModelRouter | Model selection | Routes tasks to appropriate AI models | [Docs](model_router.md) |
| MALT | Multi-agent learning | Enables agents to learn from each other | [Docs](malt.md) |
| Deep Research Swarm | Research automation | Conducts comprehensive research across multiple domains | [Docs](deep_research_swarm.md) |
| Swarm Matcher | Agent matching | Matches tasks with appropriate agent combinations | [Docs](swarm_matcher.md) |
=== "Workflow Architectures"
| Architecture | Use Case | Key Functionality | Documentation |
|-------------|----------|-------------------|---------------|
| ConcurrentWorkflow | Parallel task execution | Executes multiple tasks simultaneously | [Docs](concurrentworkflow.md) |
| SequentialWorkflow | Step-by-step processing | Executes tasks in a specific sequence | [Docs](sequential_workflow.md) |
| GraphWorkflow | Complex task dependencies | Manages tasks with complex dependencies | [Docs](graph_workflow.md) |
=== "Hierarchical Architectures"
| Architecture | Use Case | Key Functionality | Documentation |
|-------------|----------|-------------------|---------------|
| Auto Agent Builder | Automated agent creation | Automatically creates and configures agents | [Docs](auto_agent_builder.md) |
| Hybrid Hierarchical-Cluster Swarm | Complex organization | Combines hierarchical and cluster-based organization | [Docs](hhcs.md) |
| Auto Swarm Builder | Automated swarm creation | Automatically creates and configures swarms | [Docs](auto_swarm_builder.md) |
## Communication Structure
!!! note "Communication Protocols"
The [Conversation](conversation.md) documentation details the communication protocols and structures used between agents in these architectures.
## Choosing the Right Architecture
When selecting a multi-agent architecture, consider the following factors:
!!! tip "Task Complexity"
Simple tasks may only need basic architectures like RoundRobin, while complex tasks might require Hierarchical or Graph-based approaches.
!!! tip "Parallelization Needs"
If tasks can be executed in parallel, consider ConcurrentWorkflow or MatrixSwarm.
!!! tip "Decision Making Requirements"
For consensus-based decisions, MajorityVoting is ideal.
!!! tip "Resource Optimization"
If you need to optimize agent usage, consider SwarmRouter or TaskQueueSwarm.
!!! tip "Learning Requirements"
If agents need to learn from each other, MALT is the appropriate choice.
!!! tip "Dynamic Adaptation"
For tasks requiring dynamic adaptation, consider SwarmRearrange or Auto Swarm Builder.
For more detailed information about each architecture, please refer to their respective documentation pages.
Loading…
Cancel
Save