AutoGPT, Is one of the great tools in AI to do automation on localhost or on the clout platform with docker.
You can use it anywhere you want.
You can do whatever you want.
The most amazing features of AutoGPT are:
- 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
- Extensibility with Plugins
So, Without wasting time let’s see how to install, and use AutoGPT with an example.
You are going to learn:
Table of Contents Table of Contents
Download AutoGPT from GitHub Download AutoGPT from GitHub
Always use the latest version of AutoGPT.
Step 1: Visit https://github.com/Significant-Gravitas/Auto-GPT/releases/latest
Step 2: Scroll down to the Assets section and download the Source code (zip) or Source code (tar.gz)
Step 3: Create a directory and unzip the files where you want.
I have created a directory AI
into the c:\ drive and unzipped the files which created the new directory Auto-GPT-0.2.2
Note: Here, I am using the old version Auto-GPT-0.2.2. Always refer to the new version.
Install Anaconda for Python Install Anaconda for Python
To use AutoGPT, we need the Python environment.
The Anaconda provides the same environment which we want.
If you are new here, or aware of Anaconda then don’t worry.
Just follow below simple steps:
Step 1: Visit the site and click on the download button
Note: If you are using MacOS or another operating system then the website detects it and shows the exact download button as per operating system.
Step 2: Install Anaconda: Just like any other software just click next, next, next, and ok.
Note: I’m avoiding other installation steps to keep this article as small as possible.
Open Terminal with Admin Privileges Open Terminal with Admin Privileges
To set up the Python environment for AutoGPT, we need to use:
- Windows PowerShell
- Command Prompt
- Git Bash
- Terminal
Anyone with admin privileges will work.
Sharing some screenshots to see how to open the terminal with Administrator privileges.
Open Windows PowerShell with Administrator privileges Open Windows PowerShell with Administrator privileges
Open Command Prompt with Administrator privileges Open Command Prompt with Administrator privileges
Open GitBash with Administrator privileges Open GitBash with Administrator privileges
Setup AutoGPT Environment with Anaconda Setup AutoGPT Environment with Anaconda
After opening the command prompt or terminal with admin privileges then you are able to perform the next steps.
I’m using Git Bash so, sharing the screenshots of them.
It’ll be the same commands on different terminals so keep the below screenshots just for your reference.
Step 1: Create Anaconda python environment for auto-gpt with conda create
command.
Use the below command to setup the auto-gpt:
conda create -n auto-gpt python=3.8
After executing the command you’ll get some permissions as below:
Just press y
the key from the keyboard and press enter a key to proceed.
Install AutoGPT Requirements Install AutoGPT Requirements
Navigate to the AutoGPT directory:
As we have unzipped the AutoGPT in c:/AI/Auto-GPT-0.2.2
the directory so just go to that directory from the same terminal.
I’m using the below command to Auto-GPT-0.2.2
cd /c/ai/Auto-GPT-0.2.2
Note: You can navigate to your directory where you have unzipped the Auto-GPT.
Install AutoGPT Requirements
Use command:
pip install -r requirements.txt
The installation requirements take a bit of time depending on your internet connection.
After successful installation you’ll see the message something as below:
Create the .env file Create the .env file
Create the
Use the below command:
cp .env.template .env
The above command simply copies the file .env.template
and create a new file .env
You can do it manually as well.
Add OpenAI API key Add OpenAI API key
Step 1: Open the .env
file and find the OPENAI_API_KEY
Setup the OpenAI Account, Payments, and API keys Setup the OpenAI Account, Payments, and API keys
Create OpenAI API key Create OpenAI API key
To create the OpenAI API key follow the below steps:
Step 1: Login or Register OpenAI website
Step 2: Setup the Payment Methods
Note: OpenAI is not expensive. To use the OpenAI API, you need to add some amount to your account.
Step 3: IMPORTANT – Set the Usage limits in the OpenAI platform
It’s important to set the usage limit as we using the AutoGPT + GPT4 APIs.
If you do not set the limit then it may cause an unnecessary loss of money.
So, Set the usage limit for your financial safety.
After adding the amount you can see it in the usage limit section something as below:
Here, You can see:
- Approved usage limit – I have added a $120.00 amount to use the OpenAI APIs.
- Current usage – This month, I have used $0.72 amount for the OpenAI APIs.
- Hard limit – I have set the $60.00 hard limit for my usage. So, When it reaches that amount my OpenAI API requests will work.
- Soft limit – I have set the $50.00 soft limit for my usage. So, When it reaches that amount then I get an email notification about it to take further action.
Thats it.
Create the OpenAI API Keys Create the OpenAI API Keys
Just copy the API key and paste it into the OPENAI_API_KEY from .env
file
Activate Conda AutoGPT Activate Conda AutoGPT
To activate the AutoGPT follow the below command:
conda activate auto-gpt
Run AutoGPT Run AutoGPT
Now, Everything is ready to use the AutoGPT.
Execute the file run.sh
from Git Bash. Or If you using another Windows terminal then use run.bat
file.
I’m using Git Bash so using the run.sh
as below:
For the first time, It prepares the setup and downloads the necessary packages:
Use the AutoGPT Use the AutoGPT
Finally, You see the Welcome screen something as below:
Step 1: Enter the AI Name.
You can enter any name which you want.
I’m entering the CoderPro name as:
Step 2: Add the AI role to the description
I have added the AI description as “A full stack developer“
(Ah! Typo mistake 😀 – It’s the full-stack, not full stack.)
Step 3: Add the goals to do with AutoGPT
Now, You can add the goals which you want to achieve with AutoGPT
For this tutorial, I have added 4 goals below:
Goal 1: Create a file hello-world.html into the c:\ai\Auto-GPT-0.2.2
Goal 2: Add a card HTML markup with the heading, sub-heading, and with button
Goal 3: Design the card with CSS
Goal 4: Put the code into the hello-world.html file and stop.
Let’s see how it works.
Note: After entering the 4th goal, you see Goal 5, Just press enter without adding anything to start the AutoGPT to generate process.
For me, After 15 seconds the AutoGPT generates the HTML page.
See what the HTML page looks like:
Below is the HTML markup which is generated by the AutoGPT bot
<!DOCTYPE html> <html> <head> <title>Hello World</title> <style> .card { box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2); transition: 0.3s; width: 50%; margin: auto; } .card:hover { box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2); } .container { padding: 2px 16px; } </style> </head> <body> <h2>Hello World</h2> <div class="card"> <div class="container"> <h4><b>Card Heading</b></h4> <p>Card Sub-heading</p> <button>Button</button> </div> </div> </body> </html>
We can see, the heading and the card generated as expected.
Not a more interesting page. But it is automated.
This is just a demo example of how to use AutoGPT.
What’s next? What’s next?
You can use AutoGPT as an assistant, do social automation, coding, design, etc.
AutoGPT allows you to do any kind of automation which uses the live internet.
How to set the OpenAI API key in AutoGPT? How to set the OpenAI API key in AutoGPT?
Open the file .env from the AutoGPT directory.
Find the OPENAI_API_KEY and add your API key.
To generate the API key, read the above article.
Can I enable the local command execution in AutoGPT? Can I enable the local command execution in AutoGPT?
Yes. With the help of a .env file, you can set up it.
EXECUTE_LOCAL_COMMANDS=true
By default it’s false.
Can I define a custom user agent while browsing the internet with AutoGPT? Can I define a custom user agent while browsing the internet with AutoGPT?
Yes. With the .env file, you can do it.
USER_AGENT={user-agent}
You can add your user agent.
Can I change the smart language model? Can I change the smart language model?
Yes. You can.
SMART_LLM_MODEL={model}
By default, the smart model is gpt-4
Can I change the fast language model? Can I change the fast language model?
Yes. You can.
FAST_LLM_MODEL={model}
By default, the smart model is gpt-3.5-turbo
How to set the fast token limit for OpenAI in AutoGPT? How to set the fast token limit for OpenAI in AutoGPT?
Yes. You can.
FAST_TOKEN_LIMIT={limit}
By default, the limit is 4000.
How to set the smart token limit for OpenAI in AutoGPT? How to set the smart token limit for OpenAI in AutoGPT?
Yes. You can.
SMART_TOKEN_LIMIT={limit}
By default, the limit is 8000.
Can I change the memory for AutoGPT? Can I change the memory for AutoGPT?
Yes. You can.
MEMORY_BACKEND={memory-type}
By default, the memory type is local.
Can I change the memory index for AutoGPT? Can I change the memory index for AutoGPT?
Yes. You can.
MEMORY_INDEX={index}
By default, the index is auto-gpt.
Can I use GitHub with AutoGPT? Can I use GitHub with AutoGPT?
Yes. You can.
GITHUB_API_KEY={github-key}
GITHUB_USERNAME={github-username}
Can I use Twitter with AutoGPT? Can I use Twitter with AutoGPT?
Yes. You can.
TW_CONSUMER_KEY={key}
TW_CONSUMER_SECRET={secret}
TW_ACCESS_TOKEN={token}
TW_ACCESS_TOKEN_SECRET={token-secret}
Can I use my custom Google API keys in AutoGPT? Can I use my custom Google API keys in AutoGPT?
Yes. You can.
Open the file .env and add/update the below code with your Google API keys.
GOOGLE_API_KEY={api-key}
CUSTOM_SEARCH_ENGINE_ID={search-engine-id}