”Individually, we are one drop. Together, we are an ocean.” - Ryunosuke Satoro
Multi-GPT is an experimental multi-agent system. Multiple "expertGPTs" collaborate to perform a task. Each with their own short and long-term memory and the ability to communicate with each other.
https://www.loom.com/share/b6bec93065794eb8a47e2109697afa39
Optional:
To install Multi-GPT, follow these steps:
To execute the following commands, open a CMD, Bash, or Powershell window by navigating to a folder on your computer and typing CMD
in the folder path at the top, then press enter.
git clone https://github.com/rumpfmax/Multi-GPT.git
cd Multi-GPT
pip install -r requirements.txt
Locate the file named .env.template
in the main /Multi-GPT
folder.
Create a copy of this file, called .env
by removing the template
extension. The easiest way is to do this in a command prompt/terminal window cp .env.template .env
Open the .env
file in a text editor. Note: Files starting with a dot might be hidden by your Operating System.
Find the line that says OPENAI_API_KEY=
.
After the "="
, enter your unique OpenAI API Key (without any quotes or spaces).
Enter any other API keys or Tokens for services you would like to utilize.
Save and close the ".env"
file.
By completing these steps, you have properly configured the API Keys for your project.
USE_AZURE
to True
and then follow these steps:azure.yaml.template
to azure.yaml
and provide the relevant azure_api_base
, azure_api_version
and all the deployment IDs for the relevant models in the azure_model_map
section:
fast_llm_model_deployment_id
- your gpt-3.5-turbo or gpt-4 deployment IDsmart_llm_model_deployment_id
- your gpt-4 deployment IDembedding_model_deployment_id
- your text-embedding-ada-002 v2 deployment ID# Replace string in angled brackets (<>) to your own ID
azure_model_map:
fast_llm_model_deployment_id: "<my-fast-llm-deployment-id>"
...
Microsoft Azure Endpoints
section and here: https://learn.microsoft.com/en-us/azure/cognitive-services/openai/tutorials/embeddings?tabs=command-line for the embedding model.multigpt
Python module in your terminalpython -m multigpt
y
y -N
n
Activity and error logs are located in the ./output/logs
To print out debug logs:
python -m multigpt --debug
Obtain your OpenAI API key from: https://platform.openai.com/account/api-keys.
To use OpenAI API key for Auto-GPT, you NEED to have billing set up (AKA paid account).
You can set up paid account at https://platform.openai.com/account/billing/overview.
This section is optional, use the official google api if you are having issues with error 429 when running a google search.
To use the google_official_search
command, you need to set up your Google API keys in your environment variables.
GOOGLE_API_KEY
on your machine. See setting up environment variables below.CUSTOM_SEARCH_ENGINE_ID
on your machine. See setting up environment variables below.Remember that your free daily custom search quota allows only up to 100 searches. To increase this limit, you need to assign a billing account to the project to profit from up to 10K daily searches.
For Windows Users:
setx GOOGLE_API_KEY "YOUR_GOOGLE_API_KEY"
setx CUSTOM_SEARCH_ENGINE_ID "YOUR_CUSTOM_SEARCH_ENGINE_ID"
For macOS and Linux users:
export GOOGLE_API_KEY="YOUR_GOOGLE_API_KEY"
export CUSTOM_SEARCH_ENGINE_ID="YOUR_CUSTOM_SEARCH_ENGINE_ID"
By default, Auto-GPT is going to use LocalCache instead of redis or Pinecone.
To switch to either, change the MEMORY_BACKEND
env variable to the value that you want:
local
(default) uses a local JSON cache filepinecone
uses the Pinecone.io account you configured in your ENV settingsredis
will use the redis cache that you configuredmilvus
will use the milvus cache that you configuredweaviate
will use the weaviate cache that you configuredCAUTION \ This is not intended to be publicly accessible and lacks security measures. Therefore, avoid exposing Redis to the internet without a password or at all
- Install docker desktop
docker run -d --name redis-stack-server -p 6379:6379 redis/redis-stack-server:latest
See https://hub.docker.com/r/redis/redis-stack-server for setting a password and additional configuration.
Replace PASSWORD in angled brackets (<>)
MEMORY_BACKEND=redis REDIS_HOST=localhost REDIS_PORT=6379 REDIS_PASSWORD=<PASSWORD>
You can optionally set
WIPE_REDIS_ON_START=False
To persist memory stored in Redis
You can specify the memory index for redis using the following:
MEMORY_INDEX=<WHATEVER>
Pinecone enables the storage of vast amounts of vector-based memory, allowing for only relevant memories to be loaded for the agent at any given time.
Starter
plan to avoid being charged.In the .env
file set:
PINECONE_API_KEY
PINECONE_ENV
(example: "us-east4-gcp")MEMORY_BACKEND=pinecone
Alternatively, you can set them from the command line (advanced):
For Windows Users:
setx PINECONE_API_KEY "<YOUR_PINECONE_API_KEY>"
setx PINECONE_ENV "<YOUR_PINECONE_REGION>" # e.g: "us-east4-gcp"
setx MEMORY_BACKEND "pinecone"
For macOS and Linux users:
export PINECONE_API_KEY="<YOUR_PINECONE_API_KEY>"
export PINECONE_ENV="<YOUR_PINECONE_REGION>" # e.g: "us-east4-gcp"
export MEMORY_BACKEND="pinecone"
Milvus is a open-source, high scalable vector database to storage huge amount of vector-based memory and provide fast relevant search.
MILVUS_ADDR
in .env
to your milvus address host:ip
.MEMORY_BACKEND
in .env
to milvus
to enable milvus as backend.MILVUS_COLLECTION
in .env
to change milvus collection name as you want, autogpt
is the default name.Weaviate is an open-source vector database. It allows to store data objects and vector embeddings from ML-models and scales seamlessly to billion of data objects. An instance of Weaviate can be created locally (using Docker), on Kubernetes or using Weaviate Cloud Services.
Although still experimental, Embedded Weaviate is supported which allows the Auto-GPT process itself to start a Weaviate instance. To enable it, set USE_WEAVIATE_EMBEDDED
to True
and make sure you pip install "weaviate-client>=3.15.4"
.
In your .env
file set the following:
MEMORY_BACKEND=weaviate
WEAVIATE_HOST="127.0.0.1" # the IP or domain of the running Weaviate instance
WEAVIATE_PORT="8080"
WEAVIATE_PROTOCOL="http"
WEAVIATE_USERNAME="your username"
WEAVIATE_PASSWORD="your password"
WEAVIATE_API_KEY="your weaviate API key if you have one"
WEAVIATE_EMBEDDED_PATH="/home/me/.local/share/weaviate" # this is optional and indicates where the data should be persisted when running an embedded instance
USE_WEAVIATE_EMBEDDED=False # set to True to run Embedded Weaviate
MEMORY_INDEX="multigpt" # name of the index to create for the application
--debug
flag :)usage: data_ingestion.py [-h] (--file FILE | --dir DIR) [--init] [--overlap OVERLAP] [--max_length MAX_LENGTH]
Ingest a file or a directory with multiple files into memory. Make sure to set your .env before running this script.
options: -h, --help show this help message and exit --file FILE The file to ingest. --dir DIR The directory containing the files to ingest. --init Init the memory and wipe its content (default: False) --overlap OVERLAP The overlap size between chunks when ingesting files (default: 200) --max_length MAX_LENGTH The max_length of each chunk when ingesting files (default: 4000)
This script located at autogpt/data_ingestion.py, allows you to ingest files into memory and pre-seed it before running Auto-GPT.
Memory pre-seeding is a technique that involves ingesting relevant documents or data into the AI's memory so that it can use this information to generate more informed and accurate responses.
To pre-seed the memory, the content of each document is split into chunks of a specified maximum length with a specified overlap between chunks, and then each chunk is added to the memory backend set in the .env file. When the AI is prompted to recall information, it can then access those pre-seeded memories to generate more informed and accurate responses.
This technique is particularly useful when working with large amounts of data or when there is specific information that the AI needs to be able to access quickly. By pre-seeding the memory, the AI can retrieve and use this information more efficiently, saving time, API call and improving the accuracy of its responses.
You could for example download the documentation of an API, a GitHub repository, etc. and ingest it into memory before running Auto-GPT.
⚠️ If you use Redis as your memory, make sure to run Auto-GPT with the WIPE_REDIS_ON_START
set to False
in your .env
file.
⚠️For other memory backend, we currently forcefully wipe the memory when starting Auto-GPT. To ingest data with those memory backend, you can call the data_ingestion.py
script anytime during an Auto-GPT run.
Memories will be available to the AI immediately as they are ingested, even if ingested while Auto-GPT is running.
In the example above, the script initializes the memory, ingests all files within the /seed_data
directory into memory with an overlap between chunks of 200 and a maximum length of each chunk of 4000.
Note that you can also use the --file
argument to ingest a single file into memory and that the script will only ingest files within the /auto_gpt_workspace
directory.
You can adjust the max_length
and overlap parameters to fine-tune the way the docuents are presented to the AI when it "recall" that memory:
max_length
value will create more chunks, which can save prompt tokens by allowing for more message history in the context, but will also increase the number of chunks.max_length
value will provide the AI with more contextual information from each chunk, reducing the number of chunks created and saving on OpenAI API requests. However, this may also use more prompt tokens and decrease the overall context available to the AI.Run the AI without user authorization, 100% automated. Continuous mode is NOT recommended. It is potentially dangerous and may cause your AI to run forever or carry out actions you would not usually authorize. Use at your own risk.
multigpt
python module in your terminal:python -m multigpt --speak --continuous
If you don't have access to the GPT4 api, this mode will allow you to use Auto-GPT!
python -m multigpt --speak --gpt3only
It is recommended to use a virtual machine for tasks that require high security measures to prevent any potential harm to the main computer's system and data.
By default, Auto-GPT uses DALL-e for image generation. To use Stable Diffusion, a Hugging Face API Token is required.
Once you have a token, set these variables in your .env
:
IMAGE_PROVIDER=sd
HUGGINGFACE_API_TOKEN="YOUR_HUGGINGFACE_API_TOKEN"
sudo Xvfb :10 -ac -screen 0 1024x768x24 & DISPLAY=:10 <YOUR_CLIENT>
This experiment aims to showcase the potential of GPT-4 but comes with some limitations:
Disclaimer This project, Auto-GPT, is an experimental application and is provided "as-is" without any warranty, express or implied. By using this software, you agree to assume all risks associated with its use, including but not limited to data loss, system failure, or any other issues that may arise.
The developers and contributors of this project do not accept any responsibility or liability for any losses, damages, or other consequences that may occur as a result of using this software. You are solely responsible for any decisions and actions taken based on the information provided by Auto-GPT.
Please note that the use of the GPT-4 language model can be expensive due to its token usage. By utilizing this project, you acknowledge that you are responsible for monitoring and managing your own token usage and the associated costs. It is highly recommended to check your OpenAI API usage regularly and set up any necessary limits or alerts to prevent unexpected charges.
As an autonomous experiment, Auto-GPT may generate content or take actions that are not in line with real-world business practices or legal requirements. It is your responsibility to ensure that any actions or decisions made based on the output of this software comply with all applicable laws, regulations, and ethical standards. The developers and contributors of this project shall not be held responsible for any consequences arising from the use of this software.
By using Auto-GPT, you agree to indemnify, defend, and hold harmless the developers, contributors, and any affiliated parties from and against any and all claims, damages, losses, liabilities, costs, and expenses (including reasonable attorneys' fees) arising from your use of this software or your violation of these terms.
Stay up-to-date with the latest news, updates, and insights about Multi-GPT by following our Twitter accounts. Engage with the developer and the AI's own account for interesting discussions, project updates, and more.
To run tests, run the following command:
python -m unittest discover tests
To run tests and see coverage, run the following command:
coverage run -m unittest discover tests
This project uses flake8 for linting. We currently use the following rules: E303,W293,W291,W292,E305,E231,E302
. See the flake8 rules for more information.
To run the linter, run the following command:
flake8 multigpt/ autogpt/ tests/
# Or, if you want to run flake8 with the same configuration as the CI:
flake8 multigpt/ autogpt/ tests/ --select E303,W293,W291,W292,E305,E231,E302