pull/10/head
Kye 1 year ago
parent 3195a1fff4
commit 02e79f79e8

@ -22,7 +22,7 @@ ENV EVAL_PORT=8000 \
USE_GPU=False \
PLAYGROUND_DIR=playground \
LOG_LEVEL=INFO \
BOT_NAME=Orca \
BOT_NAME=Swarm \
# You will need to set these environment variables to your actual keys in production
OPENAI_API_KEY=your_openai_api_key \
WINEDB_HOST=your_winedb_host \

@ -1,5 +1,5 @@
# from swarms import Swarms, swarm
from swarms.swarms import HierarchicalSwarm, swarm
from swarms.workers.worker_ultra_node import WorkerUltraNode, WorkerUltra, worker_ultra_node
from swarms.workers.WorkerNode import WorkerNode, worker_node
from swarms.workers.worker_node import WorkerNode, worker_node
from swarms.boss.boss_node import BossNode

@ -1,5 +1,39 @@
#input agent or multiple: => it handles multi agent communication, it handles task assignment, task execution, report back with a status, auto scaling, number of agent nodes,
#input agent or multiple: => it handles multi agent communication, it handles task assignment, task execution, report back with a status, auto scaling, number of agent nodes,
#make it optional to have distributed communication protocols, trco, rdp, http, microsoervice
"""
# Orchestrator
* Takes in an agent class with vector store, then handles all the communication and scales up a swarm with number of agents and handles task assignment and task completion
```python
from swarms import OpenAI, Orchestrator, Swarm
orchestrated = Orchestrate(OpenAI, nodes=40) #handles all the task assignment and allocation and agent communication using a vectorstore as a universal communication layer and also handlles the task completion logic
Objective = "Make a business website for a marketing consultancy"
Swarms = (Swarms(orchestrated, auto=True, Objective))
```
In terms of architecture, the swarm might look something like this:
```
(Orchestrator)
/ \
Tools + Vector DB -- (LLM Agent)---(Communication Layer) (Communication Layer)---(LLM Agent)-- Tools + Vector DB
/ | | \
(Task Assignment) (Task Completion) (Task Assignment) (Task Completion)
```
Each LLM agent communicates with the orchestrator through a dedicated communication layer. The orchestrator assigns tasks to each LLM agent, which the agents then complete and return. This setup allows for a high degree of flexibility, scalability, and robustness.
In the context of swarm LLMs, one could consider an **Omni-Vector Embedding Database** for communication. This database could store and manage the high-dimensional vectors produced by each LLM agent.
- Strengths: This approach would allow for similarity-based lookup and matching of LLM-generated vectors, which can be particularly useful for tasks that involve finding similar outputs or recognizing patterns.
- Weaknesses: An Omni-Vector Embedding Database might add complexity to the system in terms of setup and maintenance. It might also require significant computational resources, depending on the volume of data being handled and the complexity of the vectors. The handling and transmission of high-dimensional vectors could also pose challenges in terms of network load.
from swarms import WorkerNode, Orchestrate
Orchestrate(WorkerNode, autoscale=True, nodes=int, swarm_type="flat")

@ -3,7 +3,7 @@ import asyncio
# from swarms.agents.tools.agent_tools import *
from swarms.agents.tools.agent_tools import *
from swarms.workers.WorkerNode import WorkerNodeInitializer, worker_node
from swarms.workers.worker_node import WorkerNodeInitializer, worker_node
from swarms.boss.boss_node import BossNodeInitializer as BossNode
from swarms.workers.worker_ultra_node import WorkerUltra
@ -11,7 +11,6 @@ from swarms.utils.task import Task
from swarms.agents.models.hf import HuggingFaceLLM
# from langchain import LLMMathChain
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
@ -19,6 +18,8 @@ logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(
# TODO: ADD Universal Communication Layer, a ocean vectorstore instance
# TODO: BE MORE EXPLICIT ON TOOL USE, TASK DECOMPOSITION AND TASK COMPLETETION AND ALLOCATION
# TODO: Add RLHF Data collection, ask user how the swarm is performing
# TODO: Create an onboarding process if not settings are preconfigured like `from swarms import Swarm, Swarm()` => then initiate onboarding name your swarm + provide purpose + etc
# TODO: Off
class HierarchicalSwarm:
def __init__(self, model_id: str = None,

@ -1,2 +1,2 @@
from .WorkerNode import worker_node
from .worker_node import worker_node
from .worker_ultra_node import WorkerUltraNode

@ -1,6 +1,6 @@
import unittest
import swarms
from swarms.workers.WorkerNode import WorkerNode
from swarms.workers.worker_node import WorkerNode
from swarms.boss.BossNode import BossNode
class TestSwarms(unittest.TestCase):

Loading…
Cancel
Save