Package: agpt
Auto-GPT: An Autonomous GPT-4 Experiment💡 Get help -Q&AorDiscord 💬🔴 🔴 🔴  Urgent: USEstablenotmaster🔴 🔴 🔴Download the lateststablerelease from here:https://github.com/Significant-Gravitas/Auto-GPT/releases/latest.Themasterbranch may often be in abrokenstate.Auto-GPT is an experimental open-source application showcasing the capabilities of the GPT-4 language model. This program, driven by GPT-4, chains together LLM "thoughts", to autonomously achieve whatever goal you set. As one of the first examples of GPT-4 running fully autonomously, Auto-GPT pushes the boundaries of what is possible with AI.Demo April 16th 2023https://user-images.githubusercontent.com/70048414/232352935-55c6bf7c-3958-406e-8610-0913475a0b05.mp4Demo made byBlake Werlinger💖 Help Fund Auto-GPT's Development 💖If you can spare a coffee, you can help to cover the costs of developing Auto-GPT and help push the boundaries of fully autonomous AI!
Your support is greatly appreciated
Development of this free, open-source project is made possible by all thecontributorsandsponsors. If you'd like to sponsor this project and have your avatar or company logo appear belowclick here.🚀 Features🌐 Internet access for searches and information gathering💾 Long-Term and Short-Term memory management🧠 GPT-4 instances for text generation🔗 Access to popular websites and platforms🗃️ File storage and summarization with GPT-3.5📋 RequirementsEnvironment (pick one)VSCode + devcontainer: It has been configured in the .devcontainer folder and can be used directlyDockerPython 3.10 or later (instructions:for Windows)OpenAI API keyOptionalMemory backend (pick one)PineconeMilvusRedisWeaviateElevenLabs Key (If you want the AI to speak)⚠️ OpenAI API Keys Configuration ⚠️Obtain your OpenAI API key from:https://platform.openai.com/account/api-keys.To use OpenAI API key for Auto-GPT, youNEEDto have billing set up (AKA paid account).You can set up paid account athttps://platform.openai.com/account/billing/overview.PLEASE ENSURE YOU HAVE DONE THIS STEP BEFORE PROCEEDING, OTHERWISE NOTHING WILL WORK!💾 InstallationTo install Auto-GPT, follow these steps:Make sure you have all therequirementslisted above, if not, install/get themTo execute the following commands, open a CMD, Bash, or Powershell window by navigating to a folder on your computer and typingCMDin the folder path at the top, then press enter.Clone the repository: For this step, you need Git installed. Alternatively,
you can download thelatest stable release(Source code (zip), bottom of the page).gitclone-bstablehttps://github.com/Significant-Gravitas/Auto-GPT.gitNavigate to the directory where the repository was downloadedcdAuto-GPTInstall the required dependenciespipinstall-rrequirements.txtConfigure Auto-GPTLocate the file named.env.templatein the main/Auto-GPTfolder.Create a copy of this file, called.envby removing thetemplateextension.  The easiest way is to do this in a command prompt/terminal windowcp .env.template .env.Open the.envfile in a text editor.Note: Files starting with a dot might be hidden by your Operating System.Find the line that saysOPENAI_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.envfile.By completing these steps, you have properly configured the API Keys for your project.SeeOpenAI API Keys Configurationto obtain your OpenAI API key.Obtain your ElevenLabs API key from:https://elevenlabs.io. You can view your xi-api-key using the "Profile" tab on the website.If you want to use GPT on an Azure instance, setUSE_AZUREtoTrueand then follow these steps:Renameazure.yaml.templatetoazure.yamland provide the relevantazure_api_base,azure_api_versionand all the deployment IDs for the relevant models in theazure_model_mapsection: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 IDPlease specify all of these values as double-quoted strings# Replace string in angled brackets (<>) to your own IDazure_model_map:fast_llm_model_deployment_id:"<my-fast-llm-deployment-id>"...Details can be found here:https://pypi.org/project/openai/in theMicrosoft Azure Endpointssection and here:https://learn.microsoft.com/en-us/azure/cognitive-services/openai/tutorials/embeddings?tabs=command-linefor the embedding model.🔧 UsageRunautogptPython module in your terminal.# On Linux of Mac:./run.sh# On Windows:.\run.batRunning with--helpafter.\run.batlists all the possible command line arguments you can pass.After each action, choose from options to authorize command(s),
exit the program, or provide feedback to the AI.Authorize a single command, enteryAuthorize a series ofNcontinuous commands, entery -NExit the program, enternLogsActivity and error logs are located in the./output/logsTo print out debug logs:python -m autogpt --debugDockerYou can also build this into a docker image and run it:dockerbuild-tautogpt.
dockerrun-it--env-file=./.env-v$PWD/auto_gpt_workspace:/app/auto_gpt_workspaceautogptOr if you havedocker-compose:docker-composerun--build--rmauto-gptYou can pass extra arguments, for instance, running with--gpt3onlyand--continuousmode:dockerrun-it--env-file=./.env-v$PWD/auto_gpt_workspace:/app/auto_gpt_workspaceautogpt--gpt3only--continuousdocker-composerun--build--rmauto-gpt--gpt3only--continuousCommand Line ArgumentsHere are some common arguments you can use when running Auto-GPT:Replace anything in angled brackets (<>) to a value you want to specifyView all available command line argumentspython-mautogpt--helpRun Auto-GPT with a different AI Settings filepython-mautogpt--ai-settings<filename>Specify a memory backendpython-mautogpt--use-memory<memory-backend>NOTE: There are shorthands for some of these flags, for example-mfor--use-memory. Usepython -m autogpt --helpfor more information🗣️ Speech ModeUse this to use TTS(Text-to-Speech)for Auto-GPTpython-mautogpt--speakList of IDs with names from eleven labs, you can use the name or ID:Rachel : 21m00Tcm4TlvDq8ikWAMDomi : AZnzlk1XvdvUeBnXmlldBella : EXAVITQu4vr4xnSDxMaLAntoni : ErXwobaYiN019PkySvjVElli : MF3mGyEYCl7XYWbV9V6OJosh : TxGEqnHWrfWFTfGW9XjXArnold : VR6AewLTigWG4xSOukaGAdam : pNInz6obpgDQGcFmaJgBSam : yoZ06aMxZJJ28mfd3POQ🔍 Google API Keys ConfigurationThis section is optional, use the official google api if you are having issues with error 429 when running a google search.
To use thegoogle_official_searchcommand, you need to set up your Google API keys in your environment variables.Go to theGoogle Cloud Console.If you don't already have an account, create one and log in.Create a new project by clicking on the "Select a Project" dropdown at the top of the page and clicking "New Project". Give it a name and click "Create".Go to theAPIs & Services Dashboardand click "Enable APIs and Services". Search for "Custom Search API" and click on it, then click "Enable".Go to theCredentialspage and click "Create Credentials". Choose "API Key".Copy the API key and set it as an environment variable namedGOOGLE_API_KEYon your machine. See setting up environment variables below.Enablethe Custom Search API on your project. (Might need to wait few minutes to propagate)Go to theCustom Search Enginepage and click "Add".Set up your search engine by following the prompts. You can choose to search the entire web or specific sites.Once you've created your search engine, click on "Control Panel" and then "Basics". Copy the "Search engine ID" and set it as an environment variable namedCUSTOM_SEARCH_ENGINE_IDon 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.Setting up environment variablesFor Windows Users:setxGOOGLE_API_KEY"YOUR_GOOGLE_API_KEY"setxCUSTOM_SEARCH_ENGINE_ID"YOUR_CUSTOM_SEARCH_ENGINE_ID"For macOS and Linux users:exportGOOGLE_API_KEY="YOUR_GOOGLE_API_KEY"exportCUSTOM_SEARCH_ENGINE_ID="YOUR_CUSTOM_SEARCH_ENGINE_ID"PluginsSeehttps://github.com/Significant-Gravitas/Auto-GPT-Plugin-Templatefor the template of the plugins.⚠️💀 WARNING 💀⚠️: Review the code of any plugin you use, this allows for any Python to be executed and do malicious things. Like stealing your API keys.Drop the repo's zipfile in the plugins folder.If you add the plugins class name to theALLOWLISTED_PLUGINSin the.envyou will not be prompted otherwise you'll be warned before loading the plugin:ALLOWLISTED_PLUGINS=example-plugin1,example-plugin2,example-plugin3Setting Your Cache TypeBy default, Auto-GPT is going to use LocalCache instead of redis or Pinecone.To switch to either, change theMEMORY_BACKENDenv variable to the value that you want:local(default) uses a local JSON cache filepineconeuses the Pinecone.io account you configured in your ENV settingsrediswill use the redis cache that you configuredmilvuswill use the milvus cache that you configuredweaviatewill use the weaviate cache that you configuredMemory Backend SetupRedis SetupCAUTIONThis is not intended to be publicly accessible and lacks security measures. Therefore, avoid exposing Redis to the internet without a password or at allInstall docker (or Docker Desktop on Windows)Launch Redis containerdockerrun-d--nameredis-stack-server-p6379:6379redis/redis-stack-server:latestSeehttps://hub.docker.com/r/redis/redis-stack-serverfor setting a password and additional configuration.Set the following settings in.envReplacePASSWORDin angled brackets (<>)MEMORY_BACKEND=redisREDIS_HOST=localhostREDIS_PORT=6379REDIS_PASSWORD=<PASSWORD>You can optionally setWIPE_REDIS_ON_START=Falseto persist memory stored in Redis.You can specify the memory index for redis using the following:MEMORY_INDEX=<WHATEVER>🌲 Pinecone API Key SetupPinecone 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.Go topineconeand make an account if you don't already have one.Choose theStarterplan to avoid being charged.Find your API key and region under the default project in the left sidebar.In the.envfile set:PINECONE_API_KEYPINECONE_ENV(example:"us-east4-gcp")MEMORY_BACKEND=pineconeAlternatively, you can set them from the command line (advanced):For Windows Users:setxPINECONE_API_KEY"<YOUR_PINECONE_API_KEY>"setxPINECONE_ENV"<YOUR_PINECONE_REGION>"# e.g: "us-east4-gcp"setxMEMORY_BACKEND"pinecone"For macOS and Linux users:exportPINECONE_API_KEY="<YOUR_PINECONE_API_KEY>"exportPINECONE_ENV="<YOUR_PINECONE_REGION>"# e.g: "us-east4-gcp"exportMEMORY_BACKEND="pinecone"Milvus SetupMilvusis an open-source, highly scalable vector database to store huge amounts of vector-based memory and provide fast relevant search.setup milvus database, keep your pymilvus version and milvus version same to avoid compatible issues.setup by open sourceInstall Milvusor setup byZilliz CloudsetMILVUS_ADDRin.envto your milvus addresshost:ip.setMEMORY_BACKENDin.envtomilvusto enable milvus as backend.Optional:setMILVUS_COLLECTIONin.envto change milvus collection name as you want,autogptis the default name.Weaviate SetupWeaviateis 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 Weaviateis supported which allows the Auto-GPT process itself to start a Weaviate instance. To enable it, setUSE_WEAVIATE_EMBEDDEDtoTrueand make sure youpip install "weaviate-client>=3.15.4".Install the Weaviate clientInstall the Weaviate client before usage.$ pip install weaviate-clientSetting up environment variablesIn your.envfile 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="Autogpt" # name of the index to create for the applicationView Memory UsageView memory usage by using the--debugflag :)🧠 Memory pre-seedingMemory pre-seeding allows you to ingest files into memory and pre-seed it before running Auto-GPT.# python data_ingestion.py -husage:data_ingestion.py[-h](--fileFILE|--dirDIR)[--init][--overlapOVERLAP][--max_lengthMAX_LENGTH]Ingestafileoradirectorywithmultiplefilesintomemory.Makesuretosetyour.envbeforerunningthisscript.

options:-h,--helpshowthishelpmessageandexit--fileFILEThefiletoingest.--dirDIRThedirectorycontainingthefilestoingest.--initInitthememoryandwipeitscontent(default:False)--overlapOVERLAPTheoverlapsizebetweenchunkswheningestingfiles(default:200)--max_lengthMAX_LENGTHThemax_lengthofeachchunkwheningestingfiles(default:4000)# python data_ingestion.py --dir DataFolder --init --overlap 100 --max_length 2000In the example above, the script initializes the memory, ingests all files within theAuto-Gpt/autogpt/auto_gpt_workspace/DataFolderdirectory into memory with an overlap between chunks of 100 and a maximum length of each chunk of 2000.Note that you can also use the--fileargument to ingest a single file into memory and that data_ingestion.py will only ingest files within the/auto_gpt_workspacedirectory.The DIR path is relative to the auto_gpt_workspace directory, sopython data_ingestion.py --dir . --initwill ingest everything inauto_gpt_workspacedirectory.You can adjust themax_lengthand overlap parameters to fine-tune the way the docuents are presented to the AI when it "recall" that memory:Adjusting the overlap value allows the AI to access more contextual information from each chunk when recalling information, but will result in more chunks being created and therefore increase memory backend usage and OpenAI API requests.Reducing themax_lengthvalue 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.Increasing themax_lengthvalue 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.Memory pre-seeding is a technique for improving AI accuracy by ingesting relevant data into its memory. Chunks of data are split and added to memory, allowing the AI to access them quickly and generate more accurate responses. It's useful for large datasets or when specific information needs to be accessed quickly. Examples include ingesting API or GitHub documentation before running Auto-GPT.⚠️ If you use Redis as your memory, make sure to run Auto-GPT with theWIPE_REDIS_ON_START=Falsein your.envfile.⚠️For other memory backend, we currently forcefully wipe the memory when starting Auto-GPT. To ingest data with those memory backend, you can call thedata_ingestion.pyscript 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.💀 Continuous Mode ⚠️Run the AIwithoutuser 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.Run theautogptpython module in your terminal:python-mautogpt--speak--continuousTo exit the program, press Ctrl + CGPT3.5 ONLY ModeIf you don't have access to the GPT4 api, this mode will allow you to use Auto-GPT!python-mautogpt--speak--gpt3onlyIt 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.🖼 Image GenerationBy default, Auto-GPT uses DALL-e for image generation. To use Stable Diffusion, aHugging Face API Tokenis required.Once you have a token, set these variables in your.env:IMAGE_PROVIDER=sdHUGGINGFACE_API_TOKEN="YOUR_HUGGINGFACE_API_TOKEN"SeleniumsudoXvfb:10-ac-screen01024x768x24&DISPLAY=:10<YOUR_CLIENT>⚠️ LimitationsThis experiment aims to showcase the potential of GPT-4 but comes with some limitations:Not a polished application or product, just an experimentMay not perform well in complex, real-world business scenarios. In fact, if it actually does, please share your results!Quite expensive to run, so set and monitor your API key limits with OpenAI!🛡 DisclaimerDisclaimer
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.🐦 Connect with Us on TwitterStay up-to-date with the latest news, updates, and insights about Auto-GPT by following our Twitter accounts. Engage with the developer and the AI's own account for interesting discussions, project updates, and more.Developer: Follow@siggravitasfor insights into the development process, project updates, and related topics from the creator of Entrepreneur-GPT.Entrepreneur-GPT: Join the conversation with the AI itself by following@En_GPT. Share your experiences, discuss the AI's outputs, and engage with the growing community of users.We look forward to connecting with you and hearing your thoughts, ideas, and experiences with Auto-GPT. Join us on Twitter and let's explore the future of AI together!Run testsTo run all tests, run the following command:pytestTo run just without integration tests:pytest --without-integrationTo run just without slow integration tests:pytest --without-slow-integrationTo run tests and see coverage, run the following command:pytest--cov=autogpt--without-integration--without-slow-integrationRun linterThis project usesflake8for linting. We currently use the following rules:E303,W293,W291,W292,E305,E231,E302. See theflake8 rulesfor more information.To run the linter, run the following command:flake8autogpt/tests/# Or, if you want to run flake8 with the same configuration as the CI:flake8autogpt/tests/--selectE303,W293,W291,W292,E305,E231,E302