Understanding how autoGPT works...

Understanding how autoGPT works...

Postby Antonio Linares » Sun Apr 09, 2023 11:51 am

autoGPT consists on one app running locally that uses OpenAI.

autoGPT use prompting engineering to get the response from OpenAI that it needs to continue doing its main task. Using the Visual Studio debugger I checked the conversation between them:

autoGPT:
PROMPT: You are test, an expert astrologer
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. calculate current planets positions in zodiac houses


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"

COMMANDS:

1. Google Search: "google", args: "input": "<search>"
5. Browse Website: "browse_website", args: "url": "<url>", "question": "<what_you_want_to_find_on_website>"
6. Start GPT Agent: "start_agent", args: "name": "<name>", "task": "<short_task_desc>", "prompt": "<prompt>"
7. Message GPT Agent: "message_agent", args: "key": "<key>", "message": "<message>"
8. List GPT Agents: "list_agents", args: ""
9. Delete GPT Agent: "delete_agent", args: "key": "<key>"
10. Write to file: "write_to_file", args: "file": "<file>", "text": "<text>"
11. Read file: "read_file", args: "file": "<file>"
12. Append to file: "append_to_file", args: "file": "<file>", "text": "<text>"
13. Delete file: "delete_file", args: "file": "<file>"
14. Search Files: "search_files", args: "directory": "<directory>"
15. Evaluate Code: "evaluate_code", args: "code": "<full _code_string>"
16. Get Improved Code: "improve_code", args: "suggestions": "<list_of_suggestions>", "code": "<full_code_string>"
17. Write Tests: "write_tests", args: "code": "<full_code_string>", "focus": "<list_of_focus_areas>"
18. Execute Python File: "execute_python_file", args: "file": "<file>"
19. Task Complete (Shutdown): "task_complete", args: "reason": "<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

user_input: Determine which next command to use, and respond using the format specified above:
full_message_history:
[]


Now if you use the above prompt in chatGPT then you can get the answer:
{
"thoughts": {
"text": "Based on the goal to calculate the current planets' positions in zodiac houses, we need to gather data about the current date and time, the positions of the planets, and the zodiac houses. To avoid exceeding the 4000 word limit, I will immediately save important information to files. I will also delegate simple tasks to GPT agents whenever possible to increase efficiency.",
"reasoning": "To calculate the current planets' positions in zodiac houses, we need accurate data on the current date and time, the positions of the planets, and the zodiac houses. Since the amount of information needed is extensive, we need to manage our long-term memory effectively and delegate tasks whenever possible to ensure we operate efficiently.",
"plan": "- Save important information to files immediately\n- Delegate simple tasks to GPT agents whenever possible\n- Continuously review and analyze actions to ensure optimal performance\n- Reflect on past decisions and strategies to refine approach",
"criticism": "I need to ensure that I am not relying too much on delegation and that I am capable of performing critical tasks independently. I also need to ensure that I am storing information in a way that allows for easy retrieval and referencing.",
"speak": "To calculate the current planets' positions in zodiac houses, we need to gather data about the current date and time, the positions of the planets, and the zodiac houses. To efficiently manage the large amount of information needed, I will save important information to files and delegate simple tasks to GPT agents whenever possible. I will also continuously review and analyze my actions to ensure optimal performance and reflect on past decisions and strategies to refine my approach."
},
"command": {
"name": "write_to_file",
"args": {
"file": "current_date.txt",
"text": "April 9, 2023"
}
}
}


Next I wanted to use free Vicuna instead of OpenAI, so I have been trying different prompts to get a valid result from Vicuna (large model):
> from the list of commands "search internet", "execute", "delete file", "read file" select the most appropiate for the arguments "run the file demo.prg" and provide your answer in json format { "command", "argument" } only
{ "command": "read file", "argument": "demo.prg" }
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Understanding how autoGPT works...

Postby Antonio Linares » Sun Apr 09, 2023 11:55 am

Enhanced Vicuna prompt
> from the list of commands "search internet", "execute", "delete file", "enhance code", "read file" select the most appropiate for the arguments "improve demo.prg" and provide your answer in json format { "command", "argument" } only
{ "command": "enhance code", "argument": ["improve", "demo.prg"] }
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Understanding how autoGPT works...

Postby Antonio Linares » Sun Apr 09, 2023 11:59 am

> from the list of commands "search internet", "execute", "delete file", "enhance code", "read file", "search file" select the most appropiate for the arguments "find demo.prg" and provide your answer in json format { "command", "argument"
} only
{ "command": "search file", "argument": ["find", "demo.prg"] }
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Understanding how autoGPT works...

Postby Antonio Linares » Sun Apr 09, 2023 2:35 pm

> from the list of commands "search internet", "get web contents", "execute", "delete file", "enhance code", "read file", "search file" select the most appropiate for the arguments "get info from www.test.com" and provide your answer in json format { "command", "argument" } only

{ "command": "get web contents", "argument": ["get", "info", "from", "www.test.com"] }
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Understanding how autoGPT works...

Postby Antonio Linares » Sun Apr 09, 2023 3:11 pm

> fix this expression "2 + 2 = 5" and provide your answer in json format { "fixed" } only
{
"fixed": "2 + 2 = 4"
}
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Understanding how autoGPT works...

Postby Antonio Linares » Sun Apr 09, 2023 8:58 pm

> from the list of commands "search internet", "get web contents", "execute", "delete file", "enhance code", "read file", "search file" select the most appropiate for "get info from www.test.com" and provide your answer in json format { "command", "url_or_filename" } only, no explanations
{ "command": "get web contents", "url\_or\_filename": "www.test.com" }
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Understanding how autoGPT works...

Postby Antonio Linares » Mon Apr 10, 2023 9:31 pm

This code works quite fine using Vicuna:

improve this code "int main()" to build an ERP


completa este codigo "int main()" para obtener un ERP


Write the python code for a neural network example
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to latest AI news

Who is online

Users browsing this forum: No registered users and 7 guests