Update README.md

pull/491/head
Eternal Reclaimer 7 months ago committed by GitHub
parent ee4de4d21c
commit b8cb3e4647
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -13,7 +13,18 @@ Orchestrate swarms of agents for production-grade applications.
</div>
Individual agents face 5 significant challenges that hinder their deployment in production: short memory, single-task threading, hallucinations, high cost, and lack of collaboration. Multi-agent collaboration offers a solution to all these issues. Swarms provides simple, reliable, and agile tools to create your own Swarm tailored to your specific needs. Currently, Swarms is being used in production by RBC, John Deere, and many AI startups.
Here's a table detailing the features available in a swarms framework, focusing on models, models APIs, agents with tools, memory, and multi-agent orchestration. The table includes feature names, descriptions, performance impact ratings, and documentation links.
| **Feature** | **Description** | **Performance Impact** | **Documentation Link** |
|------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------|-------------------------------|
| Models | Pre-trained models that can be utilized for various tasks within the swarm framework. | ⭐⭐⭐ | [Documentation](#) |
| Models APIs | APIs to interact with and utilize the models effectively, providing interfaces for inference, training, and fine-tuning. | ⭐⭐⭐ | [Documentation](#) |
| Agents with Tools | Agents equipped with specialized tools to perform specific tasks more efficiently, such as data processing, analysis, or interaction with external systems. | ⭐⭐⭐⭐ | [Documentation](#) |
| Memory | Mechanisms for agents to store and recall past interactions, improving learning and adaptability over time. | ⭐⭐⭐⭐ | [Documentation](#) |
| Multi-Agent Orchestration | Coordination of multiple agents to work together seamlessly on complex tasks, leveraging their individual strengths to achieve higher overall performance. | ⭐⭐⭐⭐⭐ | [Documentation](#) |
The performance impact is rated on a scale from one to five stars, with multi-agent orchestration being the highest due to its ability to combine the strengths of multiple agents and optimize task execution.
----
## Install
@ -28,7 +39,7 @@ Run example in Collab: <a target="_blank" href="https://colab.research.google.co
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
</a>
### `Agent`
## `Agents`
A fully plug-and-play autonomous agent powered by an LLM extended by a long-term memory database, and equipped with function calling for tool usage! By passing in an LLM, you can create a fully autonomous agent with extreme customization and reliability, ready for real-world task automation!
Features:
@ -67,7 +78,7 @@ agent.run("Generate a 10,000 word blog on health and wellness.")
```
# `Agent` with Long Term Memory
### `Agent` + Long Term Memory
`Agent` equipped with quasi-infinite long term memory. Great for long document understanding, analysis, and retrieval.
```python
@ -106,7 +117,7 @@ print(out)
```
# `Agent` with Long Term Memory ++ Tools!
### `Agent` ++ Long Term Memory ++ Tools!
An LLM equipped with long term memory and tools, a full stack agent capable of automating all and any digital tasks given a good prompt.
```python
@ -149,40 +160,10 @@ print(out)
```
### Simple Conversational Agent
A Plug in and play conversational agent with `GPT4`, `Mixytral`, or any of our models
- Reliable conversational structure to hold messages together with dynamic handling for long context conversations and interactions with auto chunking
- Reliable, this simple system will always provide responses you want.
```python
from swarms import Agent, Anthropic
## Initialize the workflow
agent = Agent(
agent_name="Transcript Generator",
agent_description=(
"Generate a transcript for a youtube video on what swarms"
" are!"
),
llm=Anthropic(),
max_loops=3,
autosave=True,
dashboard=False,
streaming_on=True,
verbose=True,
stopping_token="<DONE>",
interactive=True, # Set to True
)
# Run the workflow on a task
agent("Generate a transcript for a youtube video on what swarms are!")
```
## Devin
### Devin
Implementation of Devin in less than 90 lines of code with several tools:
terminal, browser, and edit files!
terminal, browser, and edit files.
```python
from swarms import Agent, Anthropic
@ -286,7 +267,7 @@ print(out)
```
## `Agent`with Pydantic BaseModel as Output Type
### `Agent`with Pydantic BaseModel as Output Type
The following is an example of an agent that intakes a pydantic basemodel and outputs it at the same time:
```python
@ -348,6 +329,49 @@ print(f"Generated data: {generated_data}")
```
### `Multi Modal Autonomous Agents`
Run the agent with multiple modalities useful for various real-world tasks in manufacturing, logistics, and health.
```python
# Description: This is an example of how to use the Agent class to run a multi-modal workflow
import os
from dotenv import load_dotenv
from swarms.models.gpt4_vision_api import GPT4VisionAPI
from swarms.structs import Agent
# Load the environment variables
load_dotenv()
# Get the API key from the environment
api_key = os.environ.get("OPENAI_API_KEY")
# Initialize the language model
llm = GPT4VisionAPI(
openai_api_key=api_key,
max_tokens=500,
)
# Initialize the task
task = (
"Analyze this image of an assembly line and identify any issues such as"
" misaligned parts, defects, or deviations from the standard assembly"
" process. IF there is anything unsafe in the image, explain why it is"
" unsafe and how it could be improved."
)
img = "assembly_line.jpg"
## Initialize the workflow
agent = Agent(
llm=llm, max_loops="auto", autosave=True, dashboard=True, multi_modal=True
)
# Run the workflow on a task
agent.run(task=task, img=img)
```
----
### `ToolAgent`
ToolAgent is an agent that can use tools through JSON function calling. It intakes any open source model from huggingface and is extremely modular and plug in and play. We need help adding general support to all models soon.
@ -414,6 +438,21 @@ print(f"Generated data: {generated_data}")
----
# Multi-Agent Orchestration:
Swarms was designed to faciliate the communication between many different and specialized agents from a vast array of other frameworks such as langchain, autogen, crew, and more.
| **Name** | **Description** | **Code Link** | **Use Cases** |
|-------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|---------------------------------------------------------------------------------------------------|
| Hierarchical Swarms | A system where agents are organized in a hierarchy, with higher-level agents coordinating lower-level agents to achieve complex tasks. | [Code Link](#) | Manufacturing process optimization, multi-level sales management, healthcare resource coordination |
| Agent Rearrange | A setup where agents rearrange themselves dynamically based on the task requirements and environmental conditions. | [Code Link](#) | Adaptive manufacturing lines, dynamic sales territory realignment, flexible healthcare staffing |
| Concurrent Workflows | Agents perform different tasks simultaneously, coordinating to complete a larger goal. | [Code Link](#) | Concurrent production lines, parallel sales operations, simultaneous patient care processes |
| Sequential Coordination | Agents perform tasks in a specific sequence, where the completion of one task triggers the start of the next. | [Code Link](#) | Step-by-step assembly lines, sequential sales processes, stepwise patient treatment workflows |
| Parallel Processing | Agents work on different parts of a task simultaneously to speed up the overall process. | [Code Link](#) | Parallel data processing in manufacturing, simultaneous sales analytics, concurrent medical tests |
### `SequentialWorkflow`
Sequential Workflow enables you to sequentially execute tasks with `Agent` and then pass the output into the next agent and onwards until you have specified your max loops. `SequentialWorkflow` is wonderful for real-world business tasks like sending emails, summarizing documents, and analyzing data.
@ -659,7 +698,7 @@ print(f"Task result: {task.result}")
## Majority Voting
### Majority Voting
Multiple-agents will evaluate an idea based off of an parsing or evaluation function. From papers like "[More agents is all you need](https://arxiv.org/pdf/2402.05120.pdf)
```python
@ -707,7 +746,7 @@ mv = MajorityVoting(
mv.run("What is your stance on healthcare?")
```
## Real-World Deployment
### Real-World Deployment
### Multi-Agent Swarm for Logistics
Here's a production grade swarm ready for real-world deployment in a factory and logistics settings like warehouses. This swarm can automate 3 costly and inefficient workflows, safety checks, productivity checks, and warehouse security.
@ -820,48 +859,6 @@ efficiency_analysis = efficiency_agent.run(
---
## `Multi Modal Autonomous Agents`
Run the agent with multiple modalities useful for various real-world tasks in manufacturing, logistics, and health.
```python
# Description: This is an example of how to use the Agent class to run a multi-modal workflow
import os
from dotenv import load_dotenv
from swarms.models.gpt4_vision_api import GPT4VisionAPI
from swarms.structs import Agent
# Load the environment variables
load_dotenv()
# Get the API key from the environment
api_key = os.environ.get("OPENAI_API_KEY")
# Initialize the language model
llm = GPT4VisionAPI(
openai_api_key=api_key,
max_tokens=500,
)
# Initialize the task
task = (
"Analyze this image of an assembly line and identify any issues such as"
" misaligned parts, defects, or deviations from the standard assembly"
" process. IF there is anything unsafe in the image, explain why it is"
" unsafe and how it could be improved."
)
img = "assembly_line.jpg"
## Initialize the workflow
agent = Agent(
llm=llm, max_loops="auto", autosave=True, dashboard=True, multi_modal=True
)
# Run the workflow on a task
agent.run(task=task, img=img)
```
----
## Build your own LLMs, Agents, and Swarms!

Loading…
Cancel
Save