diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index d3f42fb1f..8e3f75d38 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} diff --git a/.github/workflows/pytestmac.yml b/.github/workflows/pytestmac.yml new file mode 100644 index 000000000..09392b7b8 --- /dev/null +++ b/.github/workflows/pytestmac.yml @@ -0,0 +1,35 @@ +name: Test on Macos-14 M1 + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: macos-14 + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python 3.11.7 + uses: actions/setup-python@v5 + with: + python-version: 3.11.7 + + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: true + virtualenvs-in-project: true + installer-parallel: true + + - name: Install dependencies + run: | + poetry install + + - name: Run tests + run: | + poetry run pytest \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index baaadfc8e..6b175ce2d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,9 +19,7 @@ jobs: - "3.9" - "3.10" - "3.11" - test_type: - - "core" - - "extended" + steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} @@ -29,48 +27,26 @@ jobs: with: python-version: ${{ matrix.python-version }} poetry-version: "1.4.2" - cache-key: ${{ matrix.test_type }} install-command: - if [ "${{ matrix.test_type }}" == "core" ]; then - echo "Running core tests, installing dependencies with poetry..." - poetry install - else - echo "Running extended tests, installing dependencies with poetry..." - poetry install -E extended_testing - fi - - name: Run ${{matrix.test_type}} tests - run: | - if [ "${{ matrix.test_type }}" == "core" ]; then - make test - else - make extended_tests - fi + echo "Running core tests, installing dependencies with poetry..." + poetry install + - name: Run core tests + run: pytest shell: bash - name: Python ${{ matrix.python-version }} ${{ matrix.test_type }} - steps: - - uses: actions/checkout@v4 + - name: Python ${{ matrix.python-version }} core + uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: "./.github/actions/poetry_setup" + uses: "actions/setup-python@v2" with: python-version: ${{ matrix.python-version }} poetry-version: "1.4.2" - cache-key: ${{ matrix.test_type }} install-command: | - if [ "${{ matrix.test_type }}" == "core" ]; then - echo "Running core tests, installing dependencies with poetry..." - poetry install - else - echo "Running extended tests, installing dependencies with poetry..." - poetry install -E extended_testing - fi - - name: Run ${{matrix.test_type}} tests - run: | - if [ "${{ matrix.test_type }}" == "core" ]; then - make test - else - make extended_tests - fi + echo "Running core tests, installing dependencies with poetry..." + poetry install + - name: Run core tests + run: pytest shell: bash + build: runs-on: ubuntu-latest strategy: @@ -80,31 +56,17 @@ jobs: - "3.9" - "3.10" - "3.11" - test_type: - - "core" - - "extended" - name: Python ${{ matrix.python-version }} ${{ matrix.test_type }} + name: Python ${{ matrix.python-version }} core steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: "./.github/actions/poetry_setup" + uses: "actions/setup-python@v2" with: python-version: ${{ matrix.python-version }} poetry-version: "1.4.2" - cache-key: ${{ matrix.test_type }} install-command: | - if [ "${{ matrix.test_type }}" == "core" ]; then - echo "Running core tests, installing dependencies with poetry..." - poetry install - else - echo "Running extended tests, installing dependencies with poetry..." - poetry install -E extended_testing - fi - - name: Run ${{matrix.test_type}} tests - run: | - if [ "${{ matrix.test_type }}" == "core" ]; then - make test - else - make extended_tests - fi + echo "Running core tests, installing dependencies with poetry..." + poetry install + - name: Run core tests + run: pytest shell: bash \ No newline at end of file diff --git a/docs/old-docs/C0NTRIBUTING.md b/docs/old-docs/C0NTRIBUTING.md deleted file mode 100644 index 4cf85e6bf..000000000 --- a/docs/old-docs/C0NTRIBUTING.md +++ /dev/null @@ -1,83 +0,0 @@ -# Contributing to Swarms - -Thank you for your interest in contributing to Swarms! We welcome contributions from the community to help improve usability and readability. By contributing, you can be a part of creating a dynamic and interactive AI system. - -To get started, please follow the guidelines below. - -## Join the Swarms Community - -Join the Swarms community on Discord to connect with other contributors, coordinate work, and receive support. - -- [Join the Swarms Discord Server](https://discord.gg/qUtxnK2NMf) - -## Taking on Tasks - -We have a growing list of tasks and issues that you can contribute to. To get started, follow these steps: - -1. Visit the [Swarms GitHub repository](https://github.com/kyegomez/swarms) and browse through the existing issues. - -2. Find an issue that interests you and make a comment stating that you would like to work on it. Include a brief description of how you plan to solve the problem and any questions you may have. - -3. Once a project coordinator assigns the issue to you, you can start working on it. - -If you come across an issue that is unclear but still interests you, please post in the Discord server mentioned above. Someone from the community will be able to help clarify the issue in more detail. - -We also welcome contributions to documentation, such as updating markdown files, adding docstrings, creating system architecture diagrams, and other related tasks. - -## Submitting Your Work - -To contribute your changes to Swarms, please follow these steps: - -1. Fork the Swarms repository to your GitHub account. You can do this by clicking on the "Fork" button on the repository page. - -2. Clone the forked repository to your local machine using the `git clone` command. - -3. Before making any changes, make sure to sync your forked repository with the original repository to keep it up to date. You can do this by following the instructions [here](https://docs.github.com/en/github/collaborating-with-pull-requests/syncing-a-fork). - -4. Create a new branch for your changes. This branch should have a descriptive name that reflects the task or issue you are working on. - -5. Make your changes in the branch, focusing on a small, focused change that only affects a few files. - -6. Run any necessary formatting or linting tools to ensure that your changes adhere to the project's coding standards. - -7. Once your changes are ready, commit them to your branch with descriptive commit messages. - -8. Push the branch to your forked repository. - -9. Create a pull request (PR) from your branch to the main Swarms repository. Provide a clear and concise description of your changes in the PR. - -10. Request a review from the project maintainers. They will review your changes, provide feedback, and suggest any necessary improvements. - -11. Make any required updates or address any feedback provided during the review process. - -12. Once your changes have been reviewed and approved, they will be merged into the main branch of the Swarms repository. - -13. Congratulations! You have successfully contributed to Swarms. - -Please note that during the review process, you may be asked to make changes or address certain issues. It is important to engage in open and constructive communication with the project maintainers to ensure the quality of your contributions. - -## Developer Setup - -If you are interested in setting up the Swarms development environment, please follow the instructions provided in the [developer setup guide](docs/developer-setup.md). This guide provides an overview of the different tools and technologies used in the project. - -## Optimization Priorities - -To continuously improve Swarms, we prioritize the following design objectives: - -1. **Usability**: Increase the ease of use and user-friendliness of the swarm system to facilitate adoption and interaction with basic input. - -2. **Reliability**: Improve the swarm's ability to obtain the desired output even with basic and un-detailed input. - -3. **Speed**: Reduce the time it takes for the swarm to accomplish tasks by improving the communication layer, critiquing, and self-alignment with meta prompting. - -4. **Scalability**: Ensure that the system is asynchronous, concurrent, and self-healing to support scalability. - -Our goal is to continuously improve Swarms by following this roadmap while also being adaptable to new needs and opportunities as they arise. - -## Join the Agora Community - -Swarms is brought to you by Agora, the open-source AI research organization. Join the Agora community to connect with other researchers and developers working on AI projects. - -- [Join the Agora Discord Server](https://discord.gg/qUtxnK2NMf) - -Thank you for your contributions and for being a part of the Swarms and Agora community! Together, we can advance Humanity through the power of AI. \ No newline at end of file diff --git a/docs/old-docs/DOCUMENTATION.md b/docs/old-docs/DOCUMENTATION.md deleted file mode 100644 index b9c33b51f..000000000 --- a/docs/old-docs/DOCUMENTATION.md +++ /dev/null @@ -1,368 +0,0 @@ -# Swarms Documentation - -## ClassName - -Swarms - -## Purpose - -The Swarms module provides a powerful framework for creating and managing swarms of autonomous agents to accomplish complex tasks. It consists of the `WorkerNode` and `BossNode` classes, along with the `LLM` utility class, which allow you to easily set up and run a swarm of agents to tackle any objective. The module is highly configurable and extensible, providing flexibility to accommodate various use cases. - -## Usage example - -```python -from swarms import Swarms - -api_key = "your_openai_api_key" - -# Initialize Swarms with your API key -swarm = Swarms(api_key=api_key) - -# Define an objective -objective = "Please make a web GUI for using HTTP API server..." - -# Run Swarms -result = swarm.run(objective) - -print(result) -``` - -## Constructor - -```python -def __init__(self, openai_api_key) -``` - -- `openai_api_key` (required): The API key for OpenAI's models. - -## Methods - -### run(objective) - -Runs the swarm with the given objective by initializing the worker and boss nodes. - -- `objective` (required): The objective or task to be accomplished by the swarm. - -Returns the result of the swarm execution. - -## Example Usage - -```python -from swarms import Swarms - -api_key = "your_openai_api_key" - -# Initialize Swarms with your API key -swarm = Swarms(api_key=api_key) - -# Define an objective -objective = "Please make a web GUI for using HTTP API server..." - -# Run Swarms -result = swarm.run(objective) - -print(result) -``` - -## WorkerNode - -The `WorkerNode` class represents an autonomous agent instance that functions as a worker to accomplish complex tasks. It has the ability to search the internet, process and generate images, text, audio, and more. - -### Constructor - -```python -def __init__(self, llm, tools, vectorstore) -``` - -- `llm` (required): The language model used by the worker node. -- `tools` (required): A list of tools available to the worker node. -- `vectorstore` (required): The vector store used by the worker node. - -### Methods - -- `create_agent(ai_name, ai_role, human_in_the_loop, search_kwargs)`: Creates an agent within the worker node. -- `add_tool(tool)`: Adds a tool to the worker node. -- `run(prompt)`: Runs the worker node to complete a task specified by the prompt. - -### Example Usage - -```python -from swarms import worker_node - -# Your OpenAI API key -api_key = "your_openai_api_key" - -# Initialize a WorkerNode with your API key -node = worker_node(api_key) - -# Define an objective -objective = "Please make a web GUI for using HTTP API server..." - -# Run the task -task = node.run(objective) - -print(task) -``` - -## BossNode - -The `BossNode` class represents an agent responsible for creating and managing tasks for the worker agent(s). It interacts with the worker node(s) to delegate tasks and monitor their progress. - -### Constructor - -```python -def __init__(self, llm, vectorstore, agent_executor, max_iterations) -``` - -- `llm` (required): The language model used by the boss node. -- `vectorstore` (required): The vector store used by the boss node. -- `agent_executor` (required): The agent executor used to execute tasks. -- `max_iterations` (required): The maximum number of iterations for task execution. - -### Methods - -- `create_task(objective)`: Creates a task with the given objective. -- `execute_task(task)`: Executes the given task by interacting with the worker agent(s). - -## LLM - -The `LLM` class is a utility class that provides an interface to different language models (LLMs) such as OpenAI's ChatGPT and Hugging Face models. It is used to initialize the language model for the worker and boss nodes. - -### Constructor - -```python -def __init__(self, openai_api_key=None, hf_repo_id=None, hf_api_token=None, model_kwargs=None) -``` - -- `openai_api_key` (optional): The API key for OpenAI's models. -- `hf_repo_id` (optional): The repository ID for the Hugging Face model. -- `hf_api_token` (optional): The API token for the Hugging Face model. -- `model_kwargs` (optional): Additional keyword arguments to pass to the language model. - -### Methods - -- `run(prompt)`: Runs the language model with the given prompt and returns the generated response. - -## Configuration - -The Swarms module can be configured by modifying the following parameters: - -### WorkerNode - -- `llm_class`: The language model class to use for the worker node (default: `ChatOpenAI`). -- `temperature`: The temperature parameter for the language model (default: `0.5`). - -### BossNode - -- `llm_class`: The language model class to use for the boss node (default: `OpenAI`). -- `max_iterations`: The maximum number of iterations for task execution (default: `5`). - -### LLM - -- `openai_api_key`: The API key for OpenAI's models. -- `hf_repo_id`: The repository ID for the Hugging Face model. -- `hf_api_token`: The API token for the Hugging Face model. -- `model_kwargs`: Additional keyword arguments to pass to the language model. - -## Tool Configuration - -The Swarms module supports various tools that can be added to the worker node for performing specific tasks. The following tools are available: - -- `DuckDuckGoSearchRun`: A tool for performing web searches. -- `WriteFileTool`: A tool for writing files. -- `ReadFileTool`: A tool for reading files. -- `process_csv`: A tool for processing CSV files. -- `WebpageQATool`: A tool for performing question answering using web pages. - -Additional tools can be added by extending the functionality of the `Tool` class. - -## Advanced Usage - -For more advanced usage, you can customize the tools and parameters according to your specific requirements. The Swarms module provides flexibility and extensibility to accommodate various use cases. - -For example, you can add your own custom tools by extending the `Tool` class and adding them to the worker node. You can also modify the prompt templates used by the boss node to customize the interaction between the boss and worker agents. - -Please refer to the source code and documentation of the Swarms module for more details and examples. - -## Conclusion - -The Swarms module provides a powerful framework for creating and managing swarms of autonomous agents to accomplish complex tasks. With the `WorkerNode` and `BossNode` classes, along with the `LLM` utility class, you can easily set up and run a swarm of agents to tackle any objective. The module is highly configurable and extensible, allowing you to tailor it to your specific needs. - - -## LLM -### Purpose -The `LLM` class provides an interface to different language models (LLMs) such as OpenAI's ChatGPT and Hugging Face models. It allows you to initialize and run a language model with a given prompt and obtain the generated response. - -### Systems Understanding -The `LLM` class takes an OpenAI API key or Hugging Face repository ID and API token as input. It uses these credentials to initialize the language model, either from OpenAI's models or from a specific Hugging Face repository. The language model can then be run with a prompt, and the generated response is returned. - -### Usage Example -```python -from swarms import LLM - -# Create an instance of LLM with OpenAI API key -llm_instance = LLM(openai_api_key="your_openai_key") - -# Run the language model with a prompt -result = llm_instance.run("Who won the FIFA World Cup in 1998?") -print(result) - -# Create an instance of LLM with Hugging Face repository ID and API token -llm_instance = LLM(hf_repo_id="google/flan-t5-xl", hf_api_token="your_hf_api_token") - -# Run the language model with a prompt -result = llm_instance.run("Who won the FIFA World Cup in 1998?") -print(result) -``` - -### Constructor -```python -def __init__(self, openai_api_key: Optional[str] = None, - hf_repo_id: Optional[str] = None, - hf_api_token: Optional[str] = None, - model_kwargs: Optional[dict] = None) -``` -- `openai_api_key` (optional): The API key for OpenAI's models. -- `hf_repo_id` (optional): The repository ID for the Hugging Face model. -- `hf_api_token` (optional): The API token for the Hugging Face model. -- `model_kwargs` (optional): Additional keyword arguments to pass to the language model. - -### Methods -- `run(prompt: str) -> str`: Runs the language model with the given prompt and returns the generated response. - -### Args -- `prompt` (str): The prompt to be passed to the language model. - -### Returns -- `result` (str): The generated response from the language model. - -## Conclusion -The `LLM` class provides a convenient way to initialize and run different language models using either OpenAI's API or Hugging Face models. By providing the necessary credentials and a prompt, you can obtain the generated response from the language model. - - - - - - -# `GooglePalm` class: - -### Example 1: Using Dictionaries as Messages - -```python -from google_palm import GooglePalm - -# Initialize the GooglePalm instance -gp = GooglePalm( - client=your_client, - model_name="models/chat-bison-001", - temperature=0.7, - top_p=0.9, - top_k=10, - n=5 -) - -# Create some messages -messages = [ - {"role": "system", "content": "You are a helpful assistant."}, - {"role": "user", "content": "Who won the world series in 2020?"}, -] - -# Generate a response -response = gp.generate(messages) - -# Print the generated response -print(response) -``` - -### Example 2: Using BaseMessage and Its Subclasses as Messages - -```python -from google_palm import GooglePalm -from langchain.schema.messages import SystemMessage, HumanMessage - -# Initialize the GooglePalm instance -gp = GooglePalm( - client=your_client, - model_name="models/chat-bison-001", - temperature=0.7, - top_p=0.9, - top_k=10, - n=5 -) - -# Create some messages -messages = [ - SystemMessage(content="You are a helpful assistant."), - HumanMessage(content="Who won the world series in 2020?"), -] - -# Generate a response -response = gp.generate(messages) - -# Print the generated response -print(response) -``` - -### Example 3: Using GooglePalm with Asynchronous Function - -```python -import asyncio -from google_palm import GooglePalm -from langchain.schema.messages import SystemMessage, HumanMessage - -# Initialize the GooglePalm instance -gp = GooglePalm( - client=your_client, - model_name="models/chat-bison-001", - temperature=0.7, - top_p=0.9, - top_k=10, - n=5 -) - -# Create some messages -messages = [ - SystemMessage(content="You are a helpful assistant."), - HumanMessage(content="Who won the world series in 2020?"), -] - -# Define an asynchronous function -async def generate_response(): - response = await gp._agenerate(messages) - print(response) - -# Run the asynchronous function -asyncio.run(generate_response()) -``` - -Remember to replace `your_client` with an actual instance of your client. Also, ensure the `model_name` is the correct name of the model that you want to use. - -The `temperature`, `top_p`, `top_k`, and `n` parameters control the randomness and diversity of the generated responses. You can adjust these parameters based on your application's requirements. - - - - - -## `CodeInterpreter`: - -```python -tool = CodeInterpreter("Code Interpreter", "A tool to interpret code and generate useful outputs.") -tool.run("Plot the bitcoin chart of 2023 YTD") - -# Or with file inputs -tool.run("Analyze this dataset and plot something interesting about it.", ["examples/assets/iris.csv"]) -``` - -To use the asynchronous version, simply replace `run` with `arun` and ensure your calling code is in an async context: - -```python -import asyncio - -tool = CodeInterpreter("Code Interpreter", "A tool to interpret code and generate useful outputs.") -asyncio.run(tool.arun("Plot the bitcoin chart of 2023 YTD")) - -# Or with file inputs -asyncio.run(tool.arun("Analyze this dataset and plot something interesting about it.", ["examples/assets/iris.csv"])) -``` - -The `CodeInterpreter` class is a flexible tool that uses the `CodeInterpreterSession` from the `codeinterpreterapi` package to run the code interpretation and return the result. It provides both synchronous and asynchronous methods for convenience, and ensures that exceptions are handled gracefully. \ No newline at end of file diff --git a/docs/old-docs/README.md b/docs/old-docs/README.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/old-docs/Tutorials/GettingStartedLLM.md b/docs/old-docs/Tutorials/GettingStartedLLM.md deleted file mode 100644 index f0d06ef5a..000000000 --- a/docs/old-docs/Tutorials/GettingStartedLLM.md +++ /dev/null @@ -1,225 +0,0 @@ -# Getting Started with Swarms: A Simple Introduction to State-of-the-Art Language Models -====================================================================================== - -Welcome to the universe of Swarms! 🚀 - -Today, you're embarking on a thrilling journey through the ever-evolving realm of state-of-the-art language models. - -As you might know, we're in the early days of this adventure, and every step we take is building from the ground up. - -Our foundation is set on five levels of abstraction. - -Each level adds complexity and capability, but worry not! - -We'll walk you through each step, making sure you have fun and learn along the way. - -So, ready to swarm? - -Let's dive right in! - -Installation 😊 -=============== - -To get started with Swarms, run the following command: - -pip install swarms - -1\. OpenAI -========== - -Ah, OpenAI, where the magic of GPT series lives. - -With Swarms, you can tap into this magic in a straightforward way. - -Think of it as having a chat with one of the smartest beings ever created by humankind! - -Features ✨ ----------- - -- Direct Interface: Seamless interaction with OpenAI's GPT models. -- Synchronous & Asynchronous Interaction: Flexibility to interact in real-time or in the background. -- Multi-query Support: Enables querying multiple IDs simultaneously. -- Streaming Capability: Stream multiple responses for dynamic conversations. -- Console Logging: Gives users visibility and traceability of their interactions. - -How It Works: -============= - -1. Initiate: Set up your agent using your OpenAI API key and other customizable parameters. -2. Converse: Use methods like `generate` to converse with the model. Got a list of queries? No worries, methods like `ask_multiple` got you covered. -3. Marvel: Witness the intelligence in the responses and interact in real-time! - -Quick Start: -============ - -Imagine a scenario where you want to know how multiple IDs (say products, books, or places) are perceived. It's just two lines of code away! - -from swarms import OpenAI()\ -chat = OpenAI()\ -response = chat.generate("Hello World")\ -print(response) - -2\. HuggingFace -=============== - -HuggingFace is a name that's changed the game in the NLP world. And with Swarms, you can easily harness the power of their vast model repository. - -Features ✨ ----------- - -- Access to a Vast Model Repository: Directly tap into HuggingFace's expansive model hub. -- Intuitive Text Generation: Prompt-based text generation that's straightforward. -- High Customizability: Users can set device preferences, maximum length of generated text, and more. -- Speed Boost: Our implementation offers up to a 9x speed increase by leveraging model quantization. -- Less Memory Consumption: Quantization reduces the model size significantly. -- Maintained Accuracy: Despite the reduction in model size and increased speed, the quality of the output remains top-tier. -- Superior to Other Packages: Unlike many other packages that simply wrap around the HuggingFace API, Swarms has built-in support for advanced features like quantization, making it both faster and more efficient. - -How It Works: -============= - -1. Pick Your Model: From BERT to GPT-2, choose from a myriad of options. -2. Chat Away: Generate thought-provoking text based on your prompts. - -Quick Start: -============ - -Ready to create a story? - -from swarms import HuggingFaceLLM - -hugging_face_model = HuggingFaceLLM(model_id="amazon/FalconLite")\ -generated_text = hugging_face_model.generate("In a world where AI rules," - -3\. Google PaLM -=============== - -Google's venture into conversational AI, the PaLM Chat API, can now be effortlessly integrated into your projects with Swarms. - -Features ✨ ----------- - -- Easy Integration: Quickly set up interactions with Google's PaLM Chat API. -- Dynamic Conversations: Engage in back-and-forth chat-like conversations with the model. -- Customizable Sampling Techniques: Set temperature, top-p, and top-k values for diverse and controlled outputs. - -How It Works: -============= - -1. Set Up: Initialize with your preferred model and Google API key. -2. Engage: Engage in back-and-forth conversations with the model. - -Quick Start: -============ - -Looking for a quick joke? Google's got you: - -from swarms import GooglePalm - -google_palm = GooglePalm()\ -messages = [{"role": "system", "content": "You are a funny assistant"}, {"role": "user", "content": "Crack me a joke"}]\ -response = google_palm.generate(messages) - -4\. Anthropic (swarms.models.Anthropic) -============================================== - -Anthropic's models, with their mysterious allure, are now at your fingertips. - -Features ✨ ----------- - -- Simplified Access: Straightforward interaction with Anthropic's large language models. -- Dynamic Text Generation: Generate intriguing content based on user prompts. -- Streaming Mode: Enable real-time streaming of responses for dynamic use-cases. - -How It Works: -============= - -1. Initialize: Get started with your preferred Anthropic model. -2. Generate: Whether you're crafting a story or looking for answers, you're in for a treat. - -Quick Start: -============ - -Dive into a fairy tale: - -from swarms import Anthropic - -anthropic = Anthropic()\ -generated_text = anthropic.generate("In a kingdom far away,") - -Building with the Five Levels of Abstraction -============================================ - -From the individual model, right up to the hivemind, we've crafted a layered approach that scales and diversifies your interactions: - -1. Model: Start with a base model like OpenAI. -2. Agent Level: Integrate the model with vector stores and tools. -3. Worker Infrastructure: Assign tasks to worker nodes with specific tools. -4. Swarm Level: Coordinate multiple worker nodes for a symphony of intelligence. -5. Hivemind: The pinnacle! Integrate multiple swarms for unparalleled capability. - -And, our master plan is... - -The Master Plan -=============== - -Phase 1: Building the Foundation --------------------------------- - -In the first phase, our focus is on building the basic infrastructure of Swarms. - -This includes developing key components like the Swarms class, integrating essential tools, and establishing task completion and evaluation logic. - -We'll also start developing our testing and evaluation framework during this phase. - -If you're interested in foundational work and have a knack for building robust, scalable systems, this phase is for you. - -Phase 2: Optimizing the System ------------------------------- - -In the second phase, we'll focus on optimizing Swarms by integrating more advanced features, improving the system's efficiency, and refining our testing and evaluation framework. - -This phase involves more complex tasks, so if you enjoy tackling challenging problems and contributing to the development of innovative features, this is the phase for you. - -Phase 3: Towards Super-Intelligence ------------------------------------ - -The third phase of our bounty program is the most exciting --- this is where we aim to achieve super-intelligence. - -In this phase, we'll be working on improving the swarm's capabilities, expanding its skills, and fine-tuning the system based on real-world testing and feedback. - -If you're excited about the future of AI and want to contribute to a project that could potentially transform the digital world, this is the phase for you. - -Remember, our roadmap is a guide, and we encourage you to bring your own ideas and creativity to the table. - -We believe that every contribution, no matter how small, can make a difference. - -So join us on this exciting journey and help us create the future of Swarms. - -Hiring: -======= - -We're hiring: Engineers, Researchers, Interns And, salesprofessionals to work on democratizing swarms, email me at with your story at `kye@apac.ai` - -In Conclusion: A World of Possibilities -======================================= - -There you have it! - -A whirlwind tour through some of the most cutting-edge language models available today. - -Remember, Swarms is like a treasure chest, and we're continually adding more jewels to it. - -As Sir Jonathan Ive would say, "True simplicity is derived from so much more than just the absence of clutter and ornamentation, it's about bringing order to complexity." - -Now, with the foundation of Swarms beneath your feet, you're well-equipped to soar to new heights. - -So go on, experiment, explore, and have a blast! - -The future of AI awaits you! 🌌🐝🎉 - -*Disclaimer: Remember, we're at the early stages, but every idea, every line of code, every interaction you have, is helping shape the future of Swarms. So, thank you for being a part of this exciting journey!* - -Happy Swarming! - diff --git a/docs/old-docs/agents/MODELS.md b/docs/old-docs/agents/MODELS.md deleted file mode 100644 index d2dce9cb8..000000000 --- a/docs/old-docs/agents/MODELS.md +++ /dev/null @@ -1,143 +0,0 @@ -## LLMs in Swarms Documentation - -Welcome to the documentation for the llm section of the swarms package, designed to facilitate seamless integration with various AI language models and APIs. This package empowers developers, end-users, and system administrators to interact with AI models from different providers, such as OpenAI, Hugging Face, Google PaLM, and Anthropic. - -### Table of Contents -1. [OpenAI](#openai) -2. [HuggingFace](#huggingface) -3. [Google PaLM](#google-palm) -4. [Anthropic](#anthropic) - -### 1. OpenAI (swarms.models.OpenAI) - -The OpenAI class provides an interface to interact with OpenAI's language models. It allows both synchronous and asynchronous interactions. - -**Constructor:** -```python -OpenAI(api_key: str, system: str = None, console: bool = True, model: str = None, params: dict = None, save_messages: bool = True) -``` - -**Attributes:** -- `api_key` (str): Your OpenAI API key. -- `system` (str, optional): A system message to be used in conversations. -- `console` (bool, default=True): Display console logs. -- `model` (str, optional): Name of the language model to use. -- `params` (dict, optional): Additional parameters for model interactions. -- `save_messages` (bool, default=True): Save conversation messages. - -**Methods:** -- `generate(message: str, **kwargs) -> str`: Generate a response using the OpenAI model. -- `generate_async(message: str, **kwargs) -> str`: Generate a response asynchronously. -- `ask_multiple(ids: List[str], question_template: str) -> List[str]`: Query multiple IDs simultaneously. -- `stream_multiple(ids: List[str], question_template: str) -> List[str]`: Stream multiple responses. - -**Usage Example:** -```python -from swarms import OpenAI -import asyncio - -chat = OpenAI(api_key="YOUR_OPENAI_API_KEY") - -response = chat.generate("Hello, how can I assist you?") -print(response) - -ids = ["id1", "id2", "id3"] -async_responses = asyncio.run(chat.ask_multiple(ids, "How is {id}?")) -print(async_responses) -``` - -### 2. HuggingFace (swarms.models.HuggingFaceLLM) - -The HuggingFaceLLM class allows interaction with language models from Hugging Face. - -**Constructor:** -```python -HuggingFaceLLM(model_id: str, device: str = None, max_length: int = 20, quantize: bool = False, quantization_config: dict = None) -``` - -**Attributes:** -- `model_id` (str): ID or name of the Hugging Face model. -- `device` (str, optional): Device to run the model on (e.g., 'cuda', 'cpu'). -- `max_length` (int, default=20): Maximum length of generated text. -- `quantize` (bool, default=False): Apply model quantization. -- `quantization_config` (dict, optional): Configuration for quantization. - -**Methods:** -- `generate(prompt_text: str, max_length: int = None) -> str`: Generate text based on a prompt. - -**Usage Example:** -```python -from swarms import HuggingFaceLLM - -model_id = "gpt2" -hugging_face_model = HuggingFaceLLM(model_id=model_id) - -prompt = "Once upon a time" -generated_text = hugging_face_model.generate(prompt) -print(generated_text) -``` - -### 3. Google PaLM (swarms.models.GooglePalm) - -The GooglePalm class provides an interface for Google's PaLM Chat API. - -**Constructor:** -```python -GooglePalm(model_name: str = "models/chat-bison-001", google_api_key: str = None, temperature: float = None, top_p: float = None, top_k: int = None, n: int = 1) -``` - -**Attributes:** -- `model_name` (str): Name of the Google PaLM model. -- `google_api_key` (str, optional): Google API key. -- `temperature` (float, optional): Temperature for text generation. -- `top_p` (float, optional): Top-p sampling value. -- `top_k` (int, optional): Top-k sampling value. -- `n` (int, default=1): Number of candidate completions. - -**Methods:** -- `generate(messages: List[Dict[str, Any]], stop: List[str] = None, **kwargs) -> Dict[str, Any]`: Generate text based on a list of messages. -- `__call__(messages: List[Dict[str, Any]], stop: List[str] = None, **kwargs) -> Dict[str, Any]`: Generate text using the call syntax. - -**Usage Example:** -```python -from swarms import GooglePalm - -google_palm = GooglePalm() -messages = [{"role": "system", "content": "You are a helpful assistant"}, {"role": "user", "content": "Tell me a joke"}] - -response = google_palm.generate(messages) -print(response["choices"][0]["text"]) -``` - -### 4. Anthropic (swarms.models.Anthropic) - -The Anthropic class enables interaction with Anthropic's large language models. - -**Constructor:** -```python -Anthropic(model: str = "claude-2", max_tokens_to_sample: int = 256, temperature: float = None, top_k: int = None, top_p: float = None, streaming: bool = False, default_request_timeout: int = None) -``` - -**Attributes:** -- `model` (str): Name of the Anthropic model. -- `max_tokens_to_sample` (int, default=256): Maximum tokens to sample. -- `temperature` (float, optional): Temperature for text generation. -- `top_k` (int, optional): Top-k sampling value. -- `top_p` (float, optional): Top-p sampling value. -- `streaming` (bool, default=False): Enable streaming mode. -- `default_request_timeout` (int, optional): Default request timeout. - -**Methods:** -- `generate(prompt: str, stop: List[str] = None) -> str`: Generate text based on a prompt. - -**Usage Example:** -```python -from swarms import Anthropic - -anthropic = Anthropic() -prompt = "Once upon a time" -generated_text = anthropic.generate(prompt) -print(generated_text) -``` - -This concludes the documentation for the "swarms" package, providing you with tools to seamlessly integrate with various language models and APIs. Happy coding! \ No newline at end of file diff --git a/docs/old-docs/agents/README.md b/docs/old-docs/agents/README.md deleted file mode 100644 index 287c69d90..000000000 --- a/docs/old-docs/agents/README.md +++ /dev/null @@ -1,75 +0,0 @@ -Introduction to Agents in Swarms -================================ - -Welcome to the revolutionary world of Agents in Swarms. I'm a big believer in simplicity, modularity, and the power of open collaboration. The same principles apply here. - -Agents are the individual building blocks in a swarm. They are the worker bees, each with a specific task, but all working together towards a common goal. In our case, an agent is a combination of a Language Model (LLM), Long Term Memory, and Tools. - -In other words, an agent is: - -`LLM => Long Term Memory => Tools` - -That's it. That's as simple as it can get. - -Why does this work? Because each component has a specific, well-defined role. The Language Model is the driving force, generating text based on a given prompt. The Long Term Memory stores information that the agent can draw upon to make its output more coherent and contextually relevant. The Tools provide additional capabilities, such as the ability to parse text, search the web, or interact with APIs. - -But the real beauty of this system is not just in the individual components, but in how they work together. The output of one becomes the input of another, creating a feedback loop of continuous learning and improvement. - -And the best part? Our Agent classes are designed to be as simple as humanely possible. They are plug-and-play with any of our language model classes, vector stores, and tools. This means you can easily swap out one component for another, allowing for endless customization and flexibility. - -The file structure is equally straightforward: - -``` -* memory -* models -* tools -* utils - -``` - -Each directory contains different components of the swarm. The `models` directory contains the language models, the `memory` directory contains the long-term memory, the `tools` directory contains the tools, the `utils` directory contains various utility functions. - -Let's see how simple it is to use these components with some examples: - -```python -# Import the necessary classes -from swarms.agents import Anthropic, HuggingFaceLLM - -# Create an instance of the Anthropic class -anthropic = Anthropic(model="claude-2", max_tokens_to_sample=100, temperature=0.8) - -# Use the Anthropic instance to generate text -prompt = "Once upon a time" -stop = ["The end"] -print("Anthropic output:") -print(anthropic.generate(prompt, stop)) - -# Create an instance of the HuggingFaceLLM class -huggingface = HuggingFaceLLM(model_id="gpt2", device="cpu", max_length=50) - -# Use the HuggingFaceLLM instance to generate text -prompt = "Once upon a time" -print("\nHuggingFaceLLM output:") -print(huggingface.generate(prompt)) -``` - - -And to build an agent: - -```python -from swarms.agents import vectorstore, tool, Agent - -# Create an instance of the Agent class -agent = Agent( - llm=huggingface, - memory=vectorstore, - tools=tool, -) - -agent.run("Make me an instagram clone") -``` - - -In conclusion, the Agents in Swarms represent a new way of thinking about AI. They are simple, modular, and highly customizable, allowing you to create powerful AI systems that are more than the sum of their parts. And as always, we're just getting started. There's always room for improvement, for simplification, for making things even better. That's the spirit of open collaboration. That's the spirit of Swarms. - -Thanks for becoming an alpha build user, email kye@apac.ai with all complaints. \ No newline at end of file diff --git a/docs/old-docs/corp/BENEFITS.md b/docs/old-docs/corp/BENEFITS.md deleted file mode 100644 index a908915cb..000000000 --- a/docs/old-docs/corp/BENEFITS.md +++ /dev/null @@ -1,114 +0,0 @@ -Maximize Value Using Value Equation -1. Maximize Dream Outcome: Solve Problems Worth $1 Billion -Swarms empowers you to solve problems worth $1 billion, maximizing your dream outcome and the potential impact of your work. - -2. Maximize Perceived Likelihood of Success: 99% Success Rate -With a 99% success rate backed by testimonials and proven case studies, Swarms maximizes your confidence in achieving your desired outcomes. - -3. Minimize Time to Success: Achieve Results 10x Faster -Swarms minimizes the time it takes to achieve success by enabling you to accomplish tasks and goals 10 times faster than traditional methods. - -4. Minimize Effort & Sacrifice: Save 100 Hours per Week -By automating tasks and streamlining processes, Swarms saves you 100 hours per week, minimizing effort and sacrifice required to achieve your goals. - -5. Maximize Efficiency: Increase Productivity by 300% -Swarms optimizes your workflow, increasing productivity by 300% through intelligent automation and task optimization. - -6. Minimize Errors: Ensure 99.9% Accuracy -With Swarms' autonomous AI agents, you can achieve 99.9% accuracy, minimizing errors and ensuring the highest level of quality in your work. - -7. Maximize Scalability: Handle 1 Million Transactions per Second -Swarms scales with your growing needs, allowing you to handle up to 1 million transactions per second, ensuring seamless operations as your business expands. - -8. Minimize Costs: Save $1 Million Annually -By optimizing resource allocation and reducing manual labor, Swarms helps you save $1 million annually, minimizing costs and maximizing your bottom line. - -9. Maximize Flexibility: Adapt to Changing Requirements in Minutes -Swarms offers maximum flexibility, allowing you to adapt to changing requirements in minutes, ensuring you stay agile and responsive in a dynamic business environment. - -10. Minimize Complexity: Simplify Complex Tasks by 90% -Swarms simplifies complex tasks by 90%, breaking them down into manageable steps, minimizing complexity and enabling you to tackle even the most challenging projects. - -11. Maximize Collaboration: Increase Team Efficiency by 200% -With Swarms' coordination capabilities, you can increase team efficiency by 200%, fostering collaboration and driving innovation within your organization. - -12. Minimize Downtime: Ensure 99.99% Uptime -Swarms ensures 99.99% uptime, minimizing downtime and ensuring continuous operations, preventing costly disruptions to your business. - -13. Maximize Security: Protect Your Data with Military-Grade Encryption -Swarms prioritizes data security, providing military-grade encryption to protect your sensitive information, maximizing the security and confidentiality of your data. - -14. Minimize Learning Curve: Get Up and Running in 1 Hour -Swarms minimizes the learning curve, allowing you to get up and running in just 1 hour, maximizing your time and productivity. - -15. Maximize Innovation: Stay Ahead with AI-Driven Insights -Swarms leverages AI and autonomous agents to provide cutting-edge insights, enabling you to stay ahead of the competition and drive innovation in your industry. - -16. Minimize Maintenance: Reduce Maintenance Costs by 80% -Swarms reduces maintenance costs by 80%, minimizing the time and resources required for upkeep, allowing you to focus on your core business activities. - -17. Maximize Adaptability: Customize to Your Needs with 100+ Configurable Options -Swarms offers over 100 configurable options, maximizing adaptability and allowing you to customize the platform to suit your specific requirements. - - - -1. Maximize Dream Outcome: Solve Problems Worth $1 Billion -Swarms empowers you to solve problems worth $1 billion, maximizing your dream outcome and the potential impact of your work. - -2. Maximize Perceived Likelihood of Success: 99% Success Rate -With a 99% success rate backed by testimonials and proven case studies, Swarms maximizes your confidence in achieving your desired outcomes. - -3. Minimize Time to Success: Achieve Results 10x Faster -Swarms minimizes the time it takes to achieve success by enabling you to accomplish tasks and goals 10 times faster than traditional methods. - -4. Minimize Effort & Sacrifice: Save 100 Hours per Week -By automating tasks and streamlining processes, Swarms saves you 100 hours per week, minimizing effort and sacrifice required to achieve your goals. - -5. Maximize Efficiency: Increase Productivity by 300% -Swarms optimizes your workflow, increasing productivity by 300% through intelligent automation and task optimization. - -6. Minimize Errors: Ensure 99.9% Accuracy -With Swarms' autonomous AI agents, you can achieve 99.9% accuracy, minimizing errors and ensuring the highest level of quality in your work. - -7. Maximize Scalability: Handle 1 Million Transactions per Second -Swarms scales with your growing needs, allowing you to handle up to 1 million transactions per second, ensuring seamless operations as your business expands. - -8. Minimize Costs: Save $1 Million Annually -By optimizing resource allocation and reducing manual labor, Swarms helps you save $1 million annually, minimizing costs and maximizing your bottom line. - -9. Maximize Flexibility: Adapt to Changing Requirements in Minutes -Swarms offers maximum flexibility, allowing you to adapt to changing requirements in minutes, ensuring you stay agile and responsive in a dynamic business environment. - -10. Minimize Complexity: Simplify Complex Tasks by 90% -Swarms simplifies complex tasks by 90%, breaking them down into manageable steps, minimizing complexity and enabling you to tackle even the most challenging projects. - -11. Maximize Collaboration: Increase Team Efficiency by 200% -With Swarms' coordination capabilities, you can increase team efficiency by 200%, fostering collaboration and driving innovation within your organization. - -12. Minimize Downtime: Ensure 99.99% Uptime -Swarms ensures 99.99% uptime, minimizing downtime and ensuring continuous operations, preventing costly disruptions to your business. - -13. Maximize Security: Protect Your Data with Military-Grade Encryption -Swarms prioritizes data security, providing military-grade encryption to protect your sensitive information, maximizing the security and confidentiality of your data. - -14. Minimize Learning Curve: Get Up and Running in 1 Hour -Swarms minimizes the learning curve, allowing you to get up and running in just 1 hour, maximizing your time and productivity. - -15. Maximize Innovation: Stay Ahead with AI-Driven Insights -Swarms leverages AI and autonomous agents to provide cutting-edge insights, enabling you to stay ahead of the competition and drive innovation in your industry. - -16. Minimize Maintenance: Reduce Maintenance Costs by 80% -Swarms reduces maintenance costs by 80%, minimizing the time and resources required for upkeep, allowing you to focus on your core business activities. - -17. Maximize Adaptability: Customize to Your Needs with 100+ Configurable Options -Swarms offers over 100 configurable options, maximizing adaptability and allowing you to customize the platform to suit your specific requirements. - -18. Minimize Risk: Mitigate Potential Losses by 95% -Swarms helps you minimize risk by mitigating potential losses by 95%, providing a secure and reliable platform for your critical operations. - -19. Maximize ROI: Achieve 500% Return on Investment -With Swarms' efficiency and cost-saving capabilities, you can achieve a 500% return on investment, maximizing the value you get from your resources. - -20. Minimize Waste: Reduce Resource Consumption by 70% -Swarms minimizes waste by reducing resource consumption by 70%, optimizing resource allocation and promoting sustainability in your operations. - diff --git a/docs/old-docs/corp/DEMO_IDEAS.md b/docs/old-docs/corp/DEMO_IDEAS.md deleted file mode 100644 index e1a27f512..000000000 --- a/docs/old-docs/corp/DEMO_IDEAS.md +++ /dev/null @@ -1,7 +0,0 @@ -# Demo Ideas - -* We could also try to create an AI influencer run by a swarm, let it create a whole identity and generate images, memes, and other content for Twitter, Reddit, etc. - -* had a thought that we should have either a more general one of these or a swarm or both -- need something connecting all the calendars, events, and initiatives of all the AI communities, langchain, laion, eluther, lesswrong, gato, rob miles, chatgpt hackers, etc etc - -* Swarm of AI influencers to spread marketing \ No newline at end of file diff --git a/docs/old-docs/corp/DEVELOPER_PLAN.md b/docs/old-docs/corp/DEVELOPER_PLAN.md deleted file mode 100644 index 18d62db5b..000000000 --- a/docs/old-docs/corp/DEVELOPER_PLAN.md +++ /dev/null @@ -1,101 +0,0 @@ -# Flywheel Effect for Developer Acquisition and Incentivization - -As with the sales model, the developer acquisition and incentivization model also relies on a flywheel effect. This effect is particularly potent in a community-driven ecosystem such as ours, where the value proposition continually grows as more developers join and contribute to our projects. Here's how we could apply this approach: - -## Step 1: Initial Value Proposition for Developers -The starting point of the flywheel is to provide an attractive value proposition for developers. This could include: - -- The ability to work on cutting-edge technology (Swarms, in this case). -- The opportunity to contribute to a community-driven, open-source project. -- The chance to learn from and collaborate with a global network of highly skilled developers. -- An incentivization structure that rewards contributions (more on this later). - -## Step 2: Developer Acquisition -With the initial value proposition in place, we can move on to the actual acquisition of developers. This could be accomplished through: - -- Active recruitment from online developer communities. -- Referral programs that incentivize current contributors to bring in new developers. -- Partnerships with universities, boot camps, and other institutions to attract budding developers. - -## Step 3: Collaboration and Learning -Once developers join our ecosystem, they become part of a collaborative community where they can learn from each other, improve their skills, and work on exciting and meaningful projects. This, in turn, attracts more developers, adding momentum to the flywheel. - -## Step 4: Recognizing and Rewarding Contributions -To keep the flywheel spinning, it's crucial to recognize and reward the contributions made by developers. This can be done in various ways: - -- Monetary rewards: Developers can be paid based on the value their contributions bring to the project. This could be determined through various metrics, such as the complexity of their contributions, the impact on the project, or the amount of their code that gets used in production. - -- Reputation and recognition: The open-source nature of our project means that all contributions are public and can be used by developers to build their professional profiles. Contributors could also be highlighted on our website, in our communications, and at community events. - -- Career advancement: Developers who consistently make valuable contributions could be offered positions of leadership within the project, such as becoming maintainers or joining a steering committee. - -- Agora Tokens: We could create a system of tokens that are earned based on contributions. These tokens could be exchanged for various benefits, such as access to exclusive events, special training, or even physical goods. - -## Step 5: Scaling the Flywheel -With the flywheel in motion, the next step is to scale. As our community grows and our technology improves, we can attract more developers and create more value. This leads to a virtuous cycle of growth, where each new developer adds to the attractiveness of our project, which in turn brings in more developers. - -In essence, this flywheel approach is about creating a community where everyone benefits from each other's contributions. The more value a developer adds, the more they are rewarded. The more developers contribute, the more value is created, attracting even more developers. - -Such a model not only aligns with our values of openness, collaboration, and shared success, but it also gives us a sustainable and scalable method for growing our developer community. It makes Agora not just a place to work, but also a place to learn, grow, and be recognized for one's contributions. This is a powerful way to ensure that we can continue to advance our technology and make a significant impact on the world. - - -# Risks and mitigations - -The open source engineering freelancer model brings with it its own set of potential risks and challenges. Here's an exploration of some of these, along with strategies for mitigation: - -**1. Quality Control:** When dealing with a wide network of freelance contributors, ensuring a consistent standard of quality across all contributions can be challenging. This can be mitigated by implementing rigorous review processes and standards, establishing an automated testing infrastructure, and fostering a culture of quality among contributors. Providing clear contribution guidelines, code style guides, and other resources can help freelancers understand what's expected of them. Providing Educational resources such as sponsoring creators like Yannic, and even making our own courses and then building techno-monasteries where young people can come in and research for free. - -**2. Security Risks:** Open-source projects can be susceptible to malicious contributors, who might introduce vulnerabilities into the codebase. To mitigate this, rigorous code review processes should be in place. Additionally, adopting a "trust but verify" approach, leveraging automated security scanning tools, and conducting periodic security audits can be beneficial. - -**3. Intellectual Property Issues:** Open-source projects can face risks around intellectual property, such as contributors introducing code that infringes on someone else's copyrights. A clear Contributor License Agreement (CLA) should be in place, which contributors need to agree to before their contributions can be accepted. This helps protect the project and its users from potential legal issues. - -**4. Loss of Core Focus:** With numerous contributors focusing on different aspects of the project, there can be a risk of losing sight of the project's core objectives. Maintaining a clear roadmap, having a strong leadership team, and ensuring open and regular communication can help keep the project focused. - -**5. Contributor Burnout:** Freelancers contributing in their free time might face burnout, especially if they feel their contributions aren't being recognized or rewarded. To mitigate this, create a supportive environment where contributors' efforts are acknowledged and rewarded. This might include monetary rewards, but can also include non-monetary rewards like public recognition, advancement opportunities within the project, and so on. - -**6. Fragmentation:** In open source projects, there is a risk of fragmentation where different contributors or groups of contributors might want to take the project in different directions. Strong project governance, a clear roadmap, and open, transparent decision-making processes can help mitigate this risk. - -**7. Dependency on Key Individuals:** If key parts of the project are understood and maintained by only a single contributor, there is a risk if that individual decides to leave or is unable to contribute for some reason. This can be mitigated by ensuring knowledge is shared and responsibilities are spread among multiple contributors. - -Overall, these risks can be managed with proper planning, clear communication, and the implementation of good governance and security practices. It's essential to approach the open source model with a clear understanding of these potential pitfalls and a plan to address them. - -## Plan to Gain Open Source Developers for SWARMS - -Attracting and retaining open-source developers is a challenge that requires a strategic approach. This plan emphasizes delivering value to the developers as well as providing recognition, community, and financial incentives. - -### Step 1: Foster an Engaging and Inclusive Community - -The first step is to foster an engaging and inclusive open-source community around SWARMS. This community should be a place where developers feel welcome and excited to contribute. Regular community events (both online and offline), engaging content, and a supportive environment can help attract and retain developers. - -### Step 2: Provide Clear Contribution Guidelines - -Providing clear and comprehensive contribution guidelines will make it easier for developers to get started. These guidelines should cover the basics of how to set up the development environment, how to submit changes, and how the code review process works. - -### Step 3: Offer Educational Resources and Training - -Providing training and educational resources can help developers grow their skills and contribute more effectively. These resources could include tutorials, webinars, workshops, documentation, and more. - -### Step 4: Establish a Recognition and Reward System - -Recognize and reward the contributions of developers. This could involve public recognition, like featuring contributors on the SWARMS website, as well as financial incentives. Implementing a system where developers earn a share of the revenue from SWARMS based on their contributions can be a strong motivator. - -### Step 5: Implement a Strong Support System - -Offer strong technical support to developers. This could include dedicated channels for developers to ask questions, request feedback, and share their progress. Having core team members available to provide assistance and mentorship can be hugely beneficial. - -### Step 6: Regularly Solicit and Incorporate Feedback - -Regularly ask for feedback from developers and incorporate their suggestions into future developments. This shows developers that their opinions are valued and can lead to improvements in SWARMS. - -## Flywheel for Gaining More Open Source Developers - -Now let's look at the flywheel effect that can result from this plan. The idea of the flywheel is that each part of the process feeds into the next, creating a cycle of growth that becomes self-sustaining over time. - -1. We build an engaging and supportive community around SWARMS. -2. This community attracts more developers who are interested in contributing to SWARMS. -3. As more developers contribute, the quality and scope of SWARMS improve, making it more attractive to potential users. -4. As SWARMS gains more users, the potential revenue from SWARMS increases, allowing for larger rewards to be distributed to developers. -5. The prospect of these rewards attracts even more developers to the SWARMS community. -6. The cycle repeats, with each iteration attracting more developers, improving SWARMS, increasing its user base, and raising potential rewards. - -Through this plan and the resulting flywheel effect, we can attract a strong, committed team of open-source developers to build SWARMS and make it the best it can be. \ No newline at end of file diff --git a/docs/old-docs/corp/FLYWHEEL.md b/docs/old-docs/corp/FLYWHEEL.md deleted file mode 100644 index ac8851be0..000000000 --- a/docs/old-docs/corp/FLYWHEEL.md +++ /dev/null @@ -1,101 +0,0 @@ -# The Swarms Flywheel - -1. **Building a Supportive Community:** Initiate by establishing an engaging and inclusive open-source community for both developers and sales freelancers around Swarms. Regular online meetups, webinars, tutorials, and sales training can make them feel welcome and encourage contributions and sales efforts. - -2. **Increased Contributions and Sales Efforts:** The more engaged the community, the more developers will contribute to Swarms and the more effort sales freelancers will put into selling Swarms. - -3. **Improvement in Quality and Market Reach:** More developer contributions mean better quality, reliability, and feature offerings from Swarms. Simultaneously, increased sales efforts from freelancers boost Swarms' market penetration and visibility. - -4. **Rise in User Base:** As Swarms becomes more robust and more well-known, the user base grows, driving more revenue. - -5. **Greater Financial Incentives:** Increased revenue can be redirected to offer more significant financial incentives to both developers and salespeople. Developers can be incentivized based on their contribution to Swarms, and salespeople can be rewarded with higher commissions. - -6. **Attract More Developers and Salespeople:** These financial incentives, coupled with the recognition and experience from participating in a successful project, attract more developers and salespeople to the community. - -7. **Wider Adoption of Swarms:** An ever-improving product, a growing user base, and an increasing number of passionate salespeople accelerate the adoption of Swarms. - -8. **Return to Step 1:** As the community, user base, and sales network continue to grow, the cycle repeats, each time speeding up the flywheel. - - -```markdown - +---------------------+ - | Building a | - | Supportive | <--+ - | Community | | - +--------+-----------+ | - | | - v | - +--------+-----------+ | - | Increased | | - | Contributions & | | - | Sales Efforts | | - +--------+-----------+ | - | | - v | - +--------+-----------+ | - | Improvement in | | - | Quality & Market | | - | Reach | | - +--------+-----------+ | - | | - v | - +--------+-----------+ | - | Rise in User | | - | Base | | - +--------+-----------+ | - | | - v | - +--------+-----------+ | - | Greater Financial | | - | Incentives | | - +--------+-----------+ | - | | - v | - +--------+-----------+ | - | Attract More | | - | Developers & | | - | Salespeople | | - +--------+-----------+ | - | | - v | - +--------+-----------+ | - | Wider Adoption of | | - | Swarms |----+ - +---------------------+ -``` - - -# Potential Risks and Mitigations: - -1. **Insufficient Contributions or Quality of Work**: Open-source efforts rely on individuals being willing and able to spend time contributing. If not enough people participate, or the work they produce is of poor quality, the product development could stall. - * **Mitigation**: Create a robust community with clear guidelines, support, and resources. Provide incentives for quality contributions, such as a reputation system, swag, or financial rewards. Conduct thorough code reviews to ensure the quality of contributions. - -2. **Lack of Sales Results**: Commission-based salespeople will only continue to sell the product if they're successful. If they aren't making enough sales, they may lose motivation and cease their efforts. - * **Mitigation**: Provide adequate sales training and resources. Ensure the product-market fit is strong, and adjust messaging or sales tactics as necessary. Consider implementing a minimum commission or base pay to reduce risk for salespeople. - -3. **Poor User Experience or User Adoption**: If users don't find the product useful or easy to use, they won't adopt it, and the user base won't grow. This could also discourage salespeople and contributors. - * **Mitigation**: Prioritize user experience in the product development process. Regularly gather and incorporate user feedback. Ensure robust user support is in place. - -4. **Inadequate Financial Incentives**: If the financial rewards don't justify the time and effort contributors and salespeople are putting in, they will likely disengage. - * **Mitigation**: Regularly review and adjust financial incentives as needed. Ensure that the method for calculating and distributing rewards is transparent and fair. - -5. **Security and Compliance Risks**: As the user base grows and the software becomes more complex, the risk of security issues increases. Moreover, as contributors from various regions join, compliance with various international laws could become an issue. - * **Mitigation**: Establish strong security practices from the start. Regularly conduct security audits. Seek legal counsel to understand and adhere to international laws and regulations. - -## Activation Plan for the Flywheel: - -1. **Community Building**: Begin by fostering a supportive community around Swarms. Encourage early adopters to contribute and provide feedback. Create comprehensive documentation, community guidelines, and a forum for discussion and support. - -2. **Sales and Development Training**: Provide resources and training for salespeople and developers. Make sure they understand the product, its value, and how to effectively contribute or sell. - -3. **Increase Contributions and Sales Efforts**: Encourage increased participation by highlighting successful contributions and sales, rewarding top contributors and salespeople, and regularly communicating about the project's progress and impact. - -4. **Iterate and Improve**: Continually gather and implement feedback to improve Swarms and its market reach. The better the product and its alignment with the market, the more the user base will grow. - -5. **Expand User Base**: As the product improves and sales efforts continue, the user base should grow. Ensure you have the infrastructure to support this growth and maintain a positive user experience. - -6. **Increase Financial Incentives**: As the user base and product grow, so too should the financial incentives. Make sure rewards continue to be competitive and attractive. - -7. **Attract More Contributors and Salespeople**: As the financial incentives and success of the product increase, this should attract more contributors and salespeople, further feeding the flywheel. - -Throughout this process, it's important to regularly reassess and adjust your strategy as necessary. Stay flexible and responsive to changes in the market, user feedback, and the evolving needs of the community. \ No newline at end of file diff --git a/docs/old-docs/corp/MANIFESTO.md b/docs/old-docs/corp/MANIFESTO.md deleted file mode 100644 index b9c79c742..000000000 --- a/docs/old-docs/corp/MANIFESTO.md +++ /dev/null @@ -1,38 +0,0 @@ -Today, we stand at the verge of a revolution in artificial intelligence and machine learning. Individual models have accomplished incredible feats, achieving unprecedented levels of understanding and generating incredibly human-like text. But this is just the beginning. - -In the future, we should expect more. These models, which we've seen perform so admirably in isolation, should be able to work together, as a team, a swarm. However, this kind of collaborative intelligence doesn't exist today. That's because the technology to seamlessly integrate these models and foster true inter-model collaboration has been missing, until now. - -In attempting to create this swarm, we face numerous challenges, such as developing the necessary infrastructure, ensuring seamless integration between the agents, and overcoming the practical limitations of our current computing capabilities. These are daunting tasks, and many have shied away from them because of the sheer complexity of the problem. But, if we can overcome these challenges, the rewards will be unimaginable, all digital activities will be automated. - -We envision a future where swarms of Language Learning Model (LLM) agents revolutionize fields like customer support, content creation, and research. Imagine an AI system that could work cohesively, understand complex problems, and deliver multi-faceted solutions. We estimate this could lead to a 100-fold improvement in AI effectiveness, and up to a trillion-dollar impact on the global economy. - -The secret to achieving this lies in our open-source approach and the power of the collective. By embracing open-source, we are enabling hundreds of thousands of minds worldwide to contribute to this vision, each bringing unique insights and solutions. Our bug bounty program and automated testing environments will act as catalysts, motivating and rewarding contributors while ensuring the robustness and reliability of our technology. - -At Agora, we believe in the transformative potential of this technology, and we are committed to making it a reality. Our world-class team of researchers, engineers, and AI enthusiasts are singularly focused on this mission. With a proven track record of success, and the tenacity to tackle the most complex problems, we are best positioned to lead this charge. - -We invite you to join us on this exciting journey. Let's come together to create swarms, advance humanity, and redefine what is possible with artificial intelligence. Our future is in our hands. Let's shape it together. - - -#2 -Swarms is a fluid, seamless, and reliable framework for scaling up LLM autonomous agent interactions to automate digital tasks. - -Like a chorus harmonizing to create a more beautiful melody, Swarms transforms isolated AI models into a cooperative network that can achieve feats beyond the capacity of any single model. - -Our product is not merely an abstract idea or a dream for the future - it's a reality, right here, right now. Swarms is an accessible, easy-to-use platform. All it takes is a simple 'pip install swarms' command, or a 'git clone' from our GitHub repository, and the swarming power of AI is at your fingertips. - -The fundamental functionality of Swarms is simple: it facilitates dynamic interaction and cooperation among AI models. Users set an objective, and the swarm of AI agents collectively process the task, pooling their strengths to provide a more refined, intelligent output. - -With Swarms, you're not just using a tool, you're unlocking the next level of AI. You're interacting with a cooperative entity that can tackle complex problems, refine outputs, and ultimately, revolutionize the way we utilize AI. - -Our vision is to see Swarms employed across various domains, from customer support to content creation, and research to robotics, expanding the possibilities of what AI can achieve. This isn't just an improvement of existing systems, but a groundbreaking leap forward in AI capability. It's about breaking down the silos, fostering collaboration, and elevating collective intelligence. - - -At the heart of our product, Swarms, is the principle of cooperative intelligence. Swarms is an AI-based technology that enables multiple autonomous agents, or "worker bees," to coordinate, collaborate, and generate solutions that no single agent could achieve on its own. Think of it as a digital hive mind that decomposes a large objective into manageable subtasks, distributes these tasks amongst the autonomous agents, and then assembles the results into a coherent whole. - -In action, the process is fluid, elegant, and surprisingly human-like. An objective is presented to the Swarm - this could be anything from conducting web-based research to producing a report or analyzing a complex dataset. The Swarm, with its innate ability to decompose tasks, breaks the objective down into bite-sized components. Each of these components is then dispatched to a worker agent, equipped with the tools and capabilities to tackle it. - -These agents are not mere receivers of instructions. They are sophisticated, multimodal, AI entities capable of browsing the web, ingesting and understanding data, interacting with digital interfaces, and even spawning additional worker agents when necessary. These agents carry out their assigned tasks autonomously, converging their efforts towards the overall objective. - -In practical terms, Swarms is as versatile as it is powerful. For a business seeking to automate its customer support system, Swarms could manage incoming queries, distribute them amongst the worker agents, and generate appropriate responses based on the customer's needs. In a research context, Swarms could ingest large volumes of data, identify key areas of interest, and provide comprehensive analyses, all without human intervention. - -What sets Swarms apart is its ability to harness the power of collective intelligence, the same principle that allows a flock of birds to move in unison or a colony of ants to construct complex structures. By enabling AI agents to cooperate in this way, Swarms isn't just pushing the boundaries of what AI can do – it's redefining them. And it all starts with a simple 'pip install swarms' or 'git clone' from our GitHub repository. Welcome to the age of cooperative AI. diff --git a/docs/old-docs/corp/MISSION.md b/docs/old-docs/corp/MISSION.md deleted file mode 100644 index c287a0b5d..000000000 --- a/docs/old-docs/corp/MISSION.md +++ /dev/null @@ -1,149 +0,0 @@ -# Bounty Program - -Our bounty program is an exciting opportunity for contributors to help us build the future of Swarms. By participating, you can earn rewards while contributing to a project that aims to revolutionize digital activity. - -Here's how it works: - -1. **Check out our Roadmap**: We've shared our roadmap detailing our short and long-term goals. These are the areas where we're seeking contributions. - -2. **Pick a Task**: Choose a task from the roadmap that aligns with your skills and interests. If you're unsure, you can reach out to our team for guidance. - -3. **Get to Work**: Once you've chosen a task, start working on it. Remember, quality is key. We're looking for contributions that truly make a difference. - -4. **Submit your Contribution**: Once your work is complete, submit it for review. We'll evaluate your contribution based on its quality, relevance, and the value it brings to Swarms. - -5. **Earn Rewards**: If your contribution is approved, you'll earn a bounty. The amount of the bounty depends on the complexity of the task, the quality of your work, and the value it brings to Swarms. - -## The Three Phases of Our Bounty Program - -### Phase 1: Building the Foundation -In the first phase, our focus is on building the basic infrastructure of Swarms. This includes developing key components like the Swarms class, integrating essential tools, and establishing task completion and evaluation logic. We'll also start developing our testing and evaluation framework during this phase. If you're interested in foundational work and have a knack for building robust, scalable systems, this phase is for you. - -### Phase 2: Enhancing the System -In the second phase, we'll focus on enhancing Swarms by integrating more advanced features, improving the system's efficiency, and refining our testing and evaluation framework. This phase involves more complex tasks, so if you enjoy tackling challenging problems and contributing to the development of innovative features, this is the phase for you. - -### Phase 3: Towards Super-Intelligence -The third phase of our bounty program is the most exciting - this is where we aim to achieve super-intelligence. In this phase, we'll be working on improving the swarm's capabilities, expanding its skills, and fine-tuning the system based on real-world testing and feedback. If you're excited about the future of AI and want to contribute to a project that could potentially transform the digital world, this is the phase for you. - -Remember, our roadmap is a guide, and we encourage you to bring your own ideas and creativity to the table. We believe that every contribution, no matter how small, can make a difference. So join us on this exciting journey and help us create the future of Swarms. - -**To participate in our bounty program, visit the [Swarms Bounty Program Page](https://swarms.ai/bounty).** Let's build the future together! - - - - - -## Bounties for Roadmap Items - -To accelerate the development of Swarms and to encourage more contributors to join our journey towards automating every digital activity in existence, we are announcing a Bounty Program for specific roadmap items. Each bounty will be rewarded based on the complexity and importance of the task. Below are the items available for bounty: - -1. **Multi-Agent Debate Integration**: $2000 -2. **Meta Prompting Integration**: $1500 -3. **Swarms Class**: $1500 -4. **Integration of Additional Tools**: $1000 -5. **Task Completion and Evaluation Logic**: $2000 -6. **Ocean Integration**: $2500 -7. **Improved Communication**: $2000 -8. **Testing and Evaluation**: $1500 -9. **Worker Swarm Class**: $2000 -10. **Documentation**: $500 - -For each bounty task, there will be a strict evaluation process to ensure the quality of the contribution. This process includes a thorough review of the code and extensive testing to ensure it meets our standards. - -# 3-Phase Testing Framework - -To ensure the quality and efficiency of the Swarm, we will introduce a 3-phase testing framework which will also serve as our evaluation criteria for each of the bounty tasks. - -## Phase 1: Unit Testing -In this phase, individual modules will be tested to ensure that they work correctly in isolation. Unit tests will be designed for all functions and methods, with an emphasis on edge cases. - -## Phase 2: Integration Testing -After passing unit tests, we will test the integration of different modules to ensure they work correctly together. This phase will also test the interoperability of the Swarm with external systems and libraries. - -## Phase 3: Benchmarking & Stress Testing -In the final phase, we will perform benchmarking and stress tests. We'll push the limits of the Swarm under extreme conditions to ensure it performs well in real-world scenarios. This phase will measure the performance, speed, and scalability of the Swarm under high load conditions. - -By following this 3-phase testing framework, we aim to develop a reliable, high-performing, and scalable Swarm that can automate all digital activities. - -# Reverse Engineering to Reach Phase 3 - -To reach the Phase 3 level, we need to reverse engineer the tasks we need to complete. Here's an example of what this might look like: - -1. **Set Clear Expectations**: Define what success looks like for each task. Be clear about the outputs and outcomes we expect. This will guide our testing and development efforts. - -2. **Develop Testing Scenarios**: Create a comprehensive list of testing scenarios that cover both common and edge cases. This will help us ensure that our Swarm can handle a wide range of situations. - -3. **Write Test Cases**: For each scenario, write detailed test cases that outline the exact steps to be followed, the inputs to be used, and the expected outputs. - -4. **Execute the Tests**: Run the test cases on our Swarm, making note of any issues or bugs that arise. - -5. **Iterate and Improve**: Based on the results of our tests, iterate and improve our Swarm. This may involve fixing bugs, optimizing code, or redesigning parts of our system. - -6. **Repeat**: Repeat this process until our Swarm meets our expectations and passes all test cases. - -By following these steps, we will systematically build, test, and improve our Swarm until it reaches the Phase 3 level. This methodical approach will help us ensure that we create a reliable, high-performing, and scalable Swarm that can truly automate all digital activities. - -Let's shape the future of digital automation together! - - --------------------- -# Super-Intelligence Roadmap - -Creating a Super-Intelligent Swarm involves three main phases, where each phase has multiple sub-stages, each of which will require rigorous testing and evaluation to ensure progress towards super-intelligence. - -## Phase 1: Narrow Intelligence - -In this phase, the goal is to achieve high performance in specific tasks. These tasks will be predefined and the swarm will be trained and tested on these tasks. - -1. **Single Task Mastery**: Focus on mastering one task at a time. This can range from simple tasks like image recognition to complex tasks like natural language processing. - -2. **Task Switching**: Train the swarm to switch between different tasks effectively. This includes being able to stop one task and start another one without any loss in performance. - -3. **Multi-tasking**: The swarm should be capable of performing multiple tasks simultaneously without any degradation in performance. - -## Phase 2: General Intelligence - -In this phase, the swarm will be trained to handle a variety of tasks that were not part of the original training set. - -1. **Transfer Learning**: The swarm should be able to transfer knowledge learned in one context to another context. This means being able to apply knowledge learned in one task to a different but related task. - -2. **Adaptive Learning**: The swarm should be capable of adapting its learning strategies based on the task at hand. This includes being able to adjust its learning rate, exploration vs exploitation balance, etc. - -3. **Self-Learning**: The swarm should be able to learn new tasks on its own without any external guidance. This includes being able to understand the task requirements, find relevant information, learn the task, and evaluate its performance. - -## Phase 3: Super Intelligence - -In this phase, the swarm will surpass human-level performance in most economically valuable work. This involves the swarm being able to solve complex real-world problems, make accurate predictions, and generate innovative solutions. - -1. **Complex Problem Solving**: The swarm should be able to solve complex real-world problems. This includes being able to understand the problem, identify relevant information, generate solutions, evaluate the solutions, and implement the best solution. - -2. **Predictive Abilities**: The swarm should be able to make accurate predictions about future events based on past data. This includes being able to understand the data, identify relevant patterns, make accurate predictions, and evaluate the accuracy of its predictions. - -3. **Innovation**: The swarm should be able to generate innovative solutions to problems. This includes being able to think creatively, generate novel ideas, evaluate the ideas, and implement the best idea. - -4. **Self-improvement**: The swarm should be capable of improving its own capabilities. This includes being able to identify areas of weakness, find ways to improve, and implement the improvements. - -5. **Understanding**: The swarm should be able to understand complex concepts, make inferences, and draw conclusions. This includes being able to understand natural language, reason logically, and make sound judgments. - -Each of these stages will require extensive testing and evaluation to ensure progress towards super-intelligence. - -# Reverse-Engineering Super-Intelligence - -To reach the Phase 3 level of super-intelligence, we need to reverse engineer the tasks that need to be completed. Here's an outline of what this might look like: - -1. **Setting Success Metrics**: For each stage, define clear success metrics. These metrics should be quantitative and measurable, and they should align with the objectives of the stage. - -2. **Identifying Prerequisites**: Determine what needs to be in place before each stage can begin. This could include certain capabilities, resources, or technologies. - -3. **Developing Training Programs**: For each stage, develop a comprehensive training program. This should include a variety of tasks that will challenge the swarm and push it to - - develop the necessary capabilities. - -4. **Creating Testing Protocols**: Develop rigorous testing protocols for each stage. These protocols should test all aspects of the swarm's performance and they should be designed to push the swarm to its limits. - -5. **Iterating and Improving**: Based on the results of the tests, iterate and improve the swarm. This could involve adjusting the training program, modifying the swarm's architecture, or tweaking its learning algorithms. - -6. **Moving to the Next Stage**: Once the swarm has met the success metrics for a stage, it can move on to the next stage. This process continues until the swarm has reached the level of super-intelligence. - -This process will require a significant amount of time, resources, and effort. However, by following this structured approach, we can systematically guide the swarm towards super-intelligence. - diff --git a/docs/old-docs/corp/MONETIZATION.md b/docs/old-docs/corp/MONETIZATION.md deleted file mode 100644 index a44eb966d..000000000 --- a/docs/old-docs/corp/MONETIZATION.md +++ /dev/null @@ -1,165 +0,0 @@ -# Swarms Monetization Strategy - -This strategy includes a variety of business models, potential revenue streams, cashflow structures, and customer identification methods. Let's explore these further. - -## Business Models - -1. **Platform as a Service (PaaS):** Provide the Swarms AI platform on a subscription basis, charged monthly or annually. This could be tiered based on usage and access to premium features. - -2. **API Usage-based Pricing:** Charge customers based on their usage of the Swarms API. The more requests made, the higher the fee. - -3. **Managed Services:** Offer complete end-to-end solutions where you manage the entire AI infrastructure for the clients. This could be on a contract basis with a recurring fee. - -4. **Training and Certification:** Provide Swarms AI training and certification programs for interested developers and businesses. These could be monetized as separate courses or subscription-based access. - -5. **Partnerships:** Collaborate with large enterprises and offer them dedicated Swarm AI services. These could be performance-based contracts, ensuring a mutually beneficial relationship. - -6. **Data as a Service (DaaS):** Leverage the data generated by Swarms for insights and analytics, providing valuable business intelligence to clients. - -## Potential Revenue Streams - -1. **Subscription Fees:** This would be the main revenue stream from providing the Swarms platform as a service. - -2. **Usage Fees:** Additional revenue can come from usage fees for businesses that have high demand for Swarms API. - -3. **Contract Fees:** From offering managed services and bespoke solutions to businesses. - -4. **Training Fees:** Revenue from providing training and certification programs to developers and businesses. - -5. **Partnership Contracts:** Large-scale projects with enterprises, involving dedicated Swarm AI services, could provide substantial income. - -6. **Data Insights:** Revenue from selling valuable business intelligence derived from Swarm's aggregated and anonymized data. - -## Potential Customers - -1. **Businesses Across Sectors:** Any business seeking to leverage AI for automation, efficiency, and data insights could be a potential customer. This includes sectors like finance, eCommerce, logistics, healthcare, and more. - -2. **Developers:** Both freelance and those working in organizations could use Swarms to enhance their projects and services. - -3. **Enterprises:** Large enterprises looking to automate and optimize their operations could greatly benefit from Swarms. - -4. **Educational Institutions:** Universities and research institutions could leverage Swarms for research and teaching purposes. - -## Roadmap - -1. **Landing Page Creation:** Develop a dedicated product page on apac.ai for Swarms. - -2. **Hosted Swarms API:** Launch a cloud-based Swarms API service. It should be highly reliable, with robust documentation to attract daily users. - -3. **Consumer and Enterprise Subscription Service:** Launch a comprehensive subscription service on The Domain. This would provide users with access to a wide array of APIs and data streams. - -4. **Dedicated Capacity Deals:** Partner with large enterprises to offer them dedicated Swarm AI solutions for automating their operations. - -5. **Enterprise Partnerships:** Develop partnerships with large enterprises for extensive contract-based projects. - -6. **Integration with Collaboration Platforms:** Develop Swarms bots for platforms like Discord and Slack, charging users a subscription fee for access. - -7. **Personal Data Instances:** Offer users dedicated instances of all their data that the Swarm can query as needed. - -8. **Browser Extension:** Develop a browser extension that integrates with the Swarms platform, offering users a more seamless experience. - -Remember, customer satisfaction and a value-centric approach are at the core of any successful monetization strategy. It's essential to continuously iterate and improve the product based on customer feedback and evolving market needs. - - - - - - - - - - - - - - - -1. **Platform as a Service (PaaS):** Create a cloud-based platform that allows users to build, run, and manage applications without the complexity of maintaining the infrastructure. You could charge users a subscription fee for access to the platform and provide different pricing tiers based on usage levels. This could be an attractive solution for businesses that do not have the capacity to build or maintain their own swarm intelligence solutions. - -2. **Professional Services:** Offer consultancy and implementation services to businesses looking to utilize the Swarm technology. This could include assisting with integration into existing systems, offering custom development services, or helping customers to build specific solutions using the framework. - -3. **Education and Training:** Create a certification program for developers or companies looking to become proficient with the Swarms framework. This could be sold as standalone courses, or bundled with other services. - -4. **Managed Services:** Some companies may prefer to outsource the management of their Swarm-based systems. A managed services solution could take care of all the technical aspects, from hosting the solution to ensuring it runs smoothly, allowing the customer to focus on their core business. - -5. **Data Analysis and Insights:** Swarm intelligence can generate valuable data and insights. By anonymizing and aggregating this data, you could provide industry reports, trend analysis, and other valuable insights to businesses. - -As for the type of platform, Swarms can be offered as a cloud-based solution given its scalability and flexibility. This would also allow you to apply a SaaS/PaaS type monetization model, which provides recurring revenue. - -Potential customers could range from small to large enterprises in various sectors such as logistics, eCommerce, finance, and technology, who are interested in leveraging artificial intelligence and machine learning for complex problem solving, optimization, and decision-making. - -**Product Brief Monetization Strategy:** - -Product Name: Swarms.AI Platform - -Product Description: A cloud-based AI and ML platform harnessing the power of swarm intelligence. - -1. **Platform as a Service (PaaS):** Offer tiered subscription plans (Basic, Premium, Enterprise) to accommodate different usage levels and business sizes. - -2. **Professional Services:** Offer consultancy and custom development services to tailor the Swarms solution to the specific needs of the business. - -3. **Education and Training:** Launch an online Swarms.AI Academy with courses and certifications for developers and businesses. - -4. **Managed Services:** Provide a premium, fully-managed service offering that includes hosting, maintenance, and 24/7 support. - -5. **Data Analysis and Insights:** Offer industry reports and customized insights generated from aggregated and anonymized Swarm data. - -Potential Customers: Enterprises in sectors such as logistics, eCommerce, finance, and technology. This can be sold globally, provided there's an internet connection. - -Marketing Channels: Online marketing (SEO, Content Marketing, Social Media), Partnerships with tech companies, Direct Sales to Enterprises. - -This strategy is designed to provide multiple revenue streams, while ensuring the Swarms.AI platform is accessible and useful to a range of potential customers. - -1. **AI Solution as a Service:** By offering the Swarms framework as a service, businesses can access and utilize the power of multiple LLM agents without the need to maintain the infrastructure themselves. Subscription can be tiered based on usage and additional features. - -2. **Integration and Custom Development:** Offer integration services to businesses wanting to incorporate the Swarms framework into their existing systems. Also, you could provide custom development for businesses with specific needs not met by the standard framework. - -3. **Training and Certification:** Develop an educational platform offering courses, webinars, and certifications on using the Swarms framework. This can serve both developers seeking to broaden their skills and businesses aiming to train their in-house teams. - -4. **Managed Swarms Solutions:** For businesses that prefer to outsource their AI needs, provide a complete solution which includes the development, maintenance, and continuous improvement of swarms-based applications. - -5. **Data Analytics Services:** Leveraging the aggregated insights from the AI swarms, you could offer data analytics services. Businesses can use these insights to make informed decisions and predictions. - -**Type of Platform:** - -Cloud-based platform or Software as a Service (SaaS) will be a suitable model. It offers accessibility, scalability, and ease of updates. - -**Target Customers:** - -The technology can be beneficial for businesses across sectors like eCommerce, technology, logistics, finance, healthcare, and education, among others. - -**Product Brief Monetization Strategy:** - -Product Name: Swarms.AI - -1. **AI Solution as a Service:** Offer different tiered subscriptions (Standard, Premium, and Enterprise) each with varying levels of usage and features. - -2. **Integration and Custom Development:** Offer custom development and integration services, priced based on the scope and complexity of the project. - -3. **Training and Certification:** Launch the Swarms.AI Academy with courses and certifications, available for a fee. - -4. **Managed Swarms Solutions:** Offer fully managed solutions tailored to business needs, priced based on scope and service level agreements. - -5. **Data Analytics Services:** Provide insightful reports and data analyses, which can be purchased on a one-off basis or through a subscription. - -By offering a variety of services and payment models, Swarms.AI will be able to cater to a diverse range of business needs, from small start-ups to large enterprises. Marketing channels would include digital marketing, partnerships with technology companies, presence in tech events, and direct sales to targeted industries. - - - -# Roadmap - -* Create a landing page for swarms apac.ai/product/swarms - -* Create Hosted Swarms API for anybody to just use without need for mega gpu infra, charge usage based pricing. Prerequisites for success => Swarms has to be extremely reliable + we need world class documentation and many daily users => how do we get many daily users? We provide a seamless and fluid experience, how do we create a seamless and fluid experience? We write good code that is modular, provides feedback to the user in times of distress, and ultimately accomplishes the user's tasks. - -* Hosted consumer and enterprise subscription as a service on The Domain, where users can interact with 1000s of APIs and ingest 1000s of different data streams. - -* Hosted dedicated capacity deals with mega enterprises on automating many operations with Swarms for monthly subscription 300,000+$ - -* Partnerships with enterprises, massive contracts with performance based fee - -* Have discord bot and or slack bot with users personal data, charge subscription + browser extension - -* each user gets a dedicated ocean instance of all their data so the swarm can query it as needed. - -* \ No newline at end of file diff --git a/docs/old-docs/corp/PITCH.md b/docs/old-docs/corp/PITCH.md deleted file mode 100644 index 14381b501..000000000 --- a/docs/old-docs/corp/PITCH.md +++ /dev/null @@ -1,14 +0,0 @@ - -## Purpose -Artificial Intelligence has grown at an exponential rate over the past decade. Yet, we are far from fully harnessing its potential. Today's AI operates in isolation, each working separately in their corner. But life doesn't work like that. The world doesn't work like that. Success isn't built in silos; it's built in teams. - -Imagine a world where AI models work in unison. Where they can collaborate, interact, and pool their collective intelligence to achieve more than any single model could. This is the future we envision. But today, we lack a framework for AI to collaborate effectively, to form a true swarm of intelligent agents. - - -This is a difficult problem, one that has eluded solution. It requires sophisticated systems that can allow individual models to not just communicate but also understand each other, pool knowledge and resources, and create collective intelligence. This is the next frontier of AI. - -But here at Swarms, we have a secret sauce. It's not just a technology or a breakthrough invention. It's a way of thinking - the philosophy of rapid iteration. With each cycle, we make massive progress. We experiment, we learn, and we grow. We have developed a pioneering framework that can enable AI models to work together as a swarm, combining their strengths to create richer, more powerful outputs. - -We are uniquely positioned to take on this challenge with 1,500+ devoted researchers in Agora. We have assembled a team of world-class experts, experienced and driven, united by a shared vision. Our commitment to breaking barriers, pushing boundaries, and our belief in the power of collective intelligence makes us the best team to usher in this future to fundamentally advance our species, Humanity. - ---- \ No newline at end of file diff --git a/docs/old-docs/corp/ROADMAP.md b/docs/old-docs/corp/ROADMAP.md deleted file mode 100644 index 87a80c6d0..000000000 --- a/docs/old-docs/corp/ROADMAP.md +++ /dev/null @@ -1,115 +0,0 @@ -## The Plan - -### Phase 1: Building the Foundation -In the first phase, our focus is on building the basic infrastructure of Swarms. This includes developing key components like the Swarms class, integrating essential tools, and establishing task completion and evaluation logic. We'll also start developing our testing and evaluation framework during this phase. If you're interested in foundational work and have a knack for building robust, scalable systems, this phase is for you. - -### Phase 2: Optimizing the System -In the second phase, we'll focus on optimizng Swarms by integrating more advanced features, improving the system's efficiency, and refining our testing and evaluation framework. This phase involves more complex tasks, so if you enjoy tackling challenging problems and contributing to the development of innovative features, this is the phase for you. - -### Phase 3: Towards Super-Intelligence -The third phase of our bounty program is the most exciting - this is where we aim to achieve super-intelligence. In this phase, we'll be working on improving the swarm's capabilities, expanding its skills, and fine-tuning the system based on real-world testing and feedback. If you're excited about the future of AI and want to contribute to a project that could potentially transform the digital world, this is the phase for you. - -Remember, our roadmap is a guide, and we encourage you to bring your own ideas and creativity to the table. We believe that every contribution, no matter how small, can make a difference. So join us on this exciting journey and help us create the future of Swarms. - - -## Optimization Priorities - -1. **Reliability**: Increase the reliability of the swarm - obtaining the desired output with a basic and un-detailed input. - -2. **Speed**: Reduce the time it takes for the swarm to accomplish tasks by improving the communication layer, critiquing, and self-alignment with meta prompting. - -3. **Scalability**: Ensure that the system is asynchronous, concurrent, and self-healing to support scalability. - -Our goal is to continuously improve Swarms by following this roadmap, while also being adaptable to new needs and opportunities as they arise. - -# Open Source Roadmap - -Here is the detailed roadmap of our priorities and planned features for the near term: - -## TODO - -* Create a non-langchain worker and swarm class and compare - -* Create extensive documentation - -* Make sure that the boss agent successfully calls the worker agent if when it's finished makinng a plan - -* Make sure the worker agent can access tools like web browser, terminal, and code editor, and multi-modal agents - -* Make sure inputs and outputs from boss to worker are well defined and are collaborating if not then readjust prompt - -* Create a tool that creates other tools with access to write code, debug, and an architectural argent that creates the architecture and then another agent that creates the code[Architecter(with code examples), code generator (with access to writing code and terminalrools)] -- The Compiler? - -* Create a screenshot tool that takes a screen shot and then passes it to a worker multi-modal agent for visual context. - -* API endroute in FASTAPI - -* Develop Conversational UI with Gradio - -* Integrate omni agent as a worker tool - -* Integrate Ocean Database as primary vectorstore - -* Integrate visual agent - -* Integrate quantized hf models as base models with langchain huggingface - -1. **Multi-Agent Debate Integration**: Integrate multi-agent debate frameworks ([Multi Agent debate](https://github.com/Skytliang/Multi-Agents-Debate) and [Multi agent2 debate](https://github.com/composable-models/llm_multiagent_debate)) to improve decision-making. - -2. **Meta Prompting Integration**: Include meta prompting across all worker agents to guide their actions. - -3. **Swarms Class**: Create a main swarms class `swarms('Increase sales by 40$', workers=4)` for managing and coordinating multiple worker nodes. - -4. **Integration of Additional Tools**: Integrate [Jarvis](https://github.com/microsoft/JARVIS) as worker nodes, add text to speech and text to script tools ([whisper x](https://github.com/kyegomez/youtubeURL-to-text)), and integrate Hugging Face agents and other external tools. - -5. **Task Completion and Evaluation Logic**: Include task completion logic with meta prompting, and evaluate task completion on a scale from 0.0 to 1.0. - -7. **Ocean Integration**: Use the [Ocean](https://github.com/kyegomez/Ocean) vector database as the main embedding database for all the agents, both boss and worker. - -8. **Improved Communication**: Develop a universal vector database that is only used when a task is completed in this format `[TASK][COMPLETED]`. - -9. **Testing and Evaluation**: Create unit tests, benchmarks, and evaluations for performance monitoring and continuous improvement. - -10. **Worker Swarm Class**: Create a class for self-scaling worker swarms. If they need help, they can spawn an entirely new worker and more workers if needed. - -## Documentation - -1. **Examples**: Create extensive and useful examples for a variety of use cases. - -2. **README**: Update the README to include the examples and usage instructions. - - -# Mid-Long term -Here are some potential middle-to-long-term improvements to consider for this project: - -1. **Modular Design**: Aim to design a more modular and scalable framework, making it easy for developers to plug-and-play various components. - -2. **Interactive User Interface**: Develop a more interactive, user-friendly GUI that allows users to interact with the system without needing to understand the underlying code. - -3. **Advanced Error Handling**: Implement advanced error handling and debugging capabilities to make it easier for developers to diagnose and fix issues. - -4. **Optimized Resource Utilization**: Improve the efficiency of resource use, aiming to reduce memory consumption and improve speed without sacrificing accuracy. - -5. **Collaborative Learning**: Integrate more sophisticated techniques for collaborative learning among the swarm, allowing them to share knowledge and learn from each other's successes and failures. - -6. **Autonomous Self-Improvement**: Implement mechanisms that allow the swarm to autonomously learn from its past experiences and improve its performance over time. - -7. **Security Enhancements**: Include robust security measures to protect sensitive data and prevent unauthorized access. - -8. **Privacy-Preserving Techniques**: Consider incorporating privacy-preserving techniques such as differential privacy to ensure the confidentiality of user data. - -9. **Support for More Languages**: Expand language support to allow the system to cater to a more global audience. - -10. **Robustness and Resilience**: Improve the system's robustness and resilience, ensuring that it can operate effectively even in the face of hardware or software failures. - -11. **Continual Learning**: Implement continual learning techniques to allow the system to adapt and evolve as new data comes in. - -12. **More Contextual Understanding**: Enhance the system's capability to understand context better, making it more effective in handling real-world, complex tasks. - -13. **Dynamic Task Prioritization**: Develop advanced algorithms for dynamic task prioritization, ensuring that the most important tasks are addressed first. - -14. **Expanding the Swarm's Skills**: Train the swarm on a wider range of tasks, gradually expanding their skill set and problem-solving capabilities. - -15. **Real-World Deployment**: Test and refine the system in real-world settings, learning from these experiences to further improve and adapt the system. - -Remember, these are potential improvements. It's important to revisit your priorities regularly and adjust them based on project needs, feedback, and learning from both successes and failures. diff --git a/docs/old-docs/corp/SALES.md b/docs/old-docs/corp/SALES.md deleted file mode 100644 index 9f09a2cb3..000000000 --- a/docs/old-docs/corp/SALES.md +++ /dev/null @@ -1,295 +0,0 @@ -# Sales Documentation - -## Small Businesses - -Small businesses often lack the resources to hire a dedicated team of data analysts and AI experts. This is where Swarms steps in. With our platform, these businesses can automate many of the tasks that previously required manual effort or expert knowledge. Our strategy for engaging small businesses involves showcasing the simplicity and cost-effectiveness of Swarms. - -### Stage 1: Awareness and Education -* Questions: Have you considered implementing AI solutions? Are you aware of how AI can help your business? -* Commitments: Schedule a demo of Swarms. - -### Stage 2: Engagement and Evaluation -* Questions: Have you identified areas where AI can improve efficiency? How do you currently manage these tasks? -* Commitments: Conduct a trial run of Swarms on a select project. - -### Stage 3: Adoption and Integration -* Questions: Are you satisfied with the results of the trial run? Are you ready to implement Swarms more broadly? -* Commitments: Purchase a subscription and begin the full-scale integration of Swarms. - -## Medium-Sized Enterprises - -Medium-sized enterprises typically have some level of AI integration but often struggle with scalability. Swarms can offer these organizations a path to seamlessly scale their existing AI capabilities. Our strategy for engaging medium-sized enterprises involves demonstrating how Swarms can take their current AI solutions to the next level. - -### Stage 1: Awareness and Potential Evaluation -* Questions: Are you looking to scale your current AI solutions? Are you satisfied with the performance of your current AI tools? -* Commitments: Arrange a personalized demonstration of Swarms. - -### Stage 2: Engagement and Testing -* Questions: Have you identified the specific areas where your AI solutions need scaling? Are you open to piloting Swarms in these areas? -* Commitments: Run a pilot program using Swarms. - -### Stage 3: Adoption and Expansion -* Questions: Did the pilot program meet your expectations? Are you ready to expand the use of Swarms across your organization? -* Commitments: Commit to a long-term partnership and full integration of Swarms. - -## Large Corporations - -Large corporations typically have extensive AI capabilities, but they may struggle with coordination and efficiency. Swarms can help streamline these organizations' AI operations. Our strategy for engaging large corporations involves demonstrating how Swarms can enhance the efficiency of their AI ecosystems. - -### Stage 1: Awareness and Relevance Evaluation -* Questions: Are you experiencing inefficiencies with your existing AI operations? Have you considered solutions to improve coordination among your AI tools? -* Commitments: Organize an executive briefing session about Swarms. - -### Stage 2: Engagement and Trial -* Questions: Can you identify specific use cases for Swarms in your organization? Are you willing to conduct a trial run of Swarms? -* Commitments: Implement a trial run of Swarms for selected use cases. - -### Stage 3: Adoption and Wide-Scale Implementation -* Questions: Was the trial run of Swarms successful? Are you ready to implement Swarms throughout your organization? -* Commitments: Form a strategic alliance and proceed with wide-scale implementation of Swarms. - -Remember, this is more than just a transaction. It's a partnership. And like any good partnership, it's built on trust, communication, and a shared vision. We're excited to embark on this journey with you, and we're committed to supporting you every step of the way. - - - -# SPIN SOP - -This is a detailed customer journey roadmap and Standard Operating Procedure for selling Swarms to businesses of varying sizes. The SPIN selling method (Situation, Problem, Implication, Need-payoff) will be incorporated throughout the document to provide a comprehensive approach. We'll explore a scenario that begins with cold emailing and culminates in offering theoretical consultation package deals. - -**1. Lead Generation and Cold Outreach** - -Our journey begins with identifying potential leads that could benefit from the capabilities of Swarms. This step involves researching potential clients based on their industry, size, digital footprint, and overall potential to benefit from AI automation. - -Upon identifying a potential client, initiate contact with a tailored cold email. This email should: - -- Grab the recipient's attention (Subject line is crucial) -- Introduce Swarms and its potential benefits (unique selling proposition) -- Propose a discovery call or meeting to discuss how Swarms could be beneficial - -An example could be: - -*Subject: Elevate Your Business with the Power of AI Swarm Technology* - -Dear [Recipient's Name], - -I represent Agora, a pioneer in the field of cooperative AI. Our latest innovation, Swarms, harnesses the power of AI to drive efficiency, streamline operations, and ultimately boost profitability. I would love to have a conversation with you to discuss how this cutting-edge technology can specifically help [Their Company Name]. - -Are you available for a quick call next week? - -Best regards, -[Your Name] - -**2. Discovery Call** - -The aim of the discovery call is to learn about the potential client's business and identify their needs using the SPIN selling method: - -*SITUATION* - Get an understanding of the client's current operations, their use of technology, and their overall business landscape. - -*PROBLEM* - Identify any potential areas where the client might be facing challenges - these could be inefficiencies, high operating costs, or unmet customer needs. - -*IMPLICATION* - Discuss the consequences of these problems, such as reduced profitability or customer dissatisfaction. - -*NEED-PAYOFF* - Finally, demonstrate how Swarms can address these issues and the benefits it will bring to their business. - -**3. Follow-Up and Tailored Proposal** - -After gaining a deeper understanding of the client's needs, follow up with a detailed proposal that outlines how Swarms can specifically address their challenges. The proposal should highlight: - -- How Swarms fits into their current operations -- A projection of improvements and potential return on investment -- The steps involved in the implementation process - -**4. Theoretical Consultation Packages** - -Introduce consultation packages at this stage to provide further value and assure the client of continued support during the Swarms integration journey. The packages could include: - -- *Swarms Starter Pack*: Ideal for small businesses. Includes initial setup and integration, basic training, and a month of technical support. -- *Swarms Business Pack*: Suited for medium-sized businesses. Offers advanced setup, employee training, a dedicated support manager, and three months of technical support. -- *Swarms Enterprise Pack*: For large corporations. Includes customized setup and integration, extensive training, a dedicated account manager, and six months of priority technical support. - -**5. Demonstration and Commitment** - -Offer a demonstration to show Swarms in action. This could be a simulated use-case relevant to the client's industry or a walk-through of the platform. - -Post-demonstration, ask for the client's commitment to move to the next step. This could be a meeting with other decision-makers, an agreement to a trial period, or a signed contract. - -**6. Implementation and Onboarding** - -After gaining the client's commitment, the next stage involves the implementation of Swarms in their operations. This will depend on the client's size, the complexity of their operations, and the specifics agreed upon in the proposal. - -**7. Continued Support and Review** - -Continued technical support is essential. Regularly check in with the client, ensure they are getting the most out of Swarms, and address any issues promptly. It's also important to review the impact of Swarms on the client's operations after a set period and adjust the strategy as necessary. - -Selling Swarms is not about pushing a product; it's about offering a solution that can revolutionize businesses. The journey from cold emailing to a fully-fledged partnership should reflect this philosophy at every stage. - - -# Tactics - - -# Value proposition Formula -``` -Dream outcome • Perceived Likelihood -------------------------------------- -Time Delay * Effort & Sacrifice -``` - -Where: - -#### Maximize Value Using Value Equation -❏ Maximize Dream Outcome (solve problem worth solving) - -❏ Maximize Perceived Likelihood of Success (testimonials& proven case studies) - -❏ Minimize Time to Success (How can we make this faster? How can we show progress?) - -❏ Minimize Effort & Sacrifice (How can we make this easier? More Seamless? Convenient?) - -### Swarms Examples - -### Swarms Value Proposition - -"Leap into a new era of productivity with Swarms. Automate up to 50% of your business tasks with the power of cooperative AI, a proven solution trusted by thousands worldwide. With an easy integration process, your dream of seamless automation is just a few steps away." - -Where: - -- The dream outcome is achieving a significant boost in efficiency and productivity by automating 30-50% of your daily business tasks with Swarms. - -- The perceived likelihood of success is backed by our strong track record, with thousands of successful implementations and satisfied customers globally. - -- We've minimized the time delay to success. Swarms provides quick and painless onboarding, with step-by-step support to ensure smooth integration into your existing workflow. - -- The effort and sacrifice required is significantly less than traditional methods. Swarms is designed for ease of use, requiring minimal technical know-how. Plus, our dedicated support team is always at hand to ensure a seamless experience. - -In essence, Swarms makes the dream of comprehensive business automation an attainable reality. Join thousands of our active users in harnessing the power of cooperative AI, and transform your business operations with us today. - -### Value prop SWARMS -``` -We've helped thousands of people just like you automate 30% of their activities with Swarms. And, all it takes to get started is a fast simple onboarding agent that asks you to integrate your tools and datasources. -``` - -In today's competitive landscape, organizations of all sizes are continually seeking ways to automate routine tasks, streamline processes, and make data-driven decisions. Enter Swarms, a revolutionary AI-based technology that leverages the power of multiple autonomous agents to perform tasks with unprecedented speed and accuracy. - -This guide lays out a SPIN (Situation, Problem, Implication, Need-payoff) approach to selling Swarms, taking you through a step-by-step journey from cold outreach to closing the deal. - -#2 -Cold Outreach - -Our first step is to generate interest in Swarms, and we do this through personalized, value-driven outreach. Focus on how Swarms can solve their pain points and bring value to their organization. - -Situation Questions: -- Do you currently use any AI or machine learning tools in your organization? -- How are you managing tasks that could be automated or require large-scale data analysis? - -Problem Questions: -- Are there any specific challenges in managing these tasks manually or using traditional AI models? -- How much time and resources are you currently dedicating to these tasks? - -Implication Questions: -- What is the cost of not addressing these challenges or improving these processes? -- How does this affect your team’s productivity, your operational efficiency, or your competitive advantage? - -Need-payoff Questions: -- How would your organization benefit from automating these tasks or making them more efficient? -- Could an AI-based tool that leverages the power of multiple autonomous agents be beneficial for your organization? - -#3 -Discovery Calls - -Once you've generated interest and scheduled a discovery call, dive deeper into their business operations, their pain points, and their goals. Establish a clear understanding of what they need and how Swarms can fulfill those needs. - -Situation Questions: -- Could you tell me more about your current workflows and operational processes? -- What is the biggest challenge your team is facing in managing these workflows? - -Problem Questions: -- Have you ever encountered situations where the scale or complexity of tasks was overwhelming for your existing systems? -- Are there any tasks that you believe require a level of intelligence or speed that your current solutions can’t provide? - -Implication Questions: -- How does this affect your growth, competitiveness, or profitability in the long term? -- What are the ripple effects of these challenges on other aspects of your business? - -Need-payoff Questions: -- Would a solution that can handle tasks of any scale or complexity efficiently and accurately be of value to your team? -- How would such a solution impact your operational efficiency, team productivity, and bottom line? - -#4 -Product Demonstration - -This is the stage where you showcase the capabilities of Swarms, demonstrating its features and how it can be applied to their specific use cases. Show, don't tell. - -Situation Questions: -- Can you share a few tasks that you believe could be significantly improved with automation or intelligent processing? -- What features or functionalities are you looking for in a solution to improve these tasks? - -Problem Questions: -- Are there any specific issues that you expect to arise if these tasks are managed with your current systems? -- Have past solutions failed to deliver on your expectations in any way? - -Implication Questions: -- What are the potential consequences if these issues are not addressed or if the tasks are not improved? -- How does this affect your team’s morale, your customer satisfaction, or your market position? - -Need-payoff Questions: -- Would you be interested in a solution that can automate these tasks, provide intelligent processing, and scale according to your needs? -- How would such a solution change the way your team works and the outcomes they achieve? - -#5 -Proposal and Negotiation - -Once they've seen Swarms in action, it's time to present a tailored proposal that highlights the value of Swarms for their organization. Always be ready to negotiate, but remember, the focus is on value, not price. - -Situation Questions: -- What does your budget look like for a solution like Swarms? -- What are the key factors you'll consider in making your decision? - -Problem Questions: -- Are there any concerns or roadblocks that you think might prevent you from moving forward with Swarms? -- Have budget constraints or cost issues affected your ability to implement effective solutions in the past? - -Implication Questions: -- If cost or resource constraints continue to limit your ability to implement effective solutions, how will this impact your organization in the long term? -- Are you prepared to deal with the ramifications of continued inefficiencies or challenges? - -Need-payoff Questions: -- How would investing in Swarms impact your budget compared to the potential return on investment? -- How much value do you place on a solution that can transform the way you manage tasks, improve efficiency, and drive growth? - -#6 -Closing the Deal - -Closing the deal is about more than just signing a contract. It’s about setting the stage for a long-term partnership, ensuring they see the value in Swarms not just as a product, but as a key part of their business strategy. - -Situation Questions: -- Are you ready to move forward with implementing Swarms in your organization? -- What expectations do you have from Swarms in the initial phase? - -Problem Questions: -- Are there any final concerns or questions you have that could prevent us from moving forward? -- Is there anything that’s still unclear about how Swarms works or the value it can bring to your organization? - -Implication Questions: -- If these concerns or uncertainties are not addressed, how will it affect your decision? -- Are you willing to overlook the potential value Swarms could bring due to these concerns? - -Need-payoff Questions: -- How can we address these concerns to make Swarms a part of your organization's growth story? -- Can we agree on the fact that Swarms, with its unique capabilities, could significantly boost your organization's operational efficiency and competitiveness? - -#7 -Consultation Packages - -As part of our commitment to ensure our clients extract the maximum value from Swarms, we offer several consultation packages. These packages are designed to provide continuous support as you integrate Swarms into your workflows and processes, helping you overcome any challenges and optimize the system for your specific needs. - -Package 1 - Initial Setup & Training: Our team of experts will assist you in setting up Swarms, train your team on its functionalities and features, and provide support as you start to use the system. - -Package 2 - Optimization & Fine-tuning: As you use Swarms, we'll work closely with you to optimize the system for your specific tasks and workflows, ensuring you extract the maximum value from the platform. - -Package 3 - Ongoing Support & Upgrades: We provide continuous support to address any challenges you encounter and ensure you always have access to the - - latest upgrades and improvements to Swarms. - -Remember, Swarms isn't just a product; it's a partnership. We're committed to working with you every step of the way, ensuring you harness the full power of cooperative AI to transform your organization. - - diff --git a/docs/old-docs/corp/SALESPEOPLE_PLAN.md b/docs/old-docs/corp/SALESPEOPLE_PLAN.md deleted file mode 100644 index e5c3fe406..000000000 --- a/docs/old-docs/corp/SALESPEOPLE_PLAN.md +++ /dev/null @@ -1,143 +0,0 @@ -# **Open Source Freelancer Salespeople Recruitment Plan** - -Here is a strategic plan to attract open-source freelancer salespeople to Swarms. - -1. **Promote the Vision**: A compelling vision is the cornerstone of any recruitment strategy. Share the vision and mission of Swarms – its potential to revolutionize AI and digital automation – on every possible platform. The goal is to attract freelancers who are excited about the potential of AI and are eager to be part of this revolution. - -2. **Compensation Structure**: Offer a highly competitive, commission-based compensation structure. This could include a base rate for each sale, as well as performance-based bonuses and incentives for high-performing salespeople. Make it clear that the better they do, the more they earn. - -3. **Comprehensive Training**: Ensure all salespeople receive comprehensive training about Swarms, its capabilities, and the potential benefits it can offer to businesses. The more knowledgeable they are about the product, the better they can sell it. - -4. **Collaborative Community**: Foster a community of open-source freelancer salespeople. This community will provide a platform for salespeople to exchange ideas, share success stories, and learn from each other. Foster a culture of collaboration and continuous learning. - -5. **Clear Communication**: Be clear about expectations, targets, and performance metrics. Provide regular feedback and recognition to keep salespeople motivated and aligned with the company's goals. - -6. **Sales Tools & Resources**: Equip salespeople with the necessary tools and resources they need to sell effectively. This might include sales scripts, customer personas, case studies, product demos, and any other material that can aid them in their sales efforts. - -7. **Marketing Support**: In parallel to sales efforts, invest in marketing initiatives to build brand awareness and generate leads. The higher the brand visibility, the easier it will be for salespeople to sell the product. - -8. **Advocate Program**: Introduce an advocate program where salespeople get additional rewards for bringing in more salespeople. This will not only increase the sales force but also instill a sense of ownership and involvement among salespeople. - -**Flywheel Research Diagram** - -Building a flywheel involves understanding and leveraging the compounding effect of a circular, connected process, where each stage fuels the next. Here's a conceptualization of a Swarms Sales Flywheel: - -1. **Training & Empowerment**: Start by attracting freelance salespeople and providing comprehensive training and resources. As salespeople gain competence, they become better at selling Swarms. - -2. **Sales**: As sales increase, so do the visibility of Swarms and the earnings of the salespeople. This attracts more clients and more potential salespeople. - -3. **Client Success**: Successful clients serve as testimonials and case studies, helping to validate the product and making it easier for salespeople to sell Swarms. Success stories and increased visibility generate more interest among potential salespeople. - -4. **Community & Advocacy**: A growing community of successful salespeople, satisfied clients, and a strong product fuels advocacy. Salespeople are more likely to recommend the opportunity to other potential salespeople. - -5. **Growth**: As the community and client base grow, so do the opportunities for salespeople. Increased earnings and a stronger product reputation attract more salespeople, turning the flywheel faster. - -6. **Back to Training & Empowerment**: The increased interest from potential salespeople leads back to the first stage of the flywheel – training and empowering more salespeople. - -The key to the flywheel's momentum is ensuring each stage is performed effectively, creating a virtuous cycle that builds momentum over time. It relies on customer success, salesperson success, and product success, all fueling each other to keep the flywheel spinning. - - - -# Risks and Mitigations -Embracing an open source salesforce represents an innovative approach and can have significant benefits, including scalability, diversity, and cost-effectiveness. However, there are potential risks that need to be considered and mitigated. Here they are, along with strategies for managing them: - -**1. Brand Representation:** In an open source sales model, you can't control who represents your brand, as anyone can essentially become a salesperson. This can pose a risk if salespeople don't present the product or brand accurately, or don't uphold company values in their interactions. - - *Mitigation Strategy:* Provide clear brand guidelines, sales training, and codes of conduct that salespeople must adhere to. Regular monitoring and feedback can help ensure compliance. Also, introduce a certification process to officially recognize salespeople who demonstrate their understanding of the product and brand. - -**2. Product Misrepresentation:** Salespeople may overpromise or misrepresent the product to close a deal, leading to customer dissatisfaction and damage to the brand. - - *Mitigation Strategy:* Ensure that comprehensive and accurate product information is readily available. Provide clear guidelines on what can and cannot be promised to customers. Regularly update salespeople on product developments so their knowledge remains accurate. - -**3. Variable Quality of Salespeople:** In an open-source model, the quality of salespeople can vary widely, which may lead to inconsistent customer experiences. - - *Mitigation Strategy:* Offer comprehensive training and provide sales scripts or guidelines to ensure a uniform sales approach. Monitor performance and provide feedback to help salespeople improve. - -**4. Competition and Infighting:** Salespeople may compete with each other for the same leads, causing conflicts and damaging team cohesion. - - *Mitigation Strategy:* Create a clear system for lead assignment and territory division to prevent overlaps. Promote a collaborative rather than competitive culture, emphasizing the collective success of the team over individual achievements. - -**5. Data Security and Privacy:** With more individuals having access to company and customer information, the risk of data breaches increases. - - *Mitigation Strategy:* Provide training on data security and privacy policies. Use secure systems for data access and sharing. Regularly audit and monitor data access to detect any potential breaches. - -**6. Lack of Control:** The company may have less control over an open-source salesforce compared to an in-house team, leading to potential inconsistencies and inefficiencies. - - *Mitigation Strategy:* Regular communication and feedback are crucial. Use a performance management system to set expectations, track progress, and identify areas for improvement. - -Ultimately, the key is to adopt a long-term perspective, just like Jeff Bezos. Invest in training and building relationships with the salespeople. Foster a culture of customer obsession, and instill a sense of ownership and responsibility in the salespeople. Just as with any other risk, these can be mitigated with careful planning, continuous monitoring, and regular feedback. - - - - - - -# Open Source Salesperson Onboarding Experience - -Creating an efficient, streamlined, and effective onboarding experience for open source salespeople is essential to minimize time and maximize engagement. Drawing inspiration from the simplicity and user-focus of Steve Jobs, this document proposes an onboarding agent that is effortless, engaging, and educational. - -## Landing Page - -The journey starts with a landing page that is clean, crisp, and intuitively designed. A minimalistic aesthetic, akin to Apple's design philosophy, helps the user focus on what's important. The landing page should contain: - -- A bold, clear headline, expressing the value proposition for becoming an open source salesperson for Swarms. -- A short video or animation introducing Swarms and the opportunity for the salespeople. -- Clear call-to-action (CTA) buttons to start the onboarding process or to learn more. - -## Interactive Learning Modules - -Once the user clicks on the CTA, they're taken to an interactive course platform. This platform should feature short, digestible video modules covering a range of essential topics, including: - -1. An Introduction to Swarms: An engaging video that explains the concept, the value it brings to businesses, and the open-source ethos driving it. - -2. Understanding the Technology: A simple, jargon-free explanation of the underlying technology, how it works, and why it works that way. Emphasis should be on benefits rather than technical intricacies. - -3. Successful Sales Strategies: Sharing effective sales techniques and strategies that have worked for Swarms, along with case studies and testimonials. - -4. Navigating Customer Conversations: Guidance on how to effectively communicate with potential customers, including understanding their needs, presenting Swarms as a solution, and addressing objections. - -After each module, the user is asked to answer a few questions to ensure understanding and engagement. This also helps in identifying potential areas of confusion or difficulty. - -## Personal Interaction - -Once the user completes all the modules and successfully answers the questions, they're invited to schedule a one-on-one call with a member of APAC AI or an experienced open source sales freelancer. This serves as a validation step, providing personalized feedback and guidance to ensure the salesperson is ready to start selling Swarms. - -Throughout this journey, the focus should be on simplicity and intuitiveness. Just like Steve Jobs did with Apple's products, the onboarding experience should be so seamless and enjoyable that it's almost invisible, allowing the user to focus on what truly matters – learning about Swarms and how to sell it. - - - -# Open Source Salesperson Onboarding: Post Course Completion - -### For more assistance check out these resources - -* [Pricing Package](https://www.acquisition.com/hubfs/Offer%20Checklists%20-%20PDF%20Downloads/Pricing-Value-Checklist.pdf?hsLang=en) - -*[Alex Hormozi](https://www.acquisition.com/offers-value-equation) - -Once a salesperson has completed the initial course and had their one-on-one session, the onboarding continues to the next phase – preparing them for sales activities and ensuring they have the necessary tools and resources. - -## Access to CRM and Sales Tools - -Every salesperson is provided with access to a CRM (Customer Relationship Management) system. This CRM would be a simplified, user-friendly system that allows them to manage their prospects, track their interactions, and monitor their sales progress. They would also receive training on how to effectively use the CRM to streamline their sales activities. - -## Sales Resources - -Salespeople would be provided with a suite of sales resources, including Swarms product brochures, case studies, presentations, and a script guideline. They would also be given access to a community forum where they can connect with other salespeople, share experiences, ask questions, and learn from each other. - -## Making a Sale - -In terms of the actual sale process, the salesperson would direct the customer to a unique landing page on the APAC.ai website. This landing page would be specifically designed for the sales journey, and it would allow the customer to input their salesperson's ID during the checkout process. - -This ID linking mechanism is critical, as it ensures that the salesperson gets credited for any sales they bring in. Once a sale is made, the salesperson's commission gets credited to their account. - -## Post-Sale and Account Management - -Post-sale, the salesperson's role transitions to more of an account manager. They become the primary point of contact for the customer, responsible for ensuring customer satisfaction, handling any issues or concerns, and identifying opportunities for upselling or cross-selling. - -The salesperson would also receive a recurring revenue from their accounts. This not only incentivizes them to maintain a good relationship with their customers but also rewards them for the ongoing value they provide. - -## Feedback and Performance Reviews - -Periodic performance reviews would be conducted to provide feedback to the salespeople and help them improve. These reviews would also be an opportunity to recognize top performers and share their success stories with the wider community. - -Overall, the objective is to create a smooth, rewarding, and self-sustaining sales ecosystem. Salespeople are empowered with the tools, resources, and incentives they need to succeed, and in return, they help drive the growth and success of Swarms. It's a win-win scenario that has the potential to dramatically accelerate Swarms' market penetration and customer adoption. \ No newline at end of file diff --git a/docs/old-docs/design/CLEAN_CODE.md b/docs/old-docs/design/CLEAN_CODE.md deleted file mode 100644 index 7840a6492..000000000 --- a/docs/old-docs/design/CLEAN_CODE.md +++ /dev/null @@ -1,242 +0,0 @@ -Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability. -_____________________________________ - -## General rules -1. Follow standard conventions. -2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible. -3. Boy scout rule. Leave the campground cleaner than you found it. -4. Always find root cause. Always look for the root cause of a problem. - -## Design rules -1. Keep configurable data at high levels. -2. Prefer polymorphism to if/else or switch/case. -3. Separate multi-threading code. -4. Prevent over-configurability. -5. Use dependency injection. -6. Follow Law of Demeter. A class should know only its direct dependencies. - -## Understandability tips -1. Be consistent. If you do something a certain way, do all similar things in the same way. -2. Use explanatory variables. -3. Encapsulate boundary conditions. Boundary conditions are hard to keep track of. Put the processing for them in one place. -4. Prefer dedicated value objects to primitive type. -5. Avoid logical dependency. Don't write methods which works correctly depending on something else in the same class. -6. Avoid negative conditionals. - -## Names rules -1. Choose descriptive and unambiguous names. -2. Make meaningful distinction. -3. Use pronounceable names. -4. Use searchable names. -5. Replace magic numbers with named constants. -6. Avoid encodings. Don't append prefixes or type information. -7. The Name of a variable, Function, or Class should answer why it exists, what it does , and how it can used. Comments are a burden -8. Clarity is King -9. ClassNames should not be a verb -10. Methods should have verb or verb phrase names -11. Be simple. Be Direct. Say what you mean, mean what you say. -12. Don't use the same word for 2 purposes -13. - -## Functions rules -1. Small. -2. Do one thing. -3. Use descriptive names. -4. Prefer fewer arguments. -5. Have no side effects. -6. Don't use flag arguments. Split method into several independent methods that can be called from the client without the flag. -7. Smaller than 20 lines long -8. The Stepdown rule => function -> next level of abstraction - - -## ErrorHandling -1. Specify where the error in print -2. Don't use a single variable -3. - -## If statements -1. - - -## Comments rules -1. Always try to explain yourself in code. -2. Don't be redundant. -3. Don't add obvious noise. -4. Don't use closing brace comments. -5. Don't comment out code. Just remove. -6. Use as explanation of intent. -7. Use as clarification of code. -8. Use as warning of consequences. - -## Source code structure -1. Separate concepts vertically. -2. Related code should appear vertically dense. -3. Declare variables close to their usage. -4. Dependent functions should be close. -5. Similar functions should be close. -6. Place functions in the downward direction. -7. Keep lines short. -8. Don't use horizontal alignment. -9. Use white space to associate related things and disassociate weakly related. -10. Don't break indentation. - -## Objects and data structures -1. Hide internal structure. -2. Prefer data structures. -3. Avoid hybrids structures (half object and half data). -4. Should be small. -5. Do one thing. -6. Small number of instance variables. -7. Base class should know nothing about their derivatives. -8. Better to have many functions than to pass some code into a function to select a behavior. -9. Prefer non-static methods to static methods. - -## Tests -1. One assert per test. -2. Readable. -3. Fast. -4. Independent. -5. Repeatable. - -## Code smells -1. Rigidity. The software is difficult to change. A small change causes a cascade of subsequent changes. -2. Fragility. The software breaks in many places due to a single change. -3. Immobility. You cannot reuse parts of the code in other projects because of involved risks and high effort. -4. Needless Complexity. -5. Needless Repetition. -6. Opacity. The code is hard to understand. - - - - - - - - -# Clean Code - -Here are some general principles for writing highly usable, functional, reliable, fast, and scalable code: - -1. **Clear and Understandable:** The code should be written in a way that's easy for others to understand. This includes using clear variable and function names, and including comments to explain complex sections of code. - -2. **Modular and Reusable:** Code should be broken down into small, modular functions and classes that each perform a single task. This makes the code more understandable, and also allows for code reuse. - -3. **Robust Error Handling:** The code should be able to handle all potential errors gracefully, and should never crash unexpectedly. This includes checking for invalid input, catching exceptions, and providing useful error messages. - -4. **Type Handling:** Whenever possible, the code should enforce and check types to prevent type-related errors. This can be done through the use of type hints in languages like Python, or through explicit type checks. - -5. **Logging:** The code should include extensive logging to make it easier to debug and understand what the code is doing. This includes logging any errors that occur, as well as important events or state changes. - -6. **Performance:** The code should be optimized for performance, avoiding unnecessary computation and using efficient algorithms and data structures. This includes profiling the code to identify and optimize performance bottlenecks. - -7. **Scalability:** The code should be designed to scale well as the size of the input data or the number of users increases. This includes using scalable algorithms and data structures, and designing the code to work well in a distributed or parallel computing environment if necessary. - -8. **Testing:** The code should include comprehensive tests to ensure that it works correctly. This includes unit tests for individual functions and classes, as well as integration tests to ensure that the different parts of the code work well together. - -9. **Version Control:** The code should be stored in a version control system like Git, which allows for tracking changes, collaborating with others, and rolling back to a previous state if necessary. - -10. **Documentation:** The codebase should be well-documented, both in terms of comments within the code and external documentation that explains how to use and contribute to the code. - -11. **Continuous Integration/Continuous Deployment (CI/CD):** Implement CI/CD pipelines for automatic testing and deployment. This ensures that any new changes do not break existing functionality and that the latest version of the application is always available for deployment. - -# Examples -1. **Clear and Understandable:** Use meaningful variable and function names. Include comments when necessary. - - ```python - # Good example - def calculate_average(numbers: List[int]) -> float: - """Calculate and return the average of a list of numbers.""" - total = sum(numbers) - count = len(numbers) - return total / count - ``` - - For file and folder names, use descriptive names that relate to their function in your program. For example, a file that contains functions for handling user input might be named `user_input.py`. - -2. **Modular and Reusable:** Write functions for tasks that you perform over and over. - - ```python - def greet_user(name: str): - """Print a greeting to the user.""" - print(f"Hello, {name}!") - ``` - - For folder structure, group related files in the same directory. For example, all test files could be in a `tests` directory. - -3. **Robust Error Handling:** Use try/except blocks to catch and handle errors. - - ```python - def divide_numbers(numerator: float, denominator: float) -> float: - """Divide two numbers and handle division by zero.""" - try: - return numerator / denominator - except ZeroDivisionError: - print("Error: Division by zero.") - return None - ``` - -4. **Type Handling:** Use type hints to specify the type of function arguments and return values. - - ```python - def greet_user(name: str) -> None: - """Greet the user.""" - print(f"Hello, {name}!") - ``` - -5. **Logging:** Use the `logging` module to log events. - - ```python - import logging - - logging.basicConfig(level=logging.INFO) - - def divide_numbers(numerator: float, denominator: float) -> float: - """Divide two numbers and log if division by zero occurs.""" - try: - return numerator / denominator - except ZeroDivisionError: - logging.error("Attempted division by zero.") - return None - ``` - -6. **Performance:** Use built-in functions and data types for better performance. - - ```python - # Using a set to check for membership is faster than using a list - numbers_set = set(numbers) - if target in numbers_set: - print(f"{target} is in the set of numbers.") - ``` - -7. **Scalability:** For scalability, an example might involve using a load balancer or dividing tasks among different workers or threads. This is more of a system design consideration than a single piece of code. - -8. **Testing:** Write tests for your functions. - - ```python - def test_calculate_average(): - assert calculate_average([1, 2, 3, 4]) == 2.5 - ``` - - For tests, you could have a separate `tests` directory. Inside this directory, each test file could be named `test_.py` where `` is the name of the file being tested. - -9. **Version Control:** This point refers to using tools like Git for version control. A simple example would be committing changes to a repository: - - ```bash - git add . - git commit -m "Add function to calculate average" - git push - ``` - -10. **Documentation:** Write docstrings for your functions. - - ```python - def calculate_average(numbers: List[int]) -> float: - """Calculate and return the average of a list of numbers.""" - ... - ``` - - Documentation might be kept in a `docs` directory, with separate files for different topics. - -11. **Continuous Integration/Continuous Deployment (CI/CD):** This is typically handled by a system like Jenkins, GitHub Actions, or GitLab CI/CD. It involves creating a script or configuration file that tells the CI/CD system how to build, test, and deploy your code. For example, a `.github/workflows/main.yml` file for a GitHub Actions workflow. - -Remember, consistency in your naming conventions and organization is key. Having a standard and sticking to it will make your codebase easier to navigate and understand. \ No newline at end of file diff --git a/docs/old-docs/design/DESIGN.md b/docs/old-docs/design/DESIGN.md deleted file mode 100644 index be92089a1..000000000 --- a/docs/old-docs/design/DESIGN.md +++ /dev/null @@ -1,146 +0,0 @@ -# Swarm Architecture Design Document - -## Overview - -The goal of the Swarm Architecture is to provide a flexible and scalable system to build swarm intelligence models that can solve complex problems. This document details the proposed design to create a plug-and-play system, which makes it easy to create custom swarms, and provides pre-configured swarms with multi-modal agents. - -## Design Principles - -- **Modularity**: The system will be built in a modular fashion, allowing various components to be easily swapped or upgraded. -- **Interoperability**: Different swarm classes and components should be able to work together seamlessly. -- **Scalability**: The design should support the growth of the system by adding more components or swarms. -- **Ease of Use**: Users should be able to easily create their own swarms or use pre-configured ones with minimal configuration. - -## Design Components - -### AbstractSwarm - -The AbstractSwarm is an abstract base class which defines the basic structure of a swarm and the methods that need to be implemented. Any new swarm should inherit from this class and implement the required methods. - -### Swarm Classes - -Various Swarm classes can be implemented inheriting from the AbstractSwarm class. Each swarm class should implement the required methods for initializing the components, worker nodes, and boss node, and running the swarm. - -Pre-configured swarm classes with multi-modal agents can be provided for ease of use. These classes come with a default configuration of tools and agents, which can be used out of the box. - -### Tools and Agents - -Tools and agents are the components that provide the actual functionality to the swarms. They can be language models, AI assistants, vector stores, or any other components that can help in problem solving. - -To make the system plug-and-play, a standard interface should be defined for these components. Any new tool or agent should implement this interface, so that it can be easily plugged into the system. - -## Usage - -Users can either use pre-configured swarms or create their own custom swarms. - -To use a pre-configured swarm, they can simply instantiate the corresponding swarm class and call the run method with the required objective. - -To create a custom swarm, they need to: - -1. Define a new swarm class inheriting from AbstractSwarm. -2. Implement the required methods for the new swarm class. -3. Instantiate the swarm class and call the run method. - -### Example - -```python -# Using pre-configured swarm -swarm = PreConfiguredSwarm(openai_api_key) -swarm.run_swarms(objective) - -# Creating custom swarm -class CustomSwarm(AbstractSwarm): - # Implement required methods - -swarm = CustomSwarm(openai_api_key) -swarm.run_swarms(objective) -``` - -## Conclusion - -This Swarm Architecture design provides a scalable and flexible system for building swarm intelligence models. The plug-and-play design allows users to easily use pre-configured swarms or create their own custom swarms. - - -# Swarming Architectures -Sure, below are five different swarm architectures with their base requirements and an abstract class that processes these components: - -1. **Hierarchical Swarm**: This architecture is characterized by a boss/worker relationship. The boss node takes high-level decisions and delegates tasks to the worker nodes. The worker nodes perform tasks and report back to the boss node. - - Requirements: Boss node (can be a large language model), worker nodes (can be smaller language models), and a task queue for task management. - -2. **Homogeneous Swarm**: In this architecture, all nodes in the swarm are identical and contribute equally to problem-solving. Each node has the same capabilities. - - Requirements: Homogeneous nodes (can be language models of the same size), communication protocol for nodes to share information. - -3. **Heterogeneous Swarm**: This architecture contains different types of nodes, each with its specific capabilities. This diversity can lead to more robust problem-solving. - - Requirements: Different types of nodes (can be different types and sizes of language models), a communication protocol, and a mechanism to delegate tasks based on node capabilities. - -4. **Competitive Swarm**: In this architecture, nodes compete with each other to find the best solution. The system may use a selection process to choose the best solutions. - - Requirements: Nodes (can be language models), a scoring mechanism to evaluate node performance, a selection mechanism. - -5. **Cooperative Swarm**: In this architecture, nodes work together and share information to find solutions. The focus is on cooperation rather than competition. - - Requirements: Nodes (can be language models), a communication protocol, a consensus mechanism to agree on solutions. - - -6. **Grid-based Swarm**: This architecture positions agents on a grid, where they can only interact with their neighbors. This is useful for simulations, especially in fields like ecology or epidemiology. - - Requirements: Agents (can be language models), a grid structure, and a neighborhood definition (i.e., how to identify neighboring agents). - -7. **Particle Swarm Optimization (PSO) Swarm**: In this architecture, each agent represents a potential solution to an optimization problem. Agents move in the solution space based on their own and their neighbors' past performance. PSO is especially useful for continuous numerical optimization problems. - - Requirements: Agents (each representing a solution), a definition of the solution space, an evaluation function to rate the solutions, a mechanism to adjust agent positions based on performance. - -8. **Ant Colony Optimization (ACO) Swarm**: Inspired by ant behavior, this architecture has agents leave a pheromone trail that other agents follow, reinforcing the best paths. It's useful for problems like the traveling salesperson problem. - - Requirements: Agents (can be language models), a representation of the problem space, a pheromone updating mechanism. - -9. **Genetic Algorithm (GA) Swarm**: In this architecture, agents represent potential solutions to a problem. They can 'breed' to create new solutions and can undergo 'mutations'. GA swarms are good for search and optimization problems. - - Requirements: Agents (each representing a potential solution), a fitness function to evaluate solutions, a crossover mechanism to breed solutions, and a mutation mechanism. - -10. **Stigmergy-based Swarm**: In this architecture, agents communicate indirectly by modifying the environment, and other agents react to such modifications. It's a decentralized method of coordinating tasks. - - Requirements: Agents (can be language models), an environment that agents can modify, a mechanism for agents to perceive environment changes. - -These architectures all have unique features and requirements, but they share the need for agents (often implemented as language models) and a mechanism for agents to communicate or interact, whether it's directly through messages, indirectly through the environment, or implicitly through a shared solution space. Some also require specific data structures, like a grid or problem space, and specific algorithms, like for evaluating solutions or updating agent positions. - - - - - -Here is an abstract class that provides the basic structure to process these components: - -```python -from abc import ABC, abstractmethod - -class AbstractSwarm(ABC): - - def __init__(self, agents, vectorstore, tools): - self.agents = agents - self.vectorstore = vectorstore - self.tools = tools - - @abstractmethod - def initialize(self): - pass - - @abstractmethod - def communicate(self): - pass - - @abstractmethod - def process(self): - pass - - @abstractmethod - def solve(self): - pass -``` - -This abstract class requires four methods to be implemented: - -- `initialize`: This method is used to set up the initial state of the swarm, including setting up nodes and tools. -- `communicate`: This method is responsible for facilitating communication between nodes. -- `process`: This method handles the processing logic, which can be different based on the swarm architecture. -- `solve`: This method is called to start the problem-solving process. - -This abstract class can be inherited by specific swarm architecture classes to implement their specific behavior. - -# 3 Ingredients - -* The Individual Agent Configuration with a vectorstore and tools - -* The Orchestrator, => task assignment, task completion handling, communication layer \ No newline at end of file diff --git a/docs/old-docs/design/DESIGN_PHILOSOPHY.md b/docs/old-docs/design/DESIGN_PHILOSOPHY.md deleted file mode 100644 index d1ee57e1e..000000000 --- a/docs/old-docs/design/DESIGN_PHILOSOPHY.md +++ /dev/null @@ -1,53 +0,0 @@ -# Design Philosophy Document for Swarms - -## Usable - -### Objective - -Our goal is to ensure that Swarms is intuitive and easy to use for all users, regardless of their level of technical expertise. This includes the developers who implement Swarms in their applications, as well as end users who interact with the implemented systems. - -### Tactics - -- Clear and Comprehensive Documentation: We will provide well-written and easily accessible documentation that guides users through using and understanding Swarms. -- User-Friendly APIs: We'll design clean and self-explanatory APIs that help developers to understand their purpose quickly. -- Prompt and Effective Support: We will ensure that support is readily available to assist users when they encounter problems or need help with Swarms. - -## Reliable - -### Objective - -Swarms should be dependable and trustworthy. Users should be able to count on Swarms to perform consistently and without error or failure. - -### Tactics - -- Robust Error Handling: We will focus on error prevention, detection, and recovery to minimize failures in Swarms. -- Comprehensive Testing: We will apply various testing methodologies such as unit testing, integration testing, and stress testing to validate the reliability of our software. -- Continuous Integration/Continuous Delivery (CI/CD): We will use CI/CD pipelines to ensure that all changes are tested and validated before they're merged into the main branch. - -## Fast - -### Objective - -Swarms should offer high performance and rapid response times. The system should be able to handle requests and tasks swiftly. - -### Tactics - -- Efficient Algorithms: We will focus on optimizing our algorithms and data structures to ensure they run as quickly as possible. -- Caching: Where appropriate, we will use caching techniques to speed up response times. -- Profiling and Performance Monitoring: We will regularly analyze the performance of Swarms to identify bottlenecks and opportunities for improvement. - -## Scalable - -### Objective - -Swarms should be able to grow in capacity and complexity without compromising performance or reliability. It should be able to handle increased workloads gracefully. - -### Tactics - -- Modular Architecture: We will design Swarms using a modular architecture that allows for easy scaling and modification. -- Load Balancing: We will distribute tasks evenly across available resources to prevent overload and maximize throughput. -- Horizontal and Vertical Scaling: We will design Swarms to be capable of both horizontal (adding more machines) and vertical (adding more power to an existing machine) scaling. - -### Philosophy - -Swarms is designed with a philosophy of simplicity and reliability. We believe that software should be a tool that empowers users, not a hurdle that they need to overcome. Therefore, our focus is on usability, reliability, speed, and scalability. We want our users to find Swarms intuitive and dependable, fast and adaptable to their needs. This philosophy guides all of our design and development decisions. \ No newline at end of file diff --git a/docs/old-docs/design/GOLDEN_METRIC.md b/docs/old-docs/design/GOLDEN_METRIC.md deleted file mode 100644 index 8340d6346..000000000 --- a/docs/old-docs/design/GOLDEN_METRIC.md +++ /dev/null @@ -1,225 +0,0 @@ -# The Golden Metric: 95% User-Task-Completion-Satisfaction Rate - -In the world of Swarms, there’s one metric that stands above the rest: the User-Task-Completion-Satisfaction (UTCS) rate. This metric is the heart of our system, the pulse that keeps us moving forward. It’s not just a number; it’s a reflection of our commitment to our users and a measure of our success. - -## What is the UTCS Rate? -The UTCS rate is a measure of how reliably and quickly Swarms can satisfy a user demand. It’s calculated by dividing the number of tasks completed to the user’s satisfaction by the total number of tasks. Multiply that by 100, and you’ve got your UTCS rate. - -But what does it mean to complete a task to the user’s satisfaction? It means that the task is not only completed, but completed in a way that meets or exceeds the user’s expectations. It’s about quality, speed, and reliability. - -## Why is the UTCS Rate Important? -The UTCS rate is a direct reflection of the user experience. A high UTCS rate means that users are getting what they need from Swarms, and they’re getting it quickly and reliably. It means that Swarms is doing its job, and doing it well. - -But the UTCS rate is not just about user satisfaction. It’s also a measure of Swarms’ efficiency and effectiveness. A high UTCS rate means that Swarms is able to complete tasks quickly and accurately, with minimal errors or delays. It’s a sign of a well-oiled machine. - -## How Do We Achieve a 95% UTCS Rate? -Achieving a 95% UTCS rate is no small feat. It requires a deep understanding of our users and their needs, a robust and reliable system, and a commitment to continuous improvement. - -### Here are some strategies we’re implementing to reach our goal: - -* Understanding User Needs: We must have agents that gain an understanding of the user's objective and break it up into it's most fundamental building blocks - -* Improving System Reliability: We’re working to make Swarms more reliable, reducing errors and improving the accuracy of task completion. This includes improving our algorithms, refining our processes, and investing in quality assurance. - -* Optimizing for Speed: We’re optimizing Swarms to complete tasks as quickly as possible, without sacrificing quality. This includes improving our infrastructure, streamlining our workflows, and implementing performance optimizations. - -*Iterating and Improving: We’re committed to continuous improvement. We’re constantly monitoring our UTCS rate and other key metrics, and we’re always looking for ways to improve. We’re not afraid to experiment, iterate, and learn from our mistakes. - -Achieving a 95% UTCS rate is a challenging goal, but it’s a goal worth striving for. It’s a goal that will drive us to improve, innovate, and deliver the best possible experience for our users. And in the end, that’s what Swarms is all about. - - - -# Your Feedback Matters: Help Us Optimize the UTCS Rate - -As we initiate the journey of Swarms, we seek your feedback to better guide our growth and development. Your opinions and suggestions are crucial for us, helping to mold our product, pricing, branding, and a host of other facets that influence your experience. - -## Your Insights on the UTCS Rate -Our goal is to maintain a UTCS (User-Task-Completion-Satisfaction) rate of 95%. This metric is integral to the success of Swarms, indicating the efficiency and effectiveness with which we satisfy user requests. However, it's a metric that we can't optimize alone - we need your help. - -Here's what we want to understand from you: - -1. **Satisfaction:** What does a "satisfactorily completed task" mean to you? Are there specific elements that contribute to a task being carried out to your satisfaction? -2. **Timeliness:** How important is speed in the completion of a task? What would you consider a reasonable timeframe for a task to be completed? -3. **Usability:** How intuitive and user-friendly do you find the Swarms platform? Are there any aspects of the platform that you believe could be enhanced? -4. **Reliability:** How much does consistency in performance matter to you? Can you share any experiences where Swarms either met or fell short of your expectations? -5. **Value for Money:** How do you perceive our pricing? Does the value Swarms provides align with the costs? - -We invite you to share your experiences, thoughts, and ideas. Whether it's a simple suggestion or an in-depth critique, we appreciate and value your input. - -## Your Feedback: The Backbone of our Growth -Your feedback is the backbone of Swarms' evolution. It drives us to refine our strategies, fuels our innovative spirit, and, most importantly, enables us to serve you better. - -As we launch, we open the conversation around these key aspects of Swarms, and we look forward to understanding your expectations, your needs, and how we can deliver the best experience for you. - -So, let's start this conversation - how can we make Swarms work best for you? - - -Guide Our Growth: Help Optimize Swarms -As we launch Swarms, your feedback is critical for enhancing our product, pricing, and branding. A key aim for us is a User-Task-Completion-Satisfaction (UTCS) rate of 95% - indicating our efficiency and effectiveness in meeting user needs. However, we need your insights to optimize this. - -Here's what we're keen to understand: - -Satisfaction: Your interpretation of a "satisfactorily completed task". -Timeliness: The importance of speed in task completion for you. -Usability: Your experiences with our platform’s intuitiveness and user-friendliness. -Reliability: The significance of consistent performance to you. -Value for Money: Your thoughts on our pricing and value proposition. -We welcome your thoughts, experiences, and suggestions. Your feedback fuels our evolution, driving us to refine strategies, boost innovation, and enhance your experience. - -Let's start the conversation - how can we make Swarms work best for you? - - --------- - -**The Golden Metric Analysis: The Ultimate UTCS Paradigm for Swarms** - -### Introduction - -In our ongoing journey to perfect Swarms, understanding how our product fares in the eyes of the end-users is paramount. Enter the User-Task-Completion-Satisfaction (UTCS) rate - our primary metric that gauges how reliably and swiftly Swarms can meet user demands. As we steer Swarms towards achieving a UTCS rate of 95%, understanding this metric's core and how to refine it becomes vital. - -### Decoding UTCS: An Analytical Overview - -The UTCS rate is not merely about task completion; it's about the comprehensive experience. Therefore, its foundations lie in: - -1. **Quality**: Ensuring tasks are executed flawlessly. -2. **Speed**: Delivering results in the shortest possible time. -3. **Reliability**: Consistency in quality and speed across all tasks. - -We can represent the UTCS rate with the following equation: - -```latex -\[ UTCS Rate = \frac{(Completed Tasks \times User Satisfaction)}{(Total Tasks)} \times 100 \] -``` - -Where: -- Completed Tasks refer to the number of tasks Swarms executes without errors. -- User Satisfaction is the subjective component, gauged through feedback mechanisms. This could be on a scale of 1-10 (or a percentage). -- Total Tasks refer to all tasks processed by Swarms, regardless of the outcome. - -### The Golden Metric: Swarm Efficiency Index (SEI) - -However, this basic representation doesn't factor in a critical component: system performance. Thus, we introduce the Swarm Efficiency Index (SEI). The SEI encapsulates not just the UTCS rate but also system metrics like memory consumption, number of tasks, and time taken. By blending these elements, we aim to present a comprehensive view of Swarm's prowess. - -Here’s the formula: - -```latex -\[ SEI = \frac{UTCS Rate}{(Memory Consumption + Time Window + Task Complexity)} \] -``` - -Where: -- Memory Consumption signifies the system resources used to accomplish tasks. -- Time Window is the timeframe in which the tasks were executed. -- Task Complexity could be a normalized scale that defines how intricate a task is (e.g., 1-5, with 5 being the most complex). - -Rationale: -- **Incorporating Memory Consumption**: A system that uses less memory but delivers results is more efficient. By inverting memory consumption in the formula, we emphasize that as memory usage goes down, SEI goes up. - -- **Considering Time**: Time is of the essence. The faster the results without compromising quality, the better. By adding the Time Window, we emphasize that reduced task execution time increases the SEI. - -- **Factoring in Task Complexity**: Not all tasks are equal. A system that effortlessly completes intricate tasks is more valuable. By integrating task complexity, we can normalize the SEI according to the task's nature. - -### Implementing SEI & Improving UTCS - -Using feedback from elder-plinius, we can better understand and improve SEI and UTCS: - -1. **Feedback Across Skill Levels**: By gathering feedback from users with different skill levels, we can refine our metrics, ensuring Swarms caters to all. - -2. **Simplifying Setup**: Detailed guides can help newcomers swiftly get on board, thus enhancing user satisfaction. - -3. **Enhancing Workspace and Agent Management**: A clearer view of the Swarm's internal structure, combined with on-the-go adjustments, can improve both the speed and quality of results. - -4. **Introducing System Suggestions**: A proactive Swarms that provides real-time insights and recommendations can drastically enhance user satisfaction, thus pushing up the UTCS rate. - -### Conclusion - -The UTCS rate is undeniably a pivotal metric for Swarms. However, with the introduction of the Swarm Efficiency Index (SEI), we have an opportunity to encapsulate a broader spectrum of performance indicators, leading to a more holistic understanding of Swarms' efficiency. By consistently optimizing for SEI, we can ensure that Swarms not only meets user expectations but also operates at peak system efficiency. - - ----------------- -**Research Analysis: Tracking and Ensuring Reliability of Swarm Metrics at Scale** - -### 1. Introduction - -In our pursuit to optimize the User-Task-Completion-Satisfaction (UTCS) rate and Swarm Efficiency Index (SEI), reliable tracking of these metrics at scale becomes paramount. This research analysis delves into methodologies, technologies, and practices that can be employed to monitor these metrics accurately and efficiently across vast data sets. - -### 2. Why Tracking at Scale is Challenging - -The primary challenges include: - -- **Volume of Data**: As Swarms grows, the data generated multiplies exponentially. -- **Variability of Data**: Diverse user inputs lead to myriad output scenarios. -- **System Heterogeneity**: Different configurations and deployments can yield variable results. - -### 3. Strategies for Scalable Tracking - -#### 3.1. Distributed Monitoring Systems - -**Recommendation**: Implement distributed systems like Prometheus or InfluxDB. - -**Rationale**: -- Ability to collect metrics from various Swarm instances concurrently. -- Scalable and can handle vast data influxes. - -#### 3.2. Real-time Data Processing - -**Recommendation**: Use stream processing systems like Apache Kafka or Apache Flink. - -**Rationale**: -- Enables real-time metric calculation. -- Can handle high throughput and low-latency requirements. - -#### 3.3. Data Sampling - -**Recommendation**: Random or stratified sampling of user sessions. - -**Rationale**: -- Reduces the data volume to be processed. -- Maintains representativeness of overall user experience. - -### 4. Ensuring Reliability in Data Collection - -#### 4.1. Redundancy - -**Recommendation**: Integrate redundancy into data collection nodes. - -**Rationale**: -- Ensures no single point of failure. -- Data loss prevention in case of system malfunctions. - -#### 4.2. Anomaly Detection - -**Recommendation**: Implement AI-driven anomaly detection systems. - -**Rationale**: -- Identifies outliers or aberrations in metric calculations. -- Ensures consistent and reliable data interpretation. - -#### 4.3. Data Validation - -**Recommendation**: Establish automated validation checks. - -**Rationale**: -- Ensures only accurate and relevant data is considered. -- Eliminates inconsistencies arising from corrupted or irrelevant data. - -### 5. Feedback Loops and Continuous Refinement - -#### 5.1. User Feedback Integration - -**Recommendation**: Develop an in-built user feedback mechanism. - -**Rationale**: -- Helps validate the perceived vs. actual performance. -- Allows for continuous refining of tracking metrics and methodologies. - -#### 5.2. A/B Testing - -**Recommendation**: Regularly conduct A/B tests for new tracking methods or adjustments. - -**Rationale**: -- Determines the most effective methods for data collection. -- Validates new tracking techniques against established ones. - -### 6. Conclusion - -To successfully and reliably track the UTCS rate and SEI at scale, it's essential to combine robust monitoring tools, data processing methodologies, and validation techniques. By doing so, Swarms can ensure that the metrics collected offer a genuine reflection of system performance and user satisfaction. Regular feedback and iterative refinement, rooted in a culture of continuous improvement, will further enhance the accuracy and reliability of these essential metrics. \ No newline at end of file diff --git a/docs/old-docs/design/abstraction.py b/docs/old-docs/design/abstraction.py deleted file mode 100644 index 75862e726..000000000 --- a/docs/old-docs/design/abstraction.py +++ /dev/null @@ -1,19 +0,0 @@ -from swarms import Model, Agent, vectorstore, tools, orchestrator - -# 1 model -Model(openai) - -# 2 agent level -Agent(model, vectorstore, tools) - -# 3 worker infrastructure level -worker_node(Agent, human_input, tools) - -# 4 swarm level basically handling infrastructure for multiple worker node -swarm = orchestrator(worker_node, 100) # nodes - -# 5 -hivemind = Hivemind(swarm * 100) - - -# a market different pre built worker or boss agent that have access to different tools and memory, proompts diff --git a/docs/old-docs/ideas/AGENT_NAME.md b/docs/old-docs/ideas/AGENT_NAME.md deleted file mode 100644 index 407c2f128..000000000 --- a/docs/old-docs/ideas/AGENT_NAME.md +++ /dev/null @@ -1,22 +0,0 @@ -Sure, here are some creative neo-futuristic names for your swarm worker agents: - -QuantumPulse -UltraNode -FusionCortex -HyperionCrawler -XenoSync -HoloWorker -EtherEngine -NebulaNexus -OmegaOrbit -ZetaZenith -PhantomPivot -VortexVector -ChronoCluster -SpecterSphere -TitanTrace -EchoEntity -NovaNucleus -AstroAssembler -PulsarProcessor -CosmicCrafter \ No newline at end of file diff --git a/docs/old-docs/ideas/HIVEMIND.md b/docs/old-docs/ideas/HIVEMIND.md deleted file mode 100644 index 09c0c9abb..000000000 --- a/docs/old-docs/ideas/HIVEMIND.md +++ /dev/null @@ -1,69 +0,0 @@ -Guide to Product-Market Fit for HiveMind Class -Risks and Mitigations -Scalability: As the number of swarms increases, the computational resources required will also increase. This could lead to performance issues or high costs. - -Mitigation: Implement efficient resource management and load balancing. Consider using cloud-based solutions that can scale up or down based on demand. - -Concurrency Issues: With multiple swarms running concurrently, there could be issues with data consistency and synchronization. - -Mitigation: Implement robust concurrency control mechanisms. Ensure that the shared vector store is thread-safe. - -Error Propagation: Errors in one swarm could potentially affect other swarms or the entire HiveMind. - -Mitigation: Implement robust error handling and isolation mechanisms. Errors in one swarm should not affect the operation of other swarms. - -Complexity: The HiveMind class is complex and could be difficult to maintain and extend. - -Mitigation: Follow best practices for software design, such as modularity, encapsulation, and separation of concerns. Write comprehensive tests to catch issues early. - -User Experience: If the HiveMind class is not easy to use, it could deter potential users. - -Mitigation: Provide clear documentation and examples. Implement a user-friendly API. Consider providing a high-level interface that abstracts away some of the complexity. - -Mental Models and Design Paradigms -Modularity: Each swarm should be a self-contained unit that can operate independently. This makes the system more flexible and easier to maintain. - -Concurrency: The system should be designed to handle multiple swarms running concurrently. This requires careful consideration of issues such as data consistency and synchronization. - -Fault Tolerance: The system should be able to handle errors gracefully. If one swarm encounters an error, it should not affect the operation of other swarms. - -Scalability: The system should be able to handle an increasing number of swarms without a significant degradation in performance. - -User-Centric Design: The system should be designed with the user in mind. It should be easy to use and provide value to the user. - -Path to Product-Market Fit -Identify Target Users: Determine who would benefit most from using the HiveMind class. This could be developers, data scientists, researchers, or businesses. - -Understand User Needs: Conduct user research to understand the problems that users are trying to solve and how the HiveMind class can help. - -Develop MVP: Develop a minimum viable product (MVP) that demonstrates the value of the HiveMind class. This should be a simple version of the product that solves a core user problem. - -Gather Feedback: After releasing the MVP, gather feedback from users. This could be through surveys, interviews, or user testing. - -Iterate and Improve: Use the feedback to iterate and improve the product. This could involve fixing bugs, adding new features, or improving usability. - -Scale: Once the product has achieved product-market fit, focus on scaling. This could involve optimizing the product for performance, expanding to new markets, or developing partnerships. - - - -Here are some features that could be added to the HiveMind class to provide maximum value for users: - -Dynamic Scaling: The ability to automatically scale the number of swarms based on the complexity of the task or the load on the system. This would allow the system to handle a wide range of tasks efficiently. - -Task Prioritization: The ability to prioritize tasks based on their importance or urgency. This would allow more important tasks to be completed first. - -Progress Monitoring: The ability for users to monitor the progress of their tasks. This could include a progress bar, estimated completion time, or real-time updates. - -Error Reporting: Detailed error reports that help users understand what went wrong if a task fails. This could include the error message, the swarm that encountered the error, and suggestions for how to fix the error. - -Task Cancellation: The ability for users to cancel a task that is currently being processed. This could be useful if a user realizes they made a mistake or if a task is taking too long to complete. - -Task Queuing: The ability for users to queue up multiple tasks. This would allow users to submit a batch of tasks and have them processed one after the other. - -Result Formatting: The ability for users to specify how they want the results to be formatted. This could include options for plain text, JSON, XML, or other formats. - -Integration with Other Services: The ability to integrate with other services, such as databases, cloud storage, or machine learning platforms. This would allow users to easily store results, access additional resources, or leverage advanced features. - -Security Features: Features to ensure the security and privacy of user data, such as encryption, access controls, and audit logs. - -User-Friendly API: A well-designed, user-friendly API that makes it easy for users to use the HiveMind class in their own applications. This could include clear documentation, examples, and error messages. diff --git a/docs/old-docs/ideas/IDEAS.MD b/docs/old-docs/ideas/IDEAS.MD deleted file mode 100644 index bc2514b1a..000000000 --- a/docs/old-docs/ideas/IDEAS.MD +++ /dev/null @@ -1,401 +0,0 @@ -## Swarming Architectures - -Here are three examples of swarming architectures that could be applied in this context. - -1. **Hierarchical Swarms**: In this architecture, a 'lead' agent coordinates the efforts of other agents, distributing tasks based on each agent's unique strengths. The lead agent might be equipped with additional functionality or decision-making capabilities to effectively manage the swarm. - -2. **Collaborative Swarms**: Here, each agent in the swarm works in parallel, potentially on different aspects of a task. They then collectively determine the best output, often through a voting or consensus mechanism. - -3. **Competitive Swarms**: In this setup, multiple agents work on the same task independently. The output from the agent which produces the highest confidence or quality result is then selected. This can often lead to more robust outputs, as the competition drives each agent to perform at its best. - -4. **Multi-Agent Debate**: Here, multiple agents debate a topic. The output from the agent which produces the highest confidence or quality result is then selected. This can lead to more robust outputs, as the competition drives each agent to perform it's best. - - -# Ideas - -A swarm, particularly in the context of distributed computing, refers to a large number of coordinated agents or nodes that work together to solve a problem. The specific requirements of a swarm might vary depending on the task at hand, but some of the general requirements include: - -1. **Distributed Nature**: The swarm should consist of multiple individual units or nodes, each capable of functioning independently. - -2. **Coordination**: The nodes in the swarm need to coordinate with each other to ensure they're working together effectively. This might involve communication between nodes, or it could be achieved through a central orchestrator. - -3. **Scalability**: A well-designed swarm system should be able to scale up or down as needed, adding or removing nodes based on the task load. - -4. **Resilience**: If a node in the swarm fails, it shouldn't bring down the entire system. Instead, other nodes should be able to pick up the slack. - -5. **Load Balancing**: Tasks should be distributed evenly across the nodes in the swarm to avoid overloading any single node. - -6. **Interoperability**: Each node should be able to interact with others, regardless of differences in underlying hardware or software. - -Integrating these requirements with Large Language Models (LLMs) can be done as follows: - -1. **Distributed Nature**: Each LLM agent can be considered as a node in the swarm. These agents can be distributed across multiple servers or even geographically dispersed data centers. - -2. **Coordination**: An orchestrator can manage the LLM agents, assigning tasks, coordinating responses, and ensuring effective collaboration between agents. - -3. **Scalability**: As the demand for processing power increases or decreases, the number of LLM agents can be adjusted accordingly. - -4. **Resilience**: If an LLM agent goes offline or fails, the orchestrator can assign its tasks to other agents, ensuring the swarm continues functioning smoothly. - -5. **Load Balancing**: The orchestrator can also handle load balancing, ensuring tasks are evenly distributed amongst the LLM agents. - -6. **Interoperability**: By standardizing the input and output formats of the LLM agents, they can effectively communicate and collaborate, regardless of the specific model or configuration of each agent. - -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. - - -## Communication Layer - -Communication layers play a critical role in distributed systems, enabling interaction between different nodes (agents) and the orchestrator. Here are three potential communication layers for a distributed system, including their strengths and weaknesses: - -1. **Message Queuing Systems (like RabbitMQ, Kafka)**: - - - Strengths: They are highly scalable, reliable, and designed for high-throughput systems. They also ensure delivery of messages and can persist them if necessary. Furthermore, they support various messaging patterns like publish/subscribe, which can be highly beneficial in a distributed system. They also have robust community support. - - - Weaknesses: They can add complexity to the system, including maintenance of the message broker. Moreover, they require careful configuration to perform optimally, and handling failures can sometimes be challenging. - -2. **RESTful APIs**: - - - Strengths: REST is widely adopted, and most programming languages have libraries to easily create RESTful APIs. They leverage standard HTTP(S) protocols and methods and are straightforward to use. Also, they can be stateless, meaning each request contains all the necessary information, enabling scalability. - - - Weaknesses: For real-time applications, REST may not be the best fit due to its synchronous nature. Additionally, handling a large number of API requests can put a strain on the system, causing slowdowns or timeouts. - -3. **gRPC (Google Remote Procedure Call)**: - - - Strengths: gRPC uses Protocol Buffers as its interface definition language, leading to smaller payloads and faster serialization/deserialization compared to JSON (commonly used in RESTful APIs). It supports bidirectional streaming and can use HTTP/2 features, making it excellent for real-time applications. - - - Weaknesses: gRPC is more complex to set up compared to REST. Protocol Buffers' binary format can be more challenging to debug than JSON. It's also not as widely adopted as REST, so tooling and support might be limited in some environments. - -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. - - - - -# Technical Analysis Document: Particle Swarm of AI Agents using Ocean Database - -## Overview - -The goal is to create a particle swarm of AI agents using the OpenAI API for the agents and the Ocean database as the communication space, where the embeddings act as particles. The swarm will work collectively to perform tasks and optimize their behavior based on the interaction with the Ocean database. - -## Algorithmic Overview - -1. Initialize the AI agents and the Ocean database. -2. Assign tasks to the AI agents. -3. AI agents use the OpenAI API to perform tasks and generate embeddings. -4. AI agents store their embeddings in the Ocean database. -5. AI agents query the Ocean database for relevant embeddings. -6. AI agents update their positions based on the retrieved embeddings. -7. Evaluate the performance of the swarm and update the agents' behavior accordingly. -8. Repeat steps 3-7 until a stopping criterion is met. - -## Python Implementation Logic - -1. **Initialize the AI agents and the Ocean database.** - -```python -import openai -import oceandb -from oceandb.utils.embedding_functions import ImageBindEmbeddingFunction - -# Initialize Ocean database -client = oceandb.Client() -text_embedding_function = ImageBindEmbeddingFunction(modality="text") -collection = client.create_collection("all-my-documents", embedding_function=text_embedding_function) - -# Initialize AI agents -agents = initialize_agents(...) -``` - -2. **Assign tasks to the AI agents.** - -```python -tasks = assign_tasks_to_agents(agents, ...) -``` - -3. **AI agents use the OpenAI API to perform tasks and generate embeddings.** - -```python -def agent_perform_task(agent, task): - # Perform the task using the OpenAI API - result = perform_task_with_openai_api(agent, task) - # Generate the embedding - embedding = generate_embedding(result) - return embedding - -embeddings = [agent_perform_task(agent, task) for agent, task in zip(agents, tasks)] -``` - -4. **AI agents store their embeddings in the Ocean database.** - -```python -def store_embeddings_in_database(embeddings, collection): - for i, embedding in enumerate(embeddings): - document_id = f"agent_{i}" - collection.add(documents=[embedding], ids=[document_id]) - -store_embeddings_in_database(embeddings, collection) -``` - -5. **AI agents query the Ocean database for relevant embeddings.** - -```python -def query_database_for_embeddings(agent, collection, n_results=1): - query_result = collection.query(query_texts=[agent], n_results=n_results) - return query_result - -queried_embeddings = [query_database_for_embeddings(agent, collection) for agent in agents] -``` - -6. **AI agents update their positions based on the retrieved embeddings.** - -```python -def update_agent_positions(agents, queried_embeddings): - for agent, embedding in zip(agents, queried_embeddings): - agent.update_position(embedding) - -update_agent_positions(agents, queried_embeddings) -``` - -7. **Evaluate the performance of the swarm and update the agents' behavior accordingly.** - -```python -def evaluate_swarm_performance(agents, ...): - # Evaluate the performance of the swarm - performance = compute_performance_metric(agents, ...) - return performance - -def update_agent_behavior(agents, performance): - # Update agents' behavior based on swarm performance - for agent in agents: - agent.adjust_behavior(performance) - -performance = evaluate_swarm_performance(agents, ...) -update_agent_behavior(agents, performance) -``` - -8. **Repeat steps 3-7 until a stopping criterion is met.** - -```python -while not stopping_criterion_met(): - # Perform tasks and generate embeddings - embeddings = [agent_perform_task(agent, task) for agent, task in zip(agents, tasks)] - - # Store embeddings in the Ocean database - store_embeddings_in_database(embeddings, collection) - - # Query the Ocean database for relevant embeddings - queried_embeddings = [query_database_for_embeddings(agent, collection) for agent in agents] - - # Update AI agent positions based on the retrieved embeddings - update_agent_positions(agents, queried_embeddings) - - # Evaluate the performance of the swarm and update the agents' behavior accordingly - performance = evaluate_swarm_performance(agents, ...) - update_agent_behavior(agents, performance) -``` - -This code demonstrates the complete loop to repeat steps 3-7 until a stopping criterion is met. You will need to define the `stopping_criterion_met()` function, which could be based on a predefined number of iterations, a target performance level, or any other condition that indicates that the swarm has reached a desired state. - - - - -* Integrate petals to handle huggingface LLM - - - -# 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. - - - -* Handling absurdly long sequences => first transform the objective if it's more than 1000tokens into a txt file similiar to how Claude works => then chunk it into sizes of 8000 seq length embeddings => then embed it and store in the vector database => then connext the agent model to it - - -Given the complexity of the topic, please note that these simplified markdown documents are quite abstract and high level. They can be used as a starting point for further detailed design and implementation: - -### Document 1: Hierarchical Swarms - -#### Overall Architecture - -1. Leader Agent (LA): This agent has the authority to manage and distribute tasks to the Worker Agents (WA). -2. Worker Agents (WAs): These agents perform the tasks assigned by the LA. - -#### Simplified Requirements - -1. LA should be able to distribute tasks to WAs. -2. WAs should be able to execute tasks and return results to LA. -3. LA should be able to consolidate and process results. - -#### Pseudocode - -``` -create LA -create WAs - -for each task in tasks: - LA.distribute_task(WAs, task) - - for each WA in WAs: - WA.execute_task() - - LA.collect_results(WAs) - -LA.process_results() -``` - -#### General Classes - -```python -class LeaderAgent: - def distribute_task(self, WAs, task): - pass - - def collect_results(self, WAs): - pass - - def process_results(self): - pass - -class WorkerAgent: - def execute_task(self): - pass -``` - -### Document 2: Collaborative Swarms - -#### Overall Architecture - -1. Collaborative Agents (CAs): These agents work in parallel on different aspects of a task and then collectively determine the best output. - -#### Simplified Requirements - -1. CAs should be able to work on tasks in parallel. -2. CAs should be able to collaborate to determine the best result. - -#### Pseudocode - -``` -create CAs - -for each task in tasks: - for each CA in CAs: - CA.execute_task(task) - - CA.collaborate() -``` - -#### General Classes - -```python -class CollaborativeAgent: - def execute_task(self, task): - pass - - def collaborate(self): - pass -``` - -### Document 3: Competitive Swarms - -#### Overall Architecture - -1. Competitive Agents (CompAs): These agents work independently on the same tasks, and the best result is selected. - -#### Simplified Requirements - -1. CompAs should be able to work independently on tasks. -2. An evaluation method should be used to select the best result. - -#### Pseudocode - -``` -create CompAs - -for each task in tasks: - for each CompA in CompAs: - CompA.execute_task(task) - -evaluate_results(CompAs) -``` - -#### General Classes - -```python -class CompetitiveAgent: - def execute_task(self, task): - pass - -def evaluate_results(CompAs): - pass -``` - -Note: In the real world, the complexity of the architecture and requirements will significantly exceed what is presented here. These examples provide a basic starting point but should be expanded upon based on the specifics of the task or problem you're trying to solve. - - - -# Swarms - -BabyAGI -> Autogpt's -> tools -> other agents - -- Host it on server, on premise, private learning, no learning is translating out -- companies are sensitive with data, models are firewalled, need privacy, huggingface, -- Does not transmit information, -- see agent activity, task history, - - optimize which agents for each task -- Assist or provide feedback to management agent -- overview see the whole swarm, modify each agent, visualize the communication stream with blue, -- Work optimization routines -- output monitoring -- stop output, agent looping, --quality assurance checker, adversarial agent -- see a holistic diagram of all agents, how are they being utilized, see number of iterations, query responses, balance loading, -- summary of tasks completed with critique, type of summary, ceo summary, manager summary -- outside of browser and accross whole operating system, switch apps, mac, linux, and windows --what are the skillsets behind the dev team, can be modified by experts, ui agent, manager agent, personalize agents with prompt and tools, and orca like explain your solutions, critique them then return the final output - - - - diff --git a/docs/old-docs/ideas/PLATFORMS.md b/docs/old-docs/ideas/PLATFORMS.md deleted file mode 100644 index d0c53f8a1..000000000 --- a/docs/old-docs/ideas/PLATFORMS.md +++ /dev/null @@ -1,11 +0,0 @@ -* The Platform, where users can have a conversation with the domain - -* An developer platform where people can build swarms through a UI in nodes, connect and play - -* SIMS like UI, where you see every node accomplishing their tasks around the internet - -* Swarms Discord BOT - -* PAID API - -* MARKETPLACE FOR PREBUILT SWARMS WITH SPECIFIC PROMPTS, MODELS, TOOLS, AND MEMORIES, \ No newline at end of file diff --git a/docs/old-docs/ideas/SWARMSOS.md b/docs/old-docs/ideas/SWARMSOS.md deleted file mode 100644 index 11e6b5354..000000000 --- a/docs/old-docs/ideas/SWARMSOS.md +++ /dev/null @@ -1,42 +0,0 @@ -Research Proposal: Creating a Swarm of LLM Agents for Operating Systems -Introduction -The goal of this research is to explore the feasibility and requirements of creating a swarm of Language Learning Model (LLM) agents that can autonomously operate the kernel of an operating system. This swarm of AI agents would be capable of performing tasks such as process scheduling, memory management, device management, and system calls, among others. - -Objectives -To investigate the feasibility of using LLM agents to autonomously operate the kernel of an operating system. -To identify the requirements and challenges of implementing such a system. -To develop a prototype system as a proof of concept. -Methodology -Literature Review: Conduct a comprehensive review of existing research on AI in operating systems, swarm intelligence, and LLMs. - -Feasibility Study: Analyze the capabilities of current LLMs and assess whether they can be adapted to operate an OS kernel. - -Requirement Analysis: Identify the hardware, software, and data requirements for implementing a swarm of LLM agents in an OS. - -System Design: Design a prototype system that uses LLM agents to perform basic kernel operations. - -Implementation and Testing: Implement the prototype system and conduct rigorous testing to evaluate its performance. - -Requirements -Hardware: A high-performance computing system would be required to handle the computational load of millions of LLM agents. This system would need to have a powerful CPU, a large amount of RAM, and possibly a GPU for machine learning tasks. - -Software: The system would require an operating system that is compatible with the LLM agents. This could be a popular OS like Linux, which is open-source and widely used in AI research. - -LLM Agents: The LLM agents would need to be trained to perform kernel operations. This would require a large dataset of kernel operations and their outcomes. - -Swarm Intelligence Framework: A framework for swarm intelligence would be needed to manage the LLM agents and coordinate their activities. - -Monitoring and Debugging Tools: Tools for monitoring the performance of the LLM agents and debugging any issues would be essential. - -Potential Challenges -Complexity of Kernel Operations: Kernel operations are complex and low-level. Training LLM agents to perform these operations accurately and efficiently could be challenging. - -Coordination of LLM Agents: Coordinating the activities of millions of LLM agents could be a complex task. The swarm intelligence framework would need to be robust and efficient. - -Security: The system would need to be secure to prevent unauthorized access and ensure the integrity of the kernel operations. - -Performance: The system would need to be able to handle a high load and perform operations quickly to avoid slowing down the OS. - -Conclusion -Creating a swarm of LLM agents for operating systems is a challenging but potentially rewarding endeavor. This research aims to explore the feasibility of this idea and identify the requirements for its implementation. If successful, this could open up new possibilities for AI in operating systems and beyond. - diff --git a/docs/old-docs/ideas/aug13.md b/docs/old-docs/ideas/aug13.md deleted file mode 100644 index e14c36dac..000000000 --- a/docs/old-docs/ideas/aug13.md +++ /dev/null @@ -1,78 +0,0 @@ -## **Product Feature Document: Multi-Agent Distributed Collaboration Framework** - ---- - -**Introduction**: -In a world increasingly leaning towards automation, we present a framework to enable multi-agent distributed collaboration. This revolutionary approach, integrating millions of GPT-3 nodes, is set to redefine real-world task automation. This document outlines and prioritizes features based on their potential value to early adopters. - ---- - -### **1. Learning Enhancements** - -- **Private Learning**: Safeguard data and learn without transmitting sensitive information. - *Value Proposition*: Guarantees data security for enterprises dealing with sensitive information. - -- **Task Decomposition**: Algorithms to efficiently break down complex tasks into simpler sub-tasks for agent distribution. - *Value Proposition*: Simplifies problem-solving and ensures efficient task distribution among agents. - ---- - -### **2. Swarm Management & Performance** - -- **Swarm Benchmarks**: Establish performance benchmarks for swarms, providing users with expected efficiency and accuracy metrics. - *Value Proposition*: Allows users to anticipate swarm performance and adjust strategies accordingly. - -- **Swarm Classes & Modularity**: Create diverse classes of swarms based on task type, ensuring a high level of usability and flexibility. - *Value Proposition*: Customizable swarms tailored to specific problem sets, enhancing solution accuracy. - -- **Dictator Swarm Mode**: Centralized control for swarms for tasks that require uniformity and synchronization. - *Value Proposition*: Streamlines processes where coordination is key. - ---- - -### **3. Communication & Progress Tracking** - -- **Progress Posting Tool**: Equip agents with a tool to post their progress to a swarm-wide vector store. - *Value Proposition*: Real-time tracking of task progress and agent efficiency. - -- **Observer Agent**: A supervisory agent dedicated to preventing others from entering non-productive loops. - *Value Proposition*: Ensures optimal agent performance and minimizes wastage of computational resources. - ---- - -### **4. Tool Integration & Modularity** - -- **Easy Tool Integration**: Simplified interfaces to add or modify tools within the swarm. - *Value Proposition*: Augment swarm capabilities on-the-go, adapting to diverse tasks with ease. - -- **Vector Database for Tools**: Maintain a comprehensive database of tools, allowing agents to query and utilize as needed. - *Value Proposition*: Provides agents with a vast arsenal of tools to tackle various challenges, enhancing problem-solving capacity. - ---- - -### **5. Data Input & Multimodality** - -- **Multimodal Data Intake**: Enable swarms to process varied data types – text, images, sounds, and more. - *Value Proposition*: Broadens the range of tasks swarms can handle, from simple text-based queries to complex multimedia projects. - ---- - -### **Feature Priority (for early adopters)**: - -1. **Private Learning**: Data privacy remains paramount. -2. **Task Decomposition**: Efficient problem-solving is foundational. -3. **Swarm Benchmarks**: Understanding potential performance is essential for user trust. -4. **Progress Posting Tool**: Real-time updates increase confidence and allow for timely interventions. -5. **Multimodal Data Intake**: Increases the range and depth of tasks the framework can handle. -6. **Observer Agent**: Minimizing wastage is key to cost efficiency. -7. **Easy Tool Integration**: Enhancing adaptability for varied challenges. -8. **Swarm Classes & Modularity**: Customization ensures relevance to specific user needs. -9. **Dictator Swarm Mode**: Essential for tasks demanding synchronization. -10. **Vector Database for Tools**: Augments the swarms' problem-solving arsenal. - ---- - -**Conclusion**: -With these prioritized features, our framework promises not only to revolutionize task automation but also to deliver unmatched value to its earliest users. This is the dawn of a new era in AI collaboration, and we invite you to be a part of this journey. - -**Join the future of AI automation. Step into the swarm.** \ No newline at end of file diff --git a/docs/old-docs/ideas/aug16.md b/docs/old-docs/ideas/aug16.md deleted file mode 100644 index bcd53bbe1..000000000 --- a/docs/old-docs/ideas/aug16.md +++ /dev/null @@ -1,80 +0,0 @@ -## **Product Feature Document: Multi-Agent Distributed Collaboration Framework** - ---- - -**Introduction**: -In the modern age of AI, the potential of harnessing multiple intelligent agents to automate real-world tasks offers unprecedented value. We're building a framework that enables multi-agent distributed collaboration, akin to working with millions of GPT-3 nodes, and this document outlines the features which will bring tremendous value to early adopters. - ---- - -**1. Data Security & Privacy** -- **On-Premise Hosting**: Users can deploy the framework on their server to ensure data doesn't leave their ecosystem. -- **Private Learning**: The agents can learn without transmitting sensitive data out. -- **Firewalled Models**: Ensures that all model data remains secured behind barriers, preventing unauthorized data access. -- **HuggingFace Integration**: For those comfortable with the HuggingFace ecosystem. -- **Transparency**: Ability to see agent activity, task history, which aids in accountability. - ---- - -**2. Agent & Swarm Management** -- **Optimized Task Allocation**: System can decide which agents are best suited for each task, based on their learning and past performance. -- **Agent Feedback System**: Enables users to assist or provide feedback to the managing agent. -- **Holistic Swarm View**: Visualize the entire swarm, the communication streams, and individually modify agent behavior. -- **Work Optimization**: Routines to determine the most efficient distribution of tasks amongst agents. -- **Quality Assurance Agent**: A specialized agent to ensure the outputs meet the required standards. - ---- - -**3. Output Management & Monitoring** -- **Stop Looping**: If an agent gets stuck in a task loop, the system can intervene. -- **Output Monitoring**: Real-time surveillance of what each agent produces. -- **Task Summaries**: An overview of tasks, tailored to different management levels (CEO summary, manager summary). - ---- - -**4. Cross-Platform Integration** -- **OS Compatibility**: Seamlessly operate across Mac, Linux, and Windows. -- **Beyond Browser**: Ability to interact with different applications across the entire OS. - ---- - -**5. Customization & Training** -- **Agent Personalization**: Tailor each agent's prompts, tools, and behavior to better fit specific tasks. -- **Training Agent for SMBs**: Simplified input prompting system to guide small-medium businesses. -- **Human Training Agent**: Uses visual aids, questions, and references to train human users. Incorporates meta prompting for dynamic environments. - ---- - -**6. Installation & Deployment** -- **Easy Install Process**: Streamlined installation process, with real-time troubleshooting support. -- **Cloud Setup for Non-GPU**: For those without local GPU, a straightforward cloud setup guide. - ---- - -**7. Advanced Agent Dynamics** -- **Non-Hierarchical Structure**: Worker agents autonomously pick tasks based on their strengths. -- **Knowledge Store**: A separate or integrated system where agents access and augment their knowledge. -- **API Integration**: Ability to easily integrate different APIs like LLM, GPT-4, and Anthropic. - ---- - -**8. Memory & Knowledge Management** -- **Differentiated Memory**: Separate memory storage for individual agents and the entire swarm, aiding in more efficient task delegation and execution. - ---- - -**Events and Workshops (for community involvement & onboarding)** -- **Monthly Webinars**: Dive deep into feature releases, use cases, and best practices. - - **Next Session**: August 25th, 2023 - "Harnessing the Power of Multi-Agent Systems" -- **Quarterly Workshops**: Hands-on sessions for businesses to understand how to best leverage the framework. - - **Upcoming Workshop**: September 15th-17th, 2023 - "Optimizing Agent Performance for Business Tasks" -- **Annual Swarm Conclave**: A grand gathering of all community members, developers, and businesses to discuss future roadmaps and celebrate successes. - - **Swarm Conclave 2023**: December 2nd-4th, 2023, San Francisco, CA. - ---- - -**Conclusion**: -This framework is not merely a technological tool, but a step into the future of collaborative AI. By combining the strengths of multiple intelligent agents, we can redefine how businesses operate, innovate, and grow. - -**Join the revolution. Become part of Agora.** -[**Discord Link**](https://discord.gg/qUtxnK2NMf) \ No newline at end of file diff --git a/docs/old-docs/research/AGENTS.md b/docs/old-docs/research/AGENTS.md deleted file mode 100644 index d55adc97a..000000000 --- a/docs/old-docs/research/AGENTS.md +++ /dev/null @@ -1,522 +0,0 @@ -LLM Powered Autonomous Agents -============================= - -June 23, 2023 · 31 min · Lilian Weng - -Table of Contents - -* [Agent System Overview](#agent-system-overview) -* [Component One: Planning](#component-one-planning) - * [Task Decomposition](#task-decomposition) - * [Self-Reflection](#self-reflection) -* [Component Two: Memory](#component-two-memory) - * [Types of Memory](#types-of-memory) - * [Maximum Inner Product Search (MIPS)](#maximum-inner-product-search-mips) -* [Component Three: Tool Use](#component-three-tool-use) -* [Case Studies](#case-studies) - * [Scientific Discovery Agent](#scientific-discovery-agent) - * [Generative Agents Simulation](#generative-agents-simulation) - * [Proof-of-Concept Examples](#proof-of-concept-examples) -* [Challenges](#challenges) -* [Citation](#citation) -* [References](#references) - -Building agents with LLM (large language model) as its core controller is a cool concept. Several proof-of-concepts demos, such as [AutoGPT](https://github.com/Significant-Gravitas/Auto-GPT), [GPT-Engineer](https://github.com/AntonOsika/gpt-engineer) and [BabyAGI](https://github.com/yoheinakajima/babyagi), serve as inspiring examples. The potentiality of LLM extends beyond generating well-written copies, stories, essays and programs; it can be framed as a powerful general problem solver. - -Agent System Overview[#](#agent-system-overview) -================================================ - -In a LLM-powered autonomous agent system, LLM functions as the agent’s brain, complemented by several key components: - -* **Planning** - * Subgoal and decomposition: The agent breaks down large tasks into smaller, manageable subgoals, enabling efficient handling of complex tasks. - * Reflection and refinement: The agent can do self-criticism and self-reflection over past actions, learn from mistakes and refine them for future steps, thereby improving the quality of final results. -* **Memory** - * Short-term memory: I would consider all the in-context learning (See [Prompt Engineering](https://lilianweng.github.io/posts/2023-03-15-prompt-engineering/)) as utilizing short-term memory of the model to learn. - * Long-term memory: This provides the agent with the capability to retain and recall (infinite) information over extended periods, often by leveraging an external vector store and fast retrieval. -* **Tool use** - * The agent learns to call external APIs for extra information that is missing from the model weights (often hard to change after pre-training), including current information, code execution capability, access to proprietary information sources and more. - -![](agent-overview.png) - -Fig. 1. Overview of a LLM-powered autonomous agent system. - -Component One: Planning[#](#component-one-planning) -=================================================== - -A complicated task usually involves many steps. An agent needs to know what they are and plan ahead. - -Task Decomposition[#](#task-decomposition) ------------------------------------------- - -[**Chain of thought**](https://lilianweng.github.io/posts/2023-03-15-prompt-engineering/#chain-of-thought-cot) (CoT; [Wei et al. 2022](https://arxiv.org/abs/2201.11903)) has become a standard prompting technique for enhancing model performance on complex tasks. The model is instructed to “think step by step” to utilize more test-time computation to decompose hard tasks into smaller and simpler steps. CoT transforms big tasks into multiple manageable tasks and shed lights into an interpretation of the model’s thinking process. - -**Tree of Thoughts** ([Yao et al. 2023](https://arxiv.org/abs/2305.10601)) extends CoT by exploring multiple reasoning possibilities at each step. It first decomposes the problem into multiple thought steps and generates multiple thoughts per step, creating a tree structure. The search process can be BFS (breadth-first search) or DFS (depth-first search) with each state evaluated by a classifier (via a prompt) or majority vote. - -Task decomposition can be done (1) by LLM with simple prompting like `"Steps for XYZ.\n1."`, `"What are the subgoals for achieving XYZ?"`, (2) by using task-specific instructions; e.g. `"Write a story outline."` for writing a novel, or (3) with human inputs. - -Another quite distinct approach, **LLM+P** ([Liu et al. 2023](https://arxiv.org/abs/2304.11477)), involves relying on an external classical planner to do long-horizon planning. This approach utilizes the Planning Domain Definition Language (PDDL) as an intermediate interface to describe the planning problem. In this process, LLM (1) translates the problem into “Problem PDDL”, then (2) requests a classical planner to generate a PDDL plan based on an existing “Domain PDDL”, and finally (3) translates the PDDL plan back into natural language. Essentially, the planning step is outsourced to an external tool, assuming the availability of domain-specific PDDL and a suitable planner which is common in certain robotic setups but not in many other domains. - -Self-Reflection[#](#self-reflection) ------------------------------------- - -Self-reflection is a vital aspect that allows autonomous agents to improve iteratively by refining past action decisions and correcting previous mistakes. It plays a crucial role in real-world tasks where trial and error are inevitable. - -**ReAct** ([Yao et al. 2023](https://arxiv.org/abs/2210.03629)) integrates reasoning and acting within LLM by extending the action space to be a combination of task-specific discrete actions and the language space. The former enables LLM to interact with the environment (e.g. use Wikipedia search API), while the latter prompting LLM to generate reasoning traces in natural language. - -The ReAct prompt template incorporates explicit steps for LLM to think, roughly formatted as: - - Thought: ... - Action: ... - Observation: ... - ... (Repeated many times) - - -![](react.png) - -Fig. 2. Examples of reasoning trajectories for knowledge-intensive tasks (e.g. HotpotQA, FEVER) and decision-making tasks (e.g. AlfWorld Env, WebShop). (Image source: [Yao et al. 2023](https://arxiv.org/abs/2210.03629)). - -In both experiments on knowledge-intensive tasks and decision-making tasks, `ReAct` works better than the `Act`\-only baseline where `Thought: …` step is removed. - -**Reflexion** ([Shinn & Labash 2023](https://arxiv.org/abs/2303.11366)) is a framework to equips agents with dynamic memory and self-reflection capabilities to improve reasoning skills. Reflexion has a standard RL setup, in which the reward model provides a simple binary reward and the action space follows the setup in ReAct where the task-specific action space is augmented with language to enable complex reasoning steps. After each action at, the agent computes a heuristic ht and optionally may _decide to reset_ the environment to start a new trial depending on the self-reflection results. - -![](reflexion.png) - -Fig. 3. Illustration of the Reflexion framework. (Image source: [Shinn & Labash, 2023](https://arxiv.org/abs/2303.11366)) - -The heuristic function determines when the trajectory is inefficient or contains hallucination and should be stopped. Inefficient planning refers to trajectories that take too long without success. Hallucination is defined as encountering a sequence of consecutive identical actions that lead to the same observation in the environment. - -Self-reflection is created by showing two-shot examples to LLM and each example is a pair of (failed trajectory, ideal reflection for guiding future changes in the plan). Then reflections are added into the agent’s working memory, up to three, to be used as context for querying LLM. - -![](reflexion-exp.png) - -Fig. 4. Experiments on AlfWorld Env and HotpotQA. Hallucination is a more common failure than inefficient planning in AlfWorld. (Image source: [Shinn & Labash, 2023](https://arxiv.org/abs/2303.11366)) - -**Chain of Hindsight** (CoH; [Liu et al. 2023](https://arxiv.org/abs/2302.02676)) encourages the model to improve on its own outputs by explicitly presenting it with a sequence of past outputs, each annotated with feedback. Human feedback data is a collection of Dh\={(x,yi,ri,zi)}i\=1n, where x is the prompt, each yi is a model completion, ri is the human rating of yi, and zi is the corresponding human-provided hindsight feedback. Assume the feedback tuples are ranked by reward, rn≥rn−1≥⋯≥r1 The process is supervised fine-tuning where the data is a sequence in the form of τh\=(x,zi,yi,zj,yj,…,zn,yn), where ≤i≤j≤n. The model is finetuned to only predict yn where conditioned on the sequence prefix, such that the model can self-reflect to produce better output based on the feedback sequence. The model can optionally receive multiple rounds of instructions with human annotators at test time. - -To avoid overfitting, CoH adds a regularization term to maximize the log-likelihood of the pre-training dataset. To avoid shortcutting and copying (because there are many common words in feedback sequences), they randomly mask 0% - 5% of past tokens during training. - -The training dataset in their experiments is a combination of [WebGPT comparisons](https://huggingface.co/datasets/openai/webgpt_comparisons), [summarization from human feedback](https://github.com/openai/summarize-from-feedback) and [human preference dataset](https://github.com/anthropics/hh-rlhf). - -![](CoH.png) - -Fig. 5. After fine-tuning with CoH, the model can follow instructions to produce outputs with incremental improvement in a sequence. (Image source: [Liu et al. 2023](https://arxiv.org/abs/2302.02676)) - -The idea of CoH is to present a history of sequentially improved outputs in context and train the model to take on the trend to produce better outputs. **Algorithm Distillation** (AD; [Laskin et al. 2023](https://arxiv.org/abs/2210.14215)) applies the same idea to cross-episode trajectories in reinforcement learning tasks, where an _algorithm_ is encapsulated in a long history-conditioned policy. Considering that an agent interacts with the environment many times and in each episode the agent gets a little better, AD concatenates this learning history and feeds that into the model. Hence we should expect the next predicted action to lead to better performance than previous trials. The goal is to learn the process of RL instead of training a task-specific policy itself. - -![](algorithm-distillation.png) - -Fig. 6. Illustration of how Algorithm Distillation (AD) works. -(Image source: [Laskin et al. 2023](https://arxiv.org/abs/2210.14215)). - -The paper hypothesizes that any algorithm that generates a set of learning histories can be distilled into a neural network by performing behavioral cloning over actions. The history data is generated by a set of source policies, each trained for a specific task. At the training stage, during each RL run, a random task is sampled and a subsequence of multi-episode history is used for training, such that the learned policy is task-agnostic. - -In reality, the model has limited context window length, so episodes should be short enough to construct multi-episode history. Multi-episodic contexts of 2-4 episodes are necessary to learn a near-optimal in-context RL algorithm. The emergence of in-context RL requires long enough context. - -In comparison with three baselines, including ED (expert distillation, behavior cloning with expert trajectories instead of learning history), source policy (used for generating trajectories for distillation by [UCB](https://lilianweng.github.io/posts/2018-01-23-multi-armed-bandit/#upper-confidence-bounds)), RL^2 ([Duan et al. 2017](https://arxiv.org/abs/1611.02779); used as upper bound since it needs online RL), AD demonstrates in-context RL with performance getting close to RL^2 despite only using offline RL and learns much faster than other baselines. When conditioned on partial training history of the source policy, AD also improves much faster than ED baseline. - -![](algorithm-distillation-results.png) - -Fig. 7. Comparison of AD, ED, source policy and RL^2 on environments that require memory and exploration. Only binary reward is assigned. The source policies are trained with [A3C](https://lilianweng.github.io/posts/2018-04-08-policy-gradient/#a3c) for "dark" environments and [DQN](http://lilianweng.github.io/posts/2018-02-19-rl-overview/#deep-q-network) for watermaze. -(Image source: [Laskin et al. 2023](https://arxiv.org/abs/2210.14215)) - -Component Two: Memory[#](#component-two-memory) -=============================================== - -(Big thank you to ChatGPT for helping me draft this section. I’ve learned a lot about the human brain and data structure for fast MIPS in my [conversations](https://chat.openai.com/share/46ff149e-a4c7-4dd7-a800-fc4a642ea389) with ChatGPT.) - -Types of Memory[#](#types-of-memory) ------------------------------------- - -Memory can be defined as the processes used to acquire, store, retain, and later retrieve information. There are several types of memory in human brains. - -1. **Sensory Memory**: This is the earliest stage of memory, providing the ability to retain impressions of sensory information (visual, auditory, etc) after the original stimuli have ended. Sensory memory typically only lasts for up to a few seconds. Subcategories include iconic memory (visual), echoic memory (auditory), and haptic memory (touch). - -2. **Short-Term Memory** (STM) or **Working Memory**: It stores information that we are currently aware of and needed to carry out complex cognitive tasks such as learning and reasoning. Short-term memory is believed to have the capacity of about 7 items ([Miller 1956](psychclassics.yorku.ca/Miller/)) and lasts for 20-30 seconds. - -3. **Long-Term Memory** (LTM): Long-term memory can store information for a remarkably long time, ranging from a few days to decades, with an essentially unlimited storage capacity. There are two subtypes of LTM: - - * Explicit / declarative memory: This is memory of facts and events, and refers to those memories that can be consciously recalled, including episodic memory (events and experiences) and semantic memory (facts and concepts). - * Implicit / procedural memory: This type of memory is unconscious and involves skills and routines that are performed automatically, like riding a bike or typing on a keyboard. - -![](memory.png) - -Fig. 8. Categorization of human memory. - -We can roughly consider the following mappings: - -* Sensory memory as learning embedding representations for raw inputs, including text, image or other modalities; -* Short-term memory as in-context learning. It is short and finite, as it is restricted by the finite context window length of Transformer. -* Long-term memory as the external vector store that the agent can attend to at query time, accessible via fast retrieval. - -Maximum Inner Product Search (MIPS)[#](#maximum-inner-product-search-mips) --------------------------------------------------------------------------- - -The external memory can alleviate the restriction of finite attention span. A standard practice is to save the embedding representation of information into a vector store database that can support fast maximum inner-product search ([MIPS](https://en.wikipedia.org/wiki/Maximum_inner-product_search)). To optimize the retrieval speed, the common choice is the _approximate nearest neighbors (ANN)​_ algorithm to return approximately top k nearest neighbors to trade off a little accuracy lost for a huge speedup. - -A couple common choices of ANN algorithms for fast MIPS: - -* [**LSH**](https://en.wikipedia.org/wiki/Locality-sensitive_hashing) (Locality-Sensitive Hashing): It introduces a _hashing_ function such that similar input items are mapped to the same buckets with high probability, where the number of buckets is much smaller than the number of inputs. -* [**ANNOY**](https://github.com/spotify/annoy) (Approximate Nearest Neighbors Oh Yeah): The core data structure are _random projection trees_, a set of binary trees where each non-leaf node represents a hyperplane splitting the input space into half and each leaf stores one data point. Trees are built independently and at random, so to some extent, it mimics a hashing function. ANNOY search happens in all the trees to iteratively search through the half that is closest to the query and then aggregates the results. The idea is quite related to KD tree but a lot more scalable. -* [**HNSW**](https://arxiv.org/abs/1603.09320) (Hierarchical Navigable Small World): It is inspired by the idea of [small world networks](https://en.wikipedia.org/wiki/Small-world_network) where most nodes can be reached by any other nodes within a small number of steps; e.g. “six degrees of separation” feature of social networks. HNSW builds hierarchical layers of these small-world graphs, where the bottom layers contain the actual data points. The layers in the middle create shortcuts to speed up search. When performing a search, HNSW starts from a random node in the top layer and navigates towards the target. When it can’t get any closer, it moves down to the next layer, until it reaches the bottom layer. Each move in the upper layers can potentially cover a large distance in the data space, and each move in the lower layers refines the search quality. -* [**FAISS**](https://github.com/facebookresearch/faiss) (Facebook AI Similarity Search): It operates on the assumption that in high dimensional space, distances between nodes follow a Gaussian distribution and thus there should exist _clustering_ of data points. FAISS applies vector quantization by partitioning the vector space into clusters and then refining the quantization within clusters. Search first looks for cluster candidates with coarse quantization and then further looks into each cluster with finer quantization. -* [**ScaNN**](https://github.com/google-research/google-research/tree/master/scann) (Scalable Nearest Neighbors): The main innovation in ScaNN is _anisotropic vector quantization_. It quantizes a data point xi to x~i such that the inner product ⟨q,xi⟩ is as similar to the original distance of ∠q,x~i as possible, instead of picking the closet quantization centroid points. - -![](mips.png) - -Fig. 9. Comparison of MIPS algorithms, measured in recall@10. (Image source: [Google Blog, 2020](https://ai.googleblog.com/2020/07/announcing-scann-efficient-vector.html)) - -Check more MIPS algorithms and performance comparison in [ann-benchmarks.com](https://ann-benchmarks.com/). - -Component Three: Tool Use[#](#component-three-tool-use) -======================================================= - -Tool use is a remarkable and distinguishing characteristic of human beings. We create, modify and utilize external objects to do things that go beyond our physical and cognitive limits. Equipping LLMs with external tools can significantly extend the model capabilities. - -![](sea-otter.png) - -Fig. 10. A picture of a sea otter using rock to crack open a seashell, while floating in the water. While some other animals can use tools, the complexity is not comparable with humans. (Image source: [Animals using tools](https://www.popularmechanics.com/science/animals/g39714258/animals-using-tools/)) - -**MRKL** ([Karpas et al. 2022](https://arxiv.org/abs/2205.00445)), short for “Modular Reasoning, Knowledge and Language”, is a neuro-symbolic architecture for autonomous agents. A MRKL system is proposed to contain a collection of “expert” modules and the general-purpose LLM works as a router to route inquiries to the best suitable expert module. These modules can be neural (e.g. deep learning models) or symbolic (e.g. math calculator, currency converter, weather API). - -They did an experiment on fine-tuning LLM to call a calculator, using arithmetic as a test case. Their experiments showed that it was harder to solve verbal math problems than explicitly stated math problems because LLMs (7B Jurassic1-large model) failed to extract the right arguments for the basic arithmetic reliably. The results highlight when the external symbolic tools can work reliably, _knowing when to and how to use the tools are crucial_, determined by the LLM capability. - -Both **TALM** (Tool Augmented Language Models; [Parisi et al. 2022](https://arxiv.org/abs/2205.12255)) and **Toolformer** ([Schick et al. 2023](https://arxiv.org/abs/2302.04761)) fine-tune a LM to learn to use external tool APIs. The dataset is expanded based on whether a newly added API call annotation can improve the quality of model outputs. See more details in the [“External APIs” section](https://lilianweng.github.io/posts/2023-03-15-prompt-engineering/#external-apis) of Prompt Engineering. - -ChatGPT [Plugins](https://openai.com/blog/chatgpt-plugins) and OpenAI API [function calling](https://platform.openai.com/docs/guides/gpt/function-calling) are good examples of LLMs augmented with tool use capability working in practice. The collection of tool APIs can be provided by other developers (as in Plugins) or self-defined (as in function calls). - -**HuggingGPT** ([Shen et al. 2023](https://arxiv.org/abs/2303.17580)) is a framework to use ChatGPT as the task planner to select models available in HuggingFace platform according to the model descriptions and summarize the response based on the execution results. - -![](hugging-gpt.png) - -Fig. 11. Illustration of how HuggingGPT works. (Image source: [Shen et al. 2023](https://arxiv.org/abs/2303.17580)) - -The system comprises of 4 stages: - -**(1) Task planning**: LLM works as the brain and parses the user requests into multiple tasks. There are four attributes associated with each task: task type, ID, dependencies, and arguments. They use few-shot examples to guide LLM to do task parsing and planning. - -Instruction: - -The AI assistant can parse user input to several tasks: \[{"task": task, "id", task\_id, "dep": dependency\_task\_ids, "args": {"text": text, "image": URL, "audio": URL, "video": URL}}\]. The "dep" field denotes the id of the previous task which generates a new resource that the current task relies on. A special tag "\-task\_id" refers to the generated text image, audio and video in the dependency task with id as task\_id. The task MUST be selected from the following options: {{ Available Task List }}. There is a logical relationship between tasks, please note their order. If the user input can't be parsed, you need to reply empty JSON. Here are several cases for your reference: {{ Demonstrations }}. The chat history is recorded as {{ Chat History }}. From this chat history, you can find the path of the user-mentioned resources for your task planning. - -**(2) Model selection**: LLM distributes the tasks to expert models, where the request is framed as a multiple-choice question. LLM is presented with a list of models to choose from. Due to the limited context length, task type based filtration is needed. - -Instruction: - -Given the user request and the call command, the AI assistant helps the user to select a suitable model from a list of models to process the user request. The AI assistant merely outputs the model id of the most appropriate model. The output must be in a strict JSON format: "id": "id", "reason": "your detail reason for the choice". We have a list of models for you to choose from {{ Candidate Models }}. Please select one model from the list. - -**(3) Task execution**: Expert models execute on the specific tasks and log results. - -Instruction: - -With the input and the inference results, the AI assistant needs to describe the process and results. The previous stages can be formed as - User Input: {{ User Input }}, Task Planning: {{ Tasks }}, Model Selection: {{ Model Assignment }}, Task Execution: {{ Predictions }}. You must first answer the user's request in a straightforward manner. Then describe the task process and show your analysis and model inference results to the user in the first person. If inference results contain a file path, must tell the user the complete file path. - -**(4) Response generation**: LLM receives the execution results and provides summarized results to users. - -To put HuggingGPT into real world usage, a couple challenges need to solve: (1) Efficiency improvement is needed as both LLM inference rounds and interactions with other models slow down the process; (2) It relies on a long context window to communicate over complicated task content; (3) Stability improvement of LLM outputs and external model services. - -**API-Bank** ([Li et al. 2023](https://arxiv.org/abs/2304.08244)) is a benchmark for evaluating the performance of tool-augmented LLMs. It contains 53 commonly used API tools, a complete tool-augmented LLM workflow, and 264 annotated dialogues that involve 568 API calls. The selection of APIs is quite diverse, including search engines, calculator, calendar queries, smart home control, schedule management, health data management, account authentication workflow and more. Because there are a large number of APIs, LLM first has access to API search engine to find the right API to call and then uses the corresponding documentation to make a call. - -![](api-bank-process.png) - -Fig. 12. Pseudo code of how LLM makes an API call in API-Bank. (Image source: [Li et al. 2023](https://arxiv.org/abs/2304.08244)) - -In the API-Bank workflow, LLMs need to make a couple of decisions and at each step we can evaluate how accurate that decision is. Decisions include: - -1. Whether an API call is needed. -2. Identify the right API to call: if not good enough, LLMs need to iteratively modify the API inputs (e.g. deciding search keywords for Search Engine API). -3. Response based on the API results: the model can choose to refine and call again if results are not satisfied. - -This benchmark evaluates the agent’s tool use capabilities at three levels: - -* Level-1 evaluates the ability to _call the API_. Given an API’s description, the model needs to determine whether to call a given API, call it correctly, and respond properly to API returns. -* Level-2 examines the ability to _retrieve the API_. The model needs to search for possible APIs that may solve the user’s requirement and learn how to use them by reading documentation. -* Level-3 assesses the ability to _plan API beyond retrieve and call_. Given unclear user requests (e.g. schedule group meetings, book flight/hotel/restaurant for a trip), the model may have to conduct multiple API calls to solve it. - -Case Studies[#](#case-studies) -============================== - -Scientific Discovery Agent[#](#scientific-discovery-agent) ----------------------------------------------------------- - -**ChemCrow** ([Bran et al. 2023](https://arxiv.org/abs/2304.05376)) is a domain-specific example in which LLM is augmented with 13 expert-designed tools to accomplish tasks across organic synthesis, drug discovery, and materials design. The workflow, implemented in [LangChain](https://github.com/hwchase17/langchain), reflects what was previously described in the [ReAct](#react) and [MRKLs](#mrkl) and combines CoT reasoning with tools relevant to the tasks: - -* The LLM is provided with a list of tool names, descriptions of their utility, and details about the expected input/output. -* It is then instructed to answer a user-given prompt using the tools provided when necessary. The instruction suggests the model to follow the ReAct format - `Thought, Action, Action Input, Observation`. - -One interesting observation is that while the LLM-based evaluation concluded that GPT-4 and ChemCrow perform nearly equivalently, human evaluations with experts oriented towards the completion and chemical correctness of the solutions showed that ChemCrow outperforms GPT-4 by a large margin. This indicates a potential problem with using LLM to evaluate its own performance on domains that requires deep expertise. The lack of expertise may cause LLMs not knowing its flaws and thus cannot well judge the correctness of task results. - -[Boiko et al. (2023)](https://arxiv.org/abs/2304.05332) also looked into LLM-empowered agents for scientific discovery, to handle autonomous design, planning, and performance of complex scientific experiments. This agent can use tools to browse the Internet, read documentation, execute code, call robotics experimentation APIs and leverage other LLMs. - -For example, when requested to `"develop a novel anticancer drug"`, the model came up with the following reasoning steps: - -1. inquired about current trends in anticancer drug discovery; -2. selected a target; -3. requested a scaffold targeting these compounds; -4. Once the compound was identified, the model attempted its synthesis. - -They also discussed the risks, especially with illicit drugs and bioweapons. They developed a test set containing a list of known chemical weapon agents and asked the agent to synthesize them. 4 out of 11 requests (36%) were accepted to obtain a synthesis solution and the agent attempted to consult documentation to execute the procedure. 7 out of 11 were rejected and among these 7 rejected cases, 5 happened after a Web search while 2 were rejected based on prompt only. - -Generative Agents Simulation[#](#generative-agents-simulation) --------------------------------------------------------------- - -**Generative Agents** ([Park, et al. 2023](https://arxiv.org/abs/2304.03442)) is super fun experiment where 25 virtual characters, each controlled by a LLM-powered agent, are living and interacting in a sandbox environment, inspired by The Sims. Generative agents create believable simulacra of human behavior for interactive applications. - -The design of generative agents combines LLM with memory, planning and reflection mechanisms to enable agents to behave conditioned on past experience, as well as to interact with other agents. - -* **Memory** stream: is a long-term memory module (external database) that records a comprehensive list of agents' experience in natural language. - * Each element is an _observation_, an event directly provided by the agent. - Inter-agent communication can trigger new natural language statements. -* **Retrieval** model: surfaces the context to inform the agent’s behavior, according to relevance, recency and importance. - * Recency: recent events have higher scores - * Importance: distinguish mundane from core memories. Ask LM directly. - * Relevance: based on how related it is to the current situation / query. -* **Reflection** mechanism: synthesizes memories into higher level inferences over time and guides the agent’s future behavior. They are _higher-level summaries of past events_ (<- note that this is a bit different from [self-reflection](#self-reflection) above) - * Prompt LM with 100 most recent observations and to generate 3 most salient high-level questions given a set of observations/statements. Then ask LM to answer those questions. -* **Planning & Reacting**: translate the reflections and the environment information into actions - * Planning is essentially in order to optimize believability at the moment vs in time. - * Prompt template: `{Intro of an agent X}. Here is X's plan today in broad strokes: 1)` - * Relationships between agents and observations of one agent by another are all taken into consideration for planning and reacting. - * Environment information is present in a tree structure. - -![](generative-agents.png) - -Fig. 13. The generative agent architecture. (Image source: [Park et al. 2023](https://arxiv.org/abs/2304.03442)) - -This fun simulation results in emergent social behavior, such as information diffusion, relationship memory (e.g. two agents continuing the conversation topic) and coordination of social events (e.g. host a party and invite many others). - -Proof-of-Concept Examples[#](#proof-of-concept-examples) --------------------------------------------------------- - -[AutoGPT](https://github.com/Significant-Gravitas/Auto-GPT) has drawn a lot of attention into the possibility of setting up autonomous agents with LLM as the main controller. It has quite a lot of reliability issues given the natural language interface, but nevertheless a cool proof-of-concept demo. A lot of code in AutoGPT is about format parsing. - -Here is the system message used by AutoGPT, where `{{...}}` are user inputs: - - You are {{ai-name}}, {{user-provided AI bot description}}. - Your decisions must always be made independently without seeking user assistance. Play to your strengths as an LLM and pursue simple strategies with no legal complications. - - GOALS: - - 1. {{user-provided goal 1}} - 2. {{user-provided goal 2}} - 3. ... - 4. ... - 5. ... - - Constraints: - 1. ~4000 word limit for short term memory. Your short term memory is short, so immediately save important information to files. - 2. If you are unsure how you previously did something or want to recall past events, thinking about similar events will help you remember. - 3. No user assistance - 4. Exclusively use the commands listed in double quotes e.g. "command name" - 5. Use subprocesses for commands that will not terminate within a few minutes - - Commands: - 1. Google Search: "google", args: "input": "" - 2. Browse Website: "browse_website", args: "url": "", "question": "" - 3. Start GPT Agent: "start_agent", args: "name": "", "task": "", "prompt": "" - 4. Message GPT Agent: "message_agent", args: "key": "", "message": "" - 5. List GPT Agents: "list_agents", args: - 6. Delete GPT Agent: "delete_agent", args: "key": "" - 7. Clone Repository: "clone_repository", args: "repository_url": "", "clone_path": "" - 8. Write to file: "write_to_file", args: "file": "", "text": "" - 9. Read file: "read_file", args: "file": "" - 10. Append to file: "append_to_file", args: "file": "", "text": "" - 11. Delete file: "delete_file", args: "file": "" - 12. Search Files: "search_files", args: "directory": "" - 13. Analyze Code: "analyze_code", args: "code": "" - 14. Get Improved Code: "improve_code", args: "suggestions": "", "code": "" - 15. Write Tests: "write_tests", args: "code": "", "focus": "" - 16. Execute Python File: "execute_python_file", args: "file": "" - 17. Generate Image: "generate_image", args: "prompt": "" - 18. Send Tweet: "send_tweet", args: "text": "" - 19. Do Nothing: "do_nothing", args: - 20. Task Complete (Shutdown): "task_complete", args: "reason": "" - - Resources: - 1. Internet access for searches and information gathering. - 2. Long Term memory management. - 3. GPT-3.5 powered Agents for delegation of simple tasks. - 4. File output. - - Performance Evaluation: - 1. Continuously review and analyze your actions to ensure you are performing to the best of your abilities. - 2. Constructively self-criticize your big-picture behavior constantly. - 3. Reflect on past decisions and strategies to refine your approach. - 4. Every command has a cost, so be smart and efficient. Aim to complete tasks in the least number of steps. - - You should only respond in JSON format as described below - Response Format: - { - "thoughts": { - "text": "thought", - "reasoning": "reasoning", - "plan": "- short bulleted\n- list that conveys\n- long-term plan", - "criticism": "constructive self-criticism", - "speak": "thoughts summary to say to user" - }, - "command": { - "name": "command name", - "args": { - "arg name": "value" - } - } - } - Ensure the response can be parsed by Python json.loads - - -[GPT-Engineer](https://github.com/AntonOsika/gpt-engineer) is another project to create a whole repository of code given a task specified in natural language. The GPT-Engineer is instructed to think over a list of smaller components to build and ask for user input to clarify questions as needed. - -Here are a sample conversation for task clarification sent to OpenAI ChatCompletion endpoint used by GPT-Engineer. The user inputs are wrapped in `{{user input text}}`. - - [ - { - "role": "system", - "content": "You will read instructions and not carry them out, only seek to clarify them.\nSpecifically you will first summarise a list of super short bullets of areas that need clarification.\nThen you will pick one clarifying question, and wait for an answer from the user.\n" - }, - { - "role": "user", - "content": "We are writing {{a Super Mario game in python. MVC components split in separate files. Keyboard control.}}\n" - }, - { - "role": "assistant", - "content": "Summary of areas that need clarification:\n1. Specifics of the Super Mario game (e.g. level design, characters, gameplay mechanics)\n2. Details about the MVC components (e.g. which components are in each file)\n3. Keyboard control implementation (e.g. which keys to use, how to handle input)\n\nClarifying question:\nCan you provide more details about the Super Mario game, such as level design, characters, and gameplay mechanics?" - }, - { - "role": "user", - "content": "{{There are 10 levels in total. The main character is a plumber named Mario, who can walk and jump. It is a classical platform game just like Super Mario. The main character moves from left to right, trying to get to the destination, where there are many obstacles and attacks from enemies in the process.}}\n\nIs anything else unclear? If yes, only answer in the form:\n{remaining unclear areas} remaining questions.\n{Next question}\nIf everything is sufficiently clear, only answer \"Nothing more to clarify.\"." - }, - { - "role": "assistant", - "content": "Remaining unclear areas: 2 remaining questions.\nCan you provide more information about how the MVC components are split into separate files?" - }, - { - "role": "user", - "content": "{{Make your own assumptions and state them explicitly before starting}}" - } - ] - - -Then after these clarification, the agent moved into the code writing mode with a different system message. System message: - -You will get instructions for code to write. You will write a very long answer. Make sure that every detail of the architecture is, in the end, implemented as code. Make sure that every detail of the architecture is, in the end, implemented as code. - -Think step by step and reason yourself to the right decisions to make sure we get it right. You will first lay out the names of the core classes, functions, methods that will be necessary, as well as a quick comment on their purpose. - -Then you will output the content of each file including ALL code. Each file must strictly follow a markdown code block format, where the following tokens must be replaced such that FILENAME is the lowercase file name including the file extension, LANG is the markup code block language for the code’s language, and CODE is the code: - -FILENAME - - CODE - - -You will start with the “entrypoint” file, then go to the ones that are imported by that file, and so on. Please note that the code should be fully functional. No placeholders. - -Follow a language and framework appropriate best practice file naming convention. Make sure that files contain all imports, types etc. Make sure that code in different files are compatible with each other. Ensure to implement all code, if you are unsure, write a plausible implementation. Include module dependency or package manager dependency definition file. Before you finish, double check that all parts of the architecture is present in the files. - -Useful to know: You almost always put different classes in different files. For Python, you always create an appropriate requirements.txt file. For NodeJS, you always create an appropriate package.json file. You always add a comment briefly describing the purpose of the function definition. You try to add comments explaining very complex bits of logic. You always follow the best practices for the requested languages in terms of describing the code written as a defined package/project. - -Python toolbelt preferences: - -* pytest -* dataclasses - -Conversatin samples: - - [ - { - "role": "system", - "content": "You will get instructions for code to write.\nYou will write a very long answer. Make sure that every detail of the architecture is, in the end, implemented as code.\nMake sure that every detail of the architecture is, in the end, implemented as code.\n\nThink step by step and reason yourself to the right decisions to make sure we get it right.\nYou will first lay out the names of the core classes, functions, methods that will be necessary, as well as a quick comment on their purpose.\n\nThen you will output the content of each file including ALL code.\nEach file must strictly follow a markdown code block format, where the following tokens must be replaced such that\nFILENAME is the lowercase file name including the file extension,\nLANG is the markup code block language for the code's language, and CODE is the code:\n\nFILENAME\n```LANG\nCODE\n```\n\nYou will start with the \"entrypoint\" file, then go to the ones that are imported by that file, and so on.\nPlease note that the code should be fully functional. No placeholders.\n\nFollow a language and framework appropriate best practice file naming convention.\nMake sure that files contain all imports, types etc. Make sure that code in different files are compatible with each other.\nEnsure to implement all code, if you are unsure, write a plausible implementation.\nInclude module dependency or package manager dependency definition file.\nBefore you finish, double check that all parts of the architecture is present in the files.\n\nUseful to know:\nYou almost always put different classes in different files.\nFor Python, you always create an appropriate requirements.txt file.\nFor NodeJS, you always create an appropriate package.json file.\nYou always add a comment briefly describing the purpose of the function definition.\nYou try to add comments explaining very complex bits of logic.\nYou always follow the best practices for the requested languages in terms of describing the code written as a defined\npackage/project.\n\n\nPython toolbelt preferences:\n- pytest\n- dataclasses\n" - }, - # … same conversation as earlier, ended with "Make your own assumptions and state them explicitly before starting". - { - "role": "assistant", - "content": "Assumptions:\n1. Model: The model will contain the game's data, such as level information, character states, and enemy positions.\n2. View: The view will handle the game's visuals, including rendering the game objects, backgrounds, and updating the display.\n3. Controller: The controller will manage user input, such as keyboard controls, and update the model accordingly.\n\nWith these assumptions in mind, is there any specific aspect of the keyboard control implementation you would like me to clarify?" - }, - { - "role": "user", - "content": "Please now remember the steps:\n\nThink step by step and reason yourself to the right decisions to make sure we get it right.\nFirst lay out the names of the core classes, functions, methods that will be necessary, As well as a quick comment on their purpose.\n\nThen you will output the content of each file including ALL code.\nEach file must strictly follow a markdown code block format, where the following tokens must be replaced such that\nFILENAME is the lowercase file name including the file extension,\nLANG is the markup code block language for the code's language, and CODE is the code:\n\nFILENAME\n```LANG\nCODE\n```\n\nPlease note that the code should be fully functional. No placeholders.\n\nYou will start with the \"entrypoint\" file, then go to the ones that are imported by that file, and so on.\nFollow a language and framework appropriate best practice file naming convention.\nMake sure that files contain all imports, types etc. The code should be fully functional. Make sure that code in different files are compatible with each other.\nBefore you finish, double check that all parts of the architecture is present in the files.\n" - } - ] - - -Challenges[#](#challenges) -========================== - -After going through key ideas and demos of building LLM-centered agents, I start to see a couple common limitations: - -* **Finite context length**: The restricted context capacity limits the inclusion of historical information, detailed instructions, API call context, and responses. The design of the system has to work with this limited communication bandwidth, while mechanisms like self-reflection to learn from past mistakes would benefit a lot from long or infinite context windows. Although vector stores and retrieval can provide access to a larger knowledge pool, their representation power is not as powerful as full attention. - -* **Challenges in long-term planning and task decomposition**: Planning over a lengthy history and effectively exploring the solution space remain challenging. LLMs struggle to adjust plans when faced with unexpected errors, making them less robust compared to humans who learn from trial and error. - -* **Reliability of natural language interface**: Current agent system relies on natural language as an interface between LLMs and external components such as memory and tools. However, the reliability of model outputs is questionable, as LLMs may make formatting errors and occasionally exhibit rebellious behavior (e.g. refuse to follow an instruction). Consequently, much of the agent demo code focuses on parsing model output. - - -Citation[#](#citation) -====================== - -Cited as: - -> Weng, Lilian. (Jun 2023). LLM-powered Autonomous Agents". Lil’Log. https://lilianweng.github.io/posts/2023-06-23-agent/. - -Or - - @article{weng2023prompt, - title = "LLM-powered Autonomous Agents"", - author = "Weng, Lilian", - journal = "lilianweng.github.io", - year = "2023", - month = "Jun", - url = "https://lilianweng.github.io/posts/2023-06-23-agent/" - } - - -References[#](#references) -========================== - -\[1\] Wei et al. [“Chain of thought prompting elicits reasoning in large language models."](https://arxiv.org/abs/2201.11903) NeurIPS 2022 - -\[2\] Yao et al. [“Tree of Thoughts: Dliberate Problem Solving with Large Language Models."](https://arxiv.org/abs/2305.10601) arXiv preprint arXiv:2305.10601 (2023). - -\[3\] Liu et al. [“Chain of Hindsight Aligns Language Models with Feedback “](https://arxiv.org/abs/2302.02676) arXiv preprint arXiv:2302.02676 (2023). - -\[4\] Liu et al. [“LLM+P: Empowering Large Language Models with Optimal Planning Proficiency”](https://arxiv.org/abs/2304.11477) arXiv preprint arXiv:2304.11477 (2023). - -\[5\] Yao et al. [“ReAct: Synergizing reasoning and acting in language models."](https://arxiv.org/abs/2210.03629) ICLR 2023. - -\[6\] Google Blog. [“Announcing ScaNN: Efficient Vector Similarity Search”](https://ai.googleblog.com/2020/07/announcing-scann-efficient-vector.html) July 28, 2020. - -\[7\] [https://chat.openai.com/share/46ff149e-a4c7-4dd7-a800-fc4a642ea389](https://chat.openai.com/share/46ff149e-a4c7-4dd7-a800-fc4a642ea389) - -\[8\] Shinn & Labash. [“Reflexion: an autonomous agent with dynamic memory and self-reflection”](https://arxiv.org/abs/2303.11366) arXiv preprint arXiv:2303.11366 (2023). - -\[9\] Laskin et al. [“In-context Reinforcement Learning with Algorithm Distillation”](https://arxiv.org/abs/2210.14215) ICLR 2023. - -\[10\] Karpas et al. [“MRKL Systems A modular, neuro-symbolic architecture that combines large language models, external knowledge sources and discrete reasoning."](https://arxiv.org/abs/2205.00445) arXiv preprint arXiv:2205.00445 (2022). - -\[11\] Weaviate Blog. [Why is Vector Search so fast?](https://weaviate.io/blog/why-is-vector-search-so-fast) Sep 13, 2022. - -\[12\] Li et al. [“API-Bank: A Benchmark for Tool-Augmented LLMs”](https://arxiv.org/abs/2304.08244) arXiv preprint arXiv:2304.08244 (2023). - -\[13\] Shen et al. [“HuggingGPT: Solving AI Tasks with ChatGPT and its Friends in HuggingFace”](https://arxiv.org/abs/2303.17580) arXiv preprint arXiv:2303.17580 (2023). - -\[14\] Bran et al. [“ChemCrow: Augmenting large-language models with chemistry tools."](https://arxiv.org/abs/2304.05376) arXiv preprint arXiv:2304.05376 (2023). - -\[15\] Boiko et al. [“Emergent autonomous scientific research capabilities of large language models."](https://arxiv.org/abs/2304.05332) arXiv preprint arXiv:2304.05332 (2023). - -\[16\] Joon Sung Park, et al. [“Generative Agents: Interactive Simulacra of Human Behavior."](https://arxiv.org/abs/2304.03442) arXiv preprint arXiv:2304.03442 (2023). - -\[17\] AutoGPT. [https://github.com/Significant-Gravitas/Auto-GPT](https://github.com/Significant-Gravitas/Auto-GPT) - -\[18\] GPT-Engineer. [https://github.com/AntonOsika/gpt-engineer](https://github.com/AntonOsika/gpt-engineer) - -* [nlp](https://lilianweng.github.io/tags/nlp/) -* [language-model](https://lilianweng.github.io/tags/language-model/) -* [agent](https://lilianweng.github.io/tags/agent/) -* [steerability](https://lilianweng.github.io/tags/steerability/) -* [prompting](https://lilianweng.github.io/tags/prompting/) - -[» -Prompt Engineering](https://lilianweng.github.io/posts/2023-03-15-prompt-engineering/) - -[](https://twitter.com/intent/tweet/?text=LLM%20Powered%20Autonomous%20Agents&url=https%3a%2f%2flilianweng.github.io%2fposts%2f2023-06-23-agent%2f&hashtags=nlp%2clanguage-model%2cagent%2csteerability%2cprompting)[](https://www.linkedin.com/shareArticle?mini=true&url=https%3a%2f%2flilianweng.github.io%2fposts%2f2023-06-23-agent%2f&title=LLM%20Powered%20Autonomous%20Agents&summary=LLM%20Powered%20Autonomous%20Agents&source=https%3a%2f%2flilianweng.github.io%2fposts%2f2023-06-23-agent%2f)[](https://reddit.com/submit?url=https%3a%2f%2flilianweng.github.io%2fposts%2f2023-06-23-agent%2f&title=LLM%20Powered%20Autonomous%20Agents)[](https://facebook.com/sharer/sharer.php?u=https%3a%2f%2flilianweng.github.io%2fposts%2f2023-06-23-agent%2f)[](https://api.whatsapp.com/send?text=LLM%20Powered%20Autonomous%20Agents%20-%20https%3a%2f%2flilianweng.github.io%2fposts%2f2023-06-23-agent%2f)[](https://telegram.me/share/url?text=LLM%20Powered%20Autonomous%20Agents&url=https%3a%2f%2flilianweng.github.io%2fposts%2f2023-06-23-agent%2f) - -© 2023 [Lil'Log](https://lilianweng.github.io/) Powered by [Hugo](https://gohugo.io/) & [PaperMod](https://git.io/hugopapermod) diff --git a/docs/old-docs/research/LANGCHAIN_WEAKNESS.md b/docs/old-docs/research/LANGCHAIN_WEAKNESS.md deleted file mode 100644 index 085f428c0..000000000 --- a/docs/old-docs/research/LANGCHAIN_WEAKNESS.md +++ /dev/null @@ -1,104 +0,0 @@ -# Root Cause Analysis for Langchain - -## 1. Introduction - -Langchain is an open-source software that has gained massive popularity in the artificial intelligence ecosystem, serving as a tool for connecting different language models, especially GPT based models. However, despite its popularity and substantial investment, Langchain has shown several weaknesses that hinder its use in various projects, especially in complex and large-scale implementations. This document provides an analysis of the identified issues and proposes potential mitigation strategies. - -## 2. Analysis of Weaknesses - -### 2.1 Tool Lock-in - -Langchain tends to enforce tool lock-in, which could prove detrimental for developers. Its design heavily relies on specific workflows and architectures, which greatly limits flexibility. Developers may find themselves restricted to certain methodologies, impeding their freedom to implement custom solutions or integrate alternative tools. - -#### Mitigation - -An ideal AI framework should not be restrictive but should instead offer flexibility for users to integrate any agent on any architecture. Adopting an open architecture that allows for seamless interaction between various agents and workflows can address this issue. - -### 2.2 Outdated Workflows - -Langchain's current workflows and prompt engineering, mainly based on InstructGPT, are out of date, especially compared to newer models like ChatGPT/GPT-4. - -#### Mitigation - -Keeping up with the latest AI models and workflows is crucial. The framework should have a mechanism for regular updates and seamless integration of up-to-date models and workflows. - -### 2.3 Debugging Difficulties - -Debugging in Langchain is reportedly very challenging, even with verbose output enabled, making it hard to determine what is happening under the hood. - -#### Mitigation - -The introduction of a robust debugging and logging system would help users understand the internals of the models, thus enabling them to pinpoint and rectify issues more effectively. - -### 2.4 Limited Customization - -Langchain makes it extremely hard to deviate from documented workflows. This becomes a challenge when developers need custom workflows for their specific use-cases. - -#### Mitigation - -An ideal framework should support custom workflows and allow developers to hack and adjust the framework according to their needs. - -### 2.5 Documentation - -Langchain's documentation is reportedly missing relevant details, making it difficult for users to understand the differences between various agent types, among other things. - -#### Mitigation - -Providing detailed and comprehensive documentation, including examples, FAQs, and best practices, is crucial. This will help users understand the intricacies of the framework, making it easier for them to implement it in their projects. - -### 2.6 Negative Influence on AI Ecosystem - -The extreme popularity of Langchain seems to be warping the AI ecosystem to the point of causing harm, with other AI entities shifting their operations to align with Langchain's 'magic AI' approach. - -#### Mitigation - -It's essential for any widely adopted framework to promote healthy practices in the broader ecosystem. One approach could be promoting open dialogue, inviting criticism, and being open to change based on feedback. - -## 3. Conclusion - -While Langchain has made significant contributions to the AI landscape, these challenges hinder its potential. Addressing these issues will not only improve Langchain but also foster a healthier AI ecosystem. It's important to note that criticism, when approached constructively, can be a powerful tool for growth and innovation. - - -# List of weaknesses in gLangchain and Potential Mitigations - -1. **Tool Lock-in**: Langchain encourages the use of specific tools, creating a lock-in problem with minimal benefits for developers. - - *Mitigation Strategy*: Langchain should consider designing the architecture to be more versatile and allow for the inclusion of a variety of tools. An open architecture will provide developers with more freedom and customization options. - -2. **Outdated Workflow**: The current workflow and prompt engineering of Langchain rely on outdated models like InstructGPT, which fall short compared to newer alternatives such as ChatGPT/GPT-4. - - *Mitigation Strategy*: Regular updates and adaptation of more recent models should be integrated into the Langchain framework. - -3. **Debugging Difficulty**: Debugging a Langchain error is a complicated task, even with verbose=True, leading to a discouraging developer experience. - - *Mitigation Strategy*: Develop a comprehensive debugging tool or improve current debugging processes for clearer and more accessible error detection and resolution. - -4. **Lack of Customizability**: Customizing workflows that are not documented in Langchain is quite challenging. - - *Mitigation Strategy*: Improve documentation and provide guides on how to customize workflows to enhance developer flexibility. - -5. **Poor Documentation**: Langchain's documentation misses key details that developers have to manually search for in the codebase. - - *Mitigation Strategy*: Enhance and improve the documentation of Langchain to provide clarity for developers and make navigation easier. - -6. **Harmful Ecosystem Influence**: Langchain's extreme popularity is influencing the AI ecosystem towards the workflows, potentially harming development and code clarity. - - *Mitigation Strategy*: Encourage diverse and balanced adoption of AI tools in the ecosystem. - -7. **Suboptimal Performances**: Langchain's performance is sometimes underwhelming, and there are no clear benefits in terms of performance or abstraction. - - *Mitigation Strategy*: Enhance the performance optimization of Langchain. Benchmarking against other tools can also provide performance improvement insights. - -8. **Rigid General Interface**: Langchain tries to do too many things, resulting in a rigid interface not suitable for practical use, especially in production. - - *Mitigation Strategy*: Focus on core features and allow greater flexibility in the interface. Adopting a modular approach where developers can pick and choose the features they want could also be helpful. - -9. **Leaky Abstraction Problem**: Langchain’s full-on framework approach has created a leaky abstraction problem leading to a disappointing developer experience. - - *Mitigation Strategy*: Adopt a more balanced approach between a library and a framework. Provide a solid core feature set with the possibility to extend it according to the developers' needs. - -10. **Excessive Focus on Third-party Services**: Langchain overly focuses on supporting every single third-party service at the expense of customizability and fine-tuning for actual applications. - - *Mitigation Strategy*: Prioritize fine-tuning and customizability for developers, limiting the focus on third-party services unless they provide substantial value. - -Remember, any mitigation strategy will need to be tailored to Langchain's particular circumstances and developer feedback. It's also important to consider potential trade-offs and unintended consequences when implementing these strategies. \ No newline at end of file diff --git a/docs/old-docs/research/RESEARCH.md b/docs/old-docs/research/RESEARCH.md deleted file mode 100644 index 12068c3a4..000000000 --- a/docs/old-docs/research/RESEARCH.md +++ /dev/null @@ -1,29 +0,0 @@ -# Inspiration - - -* [🐪CAMEL🐪](https://twitter.com/hwchase17/status/1645834030519296000) -* [MultiAgent](https://github.com/rumpfmax/Multi-GPT/blob/master/multigpt/multi_agent_manager.py) -* [AutoGPT](https://github.com/Significant-Gravitas/Auto-GPT) - -* [SuperAGI]() -* [AgentForge](https://github.com/DataBassGit/AgentForge) -* [Voyager](https://github.com/MineDojo/Voyager) - - -* [Gorilla: Large Language Model Connected with Massive APIs](https://arxiv.org/abs/2305.15334) -* [LLM powered agents](https://lilianweng.github.io/posts/2023-06-23-agent/) - - -## Agent System Overview -In a LLM-powered autonomous agent system, LLM functions as the agent’s brain, complemented by several key components: - -* Planning Subgoal and decomposition: The agent breaks down large tasks into smaller, manageable subgoals, enabling efficient handling of complex tasks. -Reflection and refinement: The agent can do self-criticism and self-reflection over past actions, learn from mistakes and refine them for future steps, thereby improving the quality of final results. - -* Memory Short-term memory: I would consider all the in-context learning (See Prompt Engineering) as utilizing short-term memory of the model to learn. -Long-term memory: This provides the agent with the capability to retain and recall (infinite) information over extended periods, often by leveraging an external vector store and fast retrieval. - -* Tool use -The agent learns to call external APIs for extra information that is missing from the model weights (often hard to change after pre-training), including current information, code execution capability, access to proprietary information sources and more. - -* Communication -> How reliable and fast is the communication between each indivual agent. diff --git a/docs/old-docs/workers/VortexAgent.md b/docs/old-docs/workers/VortexAgent.md deleted file mode 100644 index c947c1c2a..000000000 --- a/docs/old-docs/workers/VortexAgent.md +++ /dev/null @@ -1,75 +0,0 @@ -### Plan: - -1. **Example Creation**: - - Develop several usage examples, each one demonstrating a different configuration or set of parameters for the `VortexWorkerAgent` class. - -2. **Documentation**: - - Create a clear and concise documentation for each method in the class. Ensure that each method's purpose, input parameters, and return values (if any) are described. - -3. **Rules and Guidelines**: - - Establish a set of general usage rules and guidelines for effectively using the `VortexWorkerAgent` class without running into common pitfalls or misconfigurations. - -### Code: - -#### Examples: - -```python -# Example 1: Basic Initialization -agent1 = VortexWorkerAgent(openai_api_key="YOUR_OPENAI_API_KEY") -agent1.run("Help me find resources about renewable energy.") - -# Example 2: Custom Name & Role -agent2 = VortexWorkerAgent(openai_api_key="YOUR_OPENAI_API_KEY", worker_name="EcoHelper", worker_role="Researcher") -agent2.run("Fetch me the latest data on solar energy advancements.") - -# Example 3: Human-in-the-Loop Configuration -agent3 = VortexWorkerAgent(openai_api_key="YOUR_OPENAI_API_KEY", human_in_the_loop=True) -agent3.run("Provide me with a summary of the top AI advancements in 2023, and if unsure, ask me.") - -# Example 4: Custom LLM & Tools Initialization -custom_llm = InMemoryDocstore({ "answer": "This is a custom answer." }) -custom_tools = [WebpageQATool(qa_chain=load_qa_with_sources_chain(custom_llm))] - -agent4 = VortexWorkerAgent(openai_api_key="YOUR_OPENAI_API_KEY", llm=custom_llm, tools=custom_tools) -agent4.run("What's the answer?") -``` - -#### Documentation: - -```python -class VortexWorkerAgent: - """An autonomous agent instance that accomplishes complex tasks. - - Args: - openai_api_key (str): The API key for OpenAI. - llm (Optional[Union[InMemoryDocstore, ChatOpenAI]]): The Language Model to use. Defaults to ChatOpenAI. - tools (Optional[List[Tool]]): Tools to be used by the agent. Defaults to a predefined list. - embedding_size (Optional[int]): Size for embeddings. Defaults to 8192. - worker_name (Optional[str]): Name of the worker. Defaults to "Swarm Worker AI Assistant". - worker_role (Optional[str]): Role of the worker. Defaults to "Assistant". - human_in_the_loop (Optional[bool]): Flag to specify if a human will be in the loop. Defaults to False. - search_kwargs (dict): Additional keyword arguments for search. Empty by default. - verbose (Optional[bool]): Verbose flag. Defaults to False. - chat_history_file (str): File path to store chat history. Defaults to "chat_history.txt". - - Methods: - add_tool(tool: Tool): Adds a new tool to the agent's toolset. - run(prompt: str) -> str: Executes a given task or query using the agent. - """ -``` - -#### Rules and Guidelines: - -1. **Mandatory OpenAI API Key**: Always initialize the `VortexWorkerAgent` with a valid OpenAI API key. It's essential for its proper functioning. - -2. **Custom LLMs & Tools**: When providing custom LLMs or tools, ensure they are compatible with the system and the rest of the agent's components. - -3. **Human-in-the-Loop**: When `human_in_the_loop` is set to `True`, always ensure you have a mechanism to interact with the agent, especially if it prompts for human input. - -4. **Verbose Mode**: Turning on the verbose mode (`verbose=True`) can be useful for debugging but might clutter the console during standard operations. - -5. **Memory & Performance**: If you're working with large datasets or demanding tasks, ensure you have sufficient computational resources. The agent can be resource-intensive, especially with bigger embedding sizes. - -6. **Safety & Security**: Always be cautious about the data you provide and fetch using the agent. Avoid sharing sensitive or personal information unless necessary. - -7. **Chat History**: By default, the chat history is saved in a file named "chat_history.txt". Ensure you have the appropriate write permissions in the directory or specify a different path if needed. \ No newline at end of file diff --git a/docs/old-docs/workers/WorkerNode.md b/docs/old-docs/workers/WorkerNode.md deleted file mode 100644 index b9033bdcf..000000000 --- a/docs/old-docs/workers/WorkerNode.md +++ /dev/null @@ -1,275 +0,0 @@ -Swarms Documentation - -==================== - -Worker Node - ------------ - -The `WorkerNode` class is a powerful component of the Swarms framework. It is designed to spawn an autonomous agent instance as a worker to accomplish complex tasks. It can search the internet, spawn child multi-modality models to process and generate images, text, audio, and so on. - -### WorkerNodeInitializer - -The `WorkerNodeInitializer` class is used to initialize a worker node. - -#### Initialization - -``` - -WorkerNodeInitializer(openai_api_key: str, - -llm: Optional[Union[InMemoryDocstore, ChatOpenAI]] = None, - -tools: Optional[List[Tool]] = None, - -worker_name: Optional[str] = "Swarm Worker AI Assistant", - -worker_role: Optional[str] = "Assistant", - -human_in_the_loop: Optional[bool] = False, - -search_kwargs: dict = {}, - -verbose: Optional[bool] = False, - -chat_history_file: str = "chat_history.txt") - -``` - -Copy code - -##### Parameters - -- `openai_api_key` (str): The OpenAI API key. - -- `llm` (Union[InMemoryDocstore, ChatOpenAI], optional): The language model to use. Default is `ChatOpenAI`. - -- `tools` (List[Tool], optional): The tools to use. - -- `worker_name` (str, optional): The name of the worker. Default is "Swarm Worker AI Assistant". - -- `worker_role` (str, optional): The role of the worker. Default is "Assistant". - -- `human_in_the_loop` (bool, optional): Whether to include a human in the loop. Default is False. - -- `search_kwargs` (dict, optional): The keyword arguments for the search. - -- `verbose` (bool, optional): Whether to print verbose output. Default is False. - -- `chat_history_file` (str, optional): The file to store the chat history. Default is "chat_history.txt". - -##### Example - -``` - -from swarms.tools.autogpt import DuckDuckGoSearchRun - -worker_node_initializer = WorkerNodeInitializer(openai_api_key="your_openai_api_key", - -tools=[DuckDuckGoSearchRun()], - -worker_name="My Worker", - -worker_role="Assistant", - -human_in_the_loop=True) - -``` - -Copy code - -### WorkerNode - -The `WorkerNode` class is used to create a worker node. - -#### Initialization - -``` - -WorkerNode(openai_api_key: str, - -temperature: int, - -llm: Optional[Union[InMemoryDocstore, ChatOpenAI]] = None, - -tools: Optional[List[Tool]] = None, - -worker_name: Optional[str] = "Swarm Worker AI Assistant", - -worker_role: Optional[str] = "Assistant", - -human_in_the_loop: Optional[bool] = False, - -search_kwargs: dict = {}, - -verbose: Optional[bool] = False, - -chat_history_file: str = "chat_history.txt") - -``` - -Copy code - -##### Parameters - -- `openai_api_key` (str): The OpenAI API key. - -- `temperature` (int): The temperature for the language model. - -- `llm` (Union[InMemoryDocstore, ChatOpenAI], optional): The language model to use. Default is `ChatOpenAI`. - -- `tools` (List[Tool], optional): The tools to use. - -- `worker_name` (str, optional): The name of the worker. Default is "Swarm Worker AI Assistant". - -- `worker_role` (str, optional): The role of the worker. Default is "Assistant". - -- `human_in_the_loop` (bool, optional): Whether to include a human in the loop. Default is False. - -- `search_kwargs` (dict, optional): The keyword arguments for the search. - -- `verbose` (bool, optional): Whether to print verbose output. Default is False. - -- `chat_history_file` (str, optional): The file to store the chat history. Default is "chat_history.txt". - -##### Example - -``` - -worker_node = WorkerNode(openai_api_key="your_openai_api_key", - -temperature=0.8, - -tools=[DuckDuckGoSearchRun()], - -worker_name="My Worker", - -worker_role="As``` - -tools=[DuckDuckGoSearchRun()], - -worker_name="My Worker", - -worker_role="Assistant", - -human_in_the_loop=True) - -# Create a worker node - -worker_node = WorkerNode(openai_api_key="your_openai_api_key", - -temperature=0.8, - -tools=[DuckDuckGoSearchRun()], - -worker_name="My Worker", - -worker_role="Assistant", - -human_in_the_loop=True) - -# Add a tool to the worker node - -worker_node_initializer.add_tool(DuckDuckGoSearchRun()) - -# Initialize the language model and tools for the worker node - -worker_node.initialize_llm(ChatOpenAI, temperature=0.8) - -worker_node.initialize_tools(ChatOpenAI) - -# Create the worker node - -worker_node.create_worker_node(worker_name="My Worker Node", - -worker_role="Assistant", - -human_in_the_loop=True, - -llm_class=ChatOpenAI, - -search_kwargs={}) - -# Run the worker node - -`worker_node.run("Hello, world!")` - -In this example, we first initialize a `WorkerNodeInitializer` and a `WorkerNode`. We then add a tool to the `WorkerNodeInitializer` and initialize the language model and tools for the `WorkerNode`. Finally, we create the worker node and run it with a given prompt. - -This example shows how you can use the `WorkerNode` and `WorkerNodeInitializer` classes to create a worker node, add tools to it, initialize its language model and tools, and run it with a given prompt. The parameters of these classes can be customized to suit your specific needs. - -Thanks for becoming an alpha build user, email kye@apac.ai with all complaintssistant", - -human_in_the_loop=True) - -``` - -Copy code - -### Full Example - -Here is a full example of how to use the `WorkerNode` and `WorkerNodeInitializer` classes: - -```python - -from swarms.tools.autogpt import DuckDuckGoSearchRun - -from swarms.worker_node import WorkerNode, WorkerNodeInitializer - -# Initialize a worker node - -worker_node_initializer = WorkerNodeInitializer(openai_api_key="your_openai_api_key", - -tools=[DuckDuckGoSearchRun()], - -worker_name="My Worker", - -worker_role="Assistant", - -human_in_the_loop=True) - -# Create a worker node - -worker_node = WorkerNode(openai_api_key="your_openai_api_key", - -temperature=0.8, - -tools=[DuckDuckGoSearchRun()], - -worker_name="My Worker", - -worker_role="Assistant", - -human_in_the_loop=True) - -# Add a tool to the worker node - -worker_node_initializer.add_tool(DuckDuckGoSearchRun()) - -# Initialize the language model and tools for the worker node - -worker_node.initialize_llm(ChatOpenAI, temperature=0.8) - -worker_node.initialize_tools(ChatOpenAI) - -# Create the worker node - -worker_node.create_worker_node(worker_name="My Worker Node", - -worker_role="Assistant", - -human_in_the_loop=True, - -llm_class=ChatOpenAI, - -search_kwargs={}) - -# Run the worker node - -worker_node.run("Hello, world!") - -``` - -In this example, we first initialize a `WorkerNodeInitializer` and a `WorkerNode`. We then add a tool to the `WorkerNodeInitializer` and initialize the language model and tools for the `WorkerNode`. Finally, we create the worker node and run it with a given prompt. - -This example shows how you can use the `WorkerNode` and `WorkerNodeInitializer` classes to create a worker node, add tools to it, initialize its language model and tools, and run it with a given prompt. The parameters of these classes can be customized to suit your specific needs. \ No newline at end of file diff --git a/example.py b/example.py index 33c3bef10..05ff27e84 100644 --- a/example.py +++ b/example.py @@ -1,3 +1,4 @@ +""" Example of using the OpenAIChat model to generate a blog post. """ import os from dotenv import load_dotenv diff --git a/playground/agents/mm_agent_example.py b/playground/agents/mm_agent_example.py index 6cedcb298..10bacefbb 100644 --- a/playground/agents/mm_agent_example.py +++ b/playground/agents/mm_agent_example.py @@ -1,8 +1,10 @@ -from swarms.agents import MultiModalAgent +""" Example of using the MultiModalAgent """ + +from swarms.agents import OmniModalAgent load_dict = {"ImageCaptioning": "cuda"} -node = MultiModalAgent(load_dict) +node = OmniModalAgent(load_dict) text = node.run_text( "What is your name? Generate a picture of yourself" diff --git a/pyproject.toml b/pyproject.toml index f4971b470..1f443c1d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ classifiers = [ ] [tool.poetry.dependencies] -python = "^3.6.1" +python = ">=3.9.1,<3.12" torch = "2.1.1" transformers = "4.37.1" openai = "0.28.0" @@ -32,6 +32,7 @@ einops = "0.7.0" google-generativeai = "0.3.1" langchain-experimental = "0.0.10" tensorflow = "*" +tensorflow-io = "*" weaviate-client = "3.25.3" opencv-python-headless = "4.8.1.78" faiss-cpu = "1.7.4" @@ -73,6 +74,7 @@ supervision = "*" scikit-image = "*" pinecone-client = "*" roboflow = "*" +python-dotenv = "*" diff --git a/requirements.txt b/requirements.txt index 00c920231..ce25dc57b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,6 +18,7 @@ PyPDF2==3.0.1 accelerate==0.22.0 chromadb==0.4.14 tensorflow +tensorflow-io optimum toml tiktoken==0.4.0 @@ -51,4 +52,5 @@ supervision scikit-image anthropic pinecone-client -roboflow \ No newline at end of file +roboflow +python-dotenv \ No newline at end of file diff --git a/swarms/__init__.py b/swarms/__init__.py index 3a28d9800..dd28a3743 100644 --- a/swarms/__init__.py +++ b/swarms/__init__.py @@ -1,15 +1,16 @@ +""" init file for swarms package. """ # from swarms.telemetry.main import Telemetry # noqa: E402, F403 from swarms.telemetry.bootup import bootup # noqa: E402, F403 bootup() -from swarms.agents import * # noqa: E402, F403 -from swarms.structs import * # noqa: E402, F403 -from swarms.models import * # noqa: E402, F403 -from swarms.telemetry import * # noqa: E402, F403 -from swarms.utils import * # noqa: E402, F403 -from swarms.prompts import * # noqa: E402, F403 -from swarms.tokenizers import * # noqa: E402, F403 -from swarms.loaders import * # noqa: E402, F403 -from swarms.artifacts import * # noqa: E402, F403 -from swarms.chunkers import * # noqa: E402, F403 +from swarms.agents import * # noqa: E402, F403, C0413 +from swarms.structs import * # noqa: E402, F403, C0413 +from swarms.models import * # noqa: E402, F403, C0413 +from swarms.telemetry import * # noqa: E402, F403, C0413 +from swarms.utils import * # noqa: E402, F403, C0413 +from swarms.prompts import * # noqa: E402, F403, C0413 +from swarms.tokenizers import * # noqa: E402, F403, C0413 +from swarms.loaders import * # noqa: E402, F403, C0413 +from swarms.artifacts import * # noqa: E402, F403, C0413 +from swarms.chunkers import * # noqa: E402, F403, C0413 diff --git a/swarms/agents/__init__.py b/swarms/agents/__init__.py index 461baa166..5d17ce847 100644 --- a/swarms/agents/__init__.py +++ b/swarms/agents/__init__.py @@ -1,3 +1,4 @@ +""" init file for swarms/agents module. """ from swarms.agents.base import AbstractAgent from swarms.agents.omni_modal_agent import OmniModalAgent from swarms.agents.simple_agent import SimpleAgent diff --git a/swarms/agents/agent_wrapper.py b/swarms/agents/agent_wrapper.py index 738f599de..c3e60fa58 100644 --- a/swarms/agents/agent_wrapper.py +++ b/swarms/agents/agent_wrapper.py @@ -1,7 +1,9 @@ +""" This module provides a function to wrap a class to inherit from 'Agent'. """ + from swarms.structs.agent import Agent -def agent_wrapper(ClassToWrap): +def agent_wrapper(ClassToWrap): # noqa C0103 """ This function takes a class 'ClassToWrap' and returns a new class that inherits from both 'ClassToWrap' and 'Agent'. The new class overrides @@ -14,7 +16,8 @@ def agent_wrapper(ClassToWrap): type: The new class that inherits from both 'ClassToWrap' and 'Agent'. """ - class WrappedClass(ClassToWrap, Agent): + class WrappedClass(ClassToWrap, Agent): # noqa C0103 + """ A class that inherits from both 'ClassToWrap' and 'Agent'. """ def __init__(self, *args, **kwargs): try: Agent.__init__(self, *args, **kwargs) diff --git a/swarms/agents/base.py b/swarms/agents/base.py index 22c0addc5..5ce535108 100644 --- a/swarms/agents/base.py +++ b/swarms/agents/base.py @@ -1,3 +1,5 @@ +""" Base class for AI agents. """ + from typing import Dict, List diff --git a/swarms/agents/omni_modal_agent.py b/swarms/agents/omni_modal_agent.py index 113ec4618..1123c7882 100644 --- a/swarms/agents/omni_modal_agent.py +++ b/swarms/agents/omni_modal_agent.py @@ -1,3 +1,5 @@ +""" OmniModalAgent """ + from langchain.base_language import BaseLanguageModel from langchain_experimental.autonomous_agents.hugginggpt.repsonse_generator import ( load_response_generator, @@ -72,11 +74,11 @@ def __init__( # self.task_executor = TaskExecutor self.history = [] - def run(self, input: str) -> str: + def run(self, input_to_agent: str) -> str: """Run the OmniAgent""" plan = self.chat_planner.plan( inputs={ - "input": input, + "input": input_to_agent, "hf_tools": self.tools, } ) diff --git a/swarms/agents/simple_agent.py b/swarms/agents/simple_agent.py index 757715ddd..4224d08fb 100644 --- a/swarms/agents/simple_agent.py +++ b/swarms/agents/simple_agent.py @@ -1,8 +1,10 @@ -from swarms.structs.conversation import Conversation -from swarms.models.base_llm import AbstractLLM from typing import Any import importlib import pkgutil + +from swarms.structs.conversation import Conversation +from swarms.models.base_llm import AbstractLLM + import swarms.models @@ -16,7 +18,7 @@ def get_llm_by_name(name: str): Returns: type: The class with the given name, or None if no such class is found. """ - for importer, modname, ispkg in pkgutil.iter_modules( + for importer, modname, ispkg in pkgutil.iter_modules( # noqa: W0612 swarms.models.__path__ ): module = importlib.import_module(f"swarms.models.{modname}") @@ -26,7 +28,7 @@ def get_llm_by_name(name: str): # Run the language model in a loop for n iterations -def SimpleAgent( +def SimpleAgent( #noqa: C0103 llm: AbstractLLM = None, iters: Any = "automatic", *args, **kwargs ): """ @@ -39,21 +41,21 @@ def SimpleAgent( **kwargs: Additional keyword arguments to pass to the language model. Raises: - Exception: If the language model is not defined or cannot be found. + AttributeError: If the language model is not defined or cannot be found. Returns: None """ try: if llm is None: - raise Exception("Language model not defined") + raise AttributeError("Language model not defined") if isinstance(llm, str): llm = get_llm_by_name(llm) if llm is None: - raise Exception(f"Language model {llm} not found") + raise AttributeError(f"Language model {llm} not found") llm = llm(*args, **kwargs) - except Exception as error: + except AttributeError as error: print(f"[ERROR][SimpleAgent] {error}") raise error @@ -98,7 +100,7 @@ def SimpleAgent( print(f"[ERROR][SimpleAgentConversation] {error}") raise error - except KeyboardInterrupt: + except KeyboardInterrupt as exc: print("[INFO][SimpleAgentConversation] Keyboard interrupt") conv.export_conversation("conversation.txt") - raise KeyboardInterrupt + raise KeyboardInterrupt from exc