Getting Started with AutoGPT: an Autonomous GPT-4 Experiment
GPT-4, ChatGPT Plugins...those were all the rage last month, but as AI shows no slowing down, there's a new project taking the world by storm: Auto-GPT.
With more GitHub stars than PyTorch and one of the brightest minds in AI, Andrej Karpathry, calling Auto-GPT the "next frontier of prompt engineering", this project is clearly one to keep an eye on.
In this guide, we'll discuss what Auto-GPT is, what all the excitement is about, and how you can get started with this "autonomous GPT-4 experiment".
Next frontier of prompt engineering imo: "AutoGPTs" . 1 GPT call is just like 1 instruction on a computer. They can be strung together into programs. Use prompt to define I/O device and tool specs, define the cognitive loop, page data in and out of context window, .run(). https://t.co/EKy84pa5bB
— Andrej Karpathy (@karpathy) April 2, 2023
In particular, we'll discuss:
- What is Auto-GPT?
- Getting Started with Auto-GPT
- Installing & Configuring Auto-GPT
- How to Run Auto-GPT
What is Auto-GPT?
As the GitHub repo highlights:
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.
Similar to the concept of LangChain's chains, tools, and agents, a few of the key features of AutoGPT include:
- Internet access for web browsing and retrieving information
- Long and short-term memory management
- GPT-4 for text generation
- File storage and summarization using GPT 3.5
Getting Started with Auto-GPT
Ok now we know what it is, let's see what all the excitement is about by diving into how to get started with the library.
Requirements
First off, we're going to need an OpenAI API as well as Python 3.10 or later to work with Auto-GPT.
Optional
In addition, we can also optionally use a vector database for long-term memory such as Pinecone, Milvus, and Redis. Since I've already worked with Pinecone, I'll use it again for this experiment.
Another exciting feature we can add is ElevenLabs in order to speak to our Auto-GPT AI assistant.
Step 1: Installing & Configuring Auto-GPT
Alright now let's go and clone the Auto-GPT repository and install the necessary dependencies as follows:
Clone GitHub repo
git clone https://github.com/Significant-Gravitas/Auto-GPT.git
Navigate to Auto-GPT directory
cd Auto-GPT
Install dependencies
pip install -r requirements.txt
Configure environment variables
Next, we need to configure the following environment variables:
- First, locate the
.env.template
in the/Auto-GPT
folder and create a copy of it called.env
- we can do this from the command line withcp .env.template .env
- Next, we need to open the
.env
file and add our OpenAI key here:OPENAI_API_KEY=
...(no quotes or spaces) and save the file
We've now got the necessary API keys in place, although as mentioned there are several others we can use such as ElevenLabs, Pinecone, etc., although for now we'll just stick with the basics.
How to Run Auto-GPT
Now let's go ahead and run Auto-GPT as follows:
python -m autogpt
Here we go, now let's name our agent...Agent001 seems appropriate.
Now we see...
Agent001 here! I am at your service.
Describe your AI's role: For example, 'an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth.'
For this example, I'm going to create an agent that can help me run this website, namely by writing Python and machine learning tutorials.
Your role is to autonomously write Python and machine learning tutorials based on the provided subject. Each tutorial should be aimed at beginner/intermediate programmers and should include clear step-by-step instructions, code examples, and relevant resources for the topics referenced.
Now, we can enter up to 5 goals for our autonomous agent...
For example: Increase net worth, Grow Twitter Account, Develop and manage multiple businesses autonomously
For this example, I'll add the following goals:
- Help users stay up-to-date with the latest developers in AI
- Teach machine learning concepts in an accessible way for both a technical and non-technical audience
- Increase organic search traffic with long-form, in-depth articles
Alright, while this is running a few key commands to be aware of include
- You can authorize a single command by entering
y
- You can authorize a series of N continuous commands with
y -N
- To exit the program enter
n
Good start, I'll authorize it to search Google for "recent developments in AI and machine learning".
Next up, it's going to analyze a few webpages and ensure they're reliable, which in this case was MIT so that is definitely a good start. It's then going to use the information gathered from the MIT website and use GPT-4 to generate ideas for a tutorial...nice.
Now Auto-GPT has decided that "Federated Learning" is a good topic for a tutorial, sounds good.
Next it's decided to browse WikiPedia as a starting point for an overview of the topic...makes sense.
Now AutoGPT has the content and is asking to write to a file:
Now that I've written the file, it looks like it got caught in a loop and is performing the same tasks again, which is a common limitation at the moment.
Summary: Getting Started with AutoGPT
All in all, for a first test the article is a quite impressive, and it's very obvious why everyone is so excited about this...autonomous agents are the future of AI.
Now that we've got the basics covered, in future articles we'll go over how to expand on this and setup long-term memory, speech to text with Eleven Labs, and more.
As I mentioned, the value of autonomous agents is undeniable, but of course so are the risks. With the ability to write code, push files to GitHub, browse the web, and so on...there's little doubt that autonomous agents come with a certain degree of risk.
That said, it's seems in the very near future autonomous AI assistants will proliferate our every day lives—from personal assistants helping you hit your health goals to work-related assistants that automate many day-to-day tasks.
In my opinion, the best way to prepare for this is to stay-up-to-date and experiment with all the new developments so you can learn which tools you can use to automate tedious parts of your job and ultimately stay ahead of the competition.
To that end, we'll continue experiments and posting more AutoGPT guides in the coming weeks to see what's possible with this exciting new software...
AI isn't a job destroyer.
— The AI Solopreneur (@aisolopreneur) April 17, 2023
It's a job creator.
By automating all of the tedious & boring work, it'll free humans to work on more creative & fulfilling projects.