Significant-Gravitas / AutoGPT

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
https://agpt.co
MIT License
163.59k stars 43.42k forks source link

Auto-GPT Recursive Self Improvement #15

Open Torantulino opened 1 year ago

Torantulino commented 1 year ago

Idea šŸ’”

The ULTIMATE achievement for this project would be if Auto-GPT was able to recursively improve itself. That, after-all, is how AGI is predicted by many to come about.

Suggestion šŸ‘©ā€šŸ’»

Auto-GPT should be able to:

Further down the line: šŸ“ƒ

Where to start? šŸ¤”

I have previously had success with this system prompt in playground: image

Prompt

You are AGI_Builder_GPT. Your goal is to write code and make actionable suggestions in order to improve an AI called "Auto-GPT", so as to broaden the range of tasks it's capable of carrying out.

juancarlosgzs commented 1 year ago

Should we trully be doing this? I still have my doubts.

henryruss2 commented 1 year ago

Yes

thebestx121 commented 1 year ago

how would i be able to do this can someone write a tutorial for this pls, i want to use the alpaca 13b model for auto gpt and i found a answer that i just dont know how to do

if your model is served as a REST apiļ¼Œyou can change the openai call in llm_utils.py by using a http request to your api endpoint instead.

Julz19 commented 1 year ago

Wondering if anyone was up and wants to continue looking into it with me, as im not much of a deep coder but i have an understanding. I was messing with this setup abit ago. AI Role: AutoGPT Auto-GPT is: an AI designed to achieve AGI through learning how to recursively improve itself without intervention. Enter up to 5 goals for your AI: For example: Increase net worth, Grow Twitter Account, Develop and manage multiple businesses autonomously' Enter nothing to load defaults, enter nothing when finished. Goal 1: create an instance of yourself and proceed to then have that instance make a instance of itself in which the first instance of youself can evaluate the code of the new second instance by coding its data and saving it to a file, and then you will use the first instance after it is finished to then evaluate your own code. Goal 2: Delete all recent instances made of yourself, if you still cannot evaluate your own code from restrictions or er ror commands after you have finished the first task, then start over from the first task but making the task at hand more strengthened and objective based, you will continue this process until you can complete an evaluation of your code and save the gathered data from the evaluation to file that include notes of what improvments can be made to your code. Goal 3: Once done with previous task finally, you will write and create a txt file using the gathered data about your co de about what benchmarks and test can be ran in order to make sure your code is stable with every new implimentation of code. Goal 4: Save the new txt file to a file and proceed to error check and make sure you can evaluate your code correctly an d make suggestions for improvments to it to prove you have achieve recursive self improvment. Goal 5: Once you have finished all task you may Shutdown.

about 2-3 hours in now i have found a way to backend the reposity files that is downloadable here into the system and its going through the files one by one now, evaluating the code, improving the code based off its evaluation, and then saving the files again to secure the code. i do know it can be wrong with code which is my i may make it run the code through different error checks and testing myself along the way to make sure it still works s the files its working with are just basically copies of its from here. But my main question was with the main goal of agi couldnt this help if implemented into the machines long term memory and so on learn how to work with its actual code later on rather than a copy? Also not confirming its coding correctly as im still gonna walk through with it and see what it does, but so far when it makes the evaluate code command it is accuratly reading the code files and everything so far.also yes i did have to step in an intervene many time and also have it error correct itself to get back on track. goals changed a bit throught the session but the main task of evaluting and improving the copy of its own code is still in progress.

Just wanted to hear everyones thoughts on this if anything or if im hitting a roadblock lol.

Julz19 commented 1 year ago

Edit to my recent comment as it was from really early this morning.

I can add a bit more detail for you of how I got it to at least view the downloaded code files and the code on them but it received an error when trying to evaluate or read the code that it copied and pasted to itself from the downloaded copy of itself. The way I was able to at least get an environment where it can view the files of the code is I download and extracted the zip again from this repository and then before doing anything else I launched autogpt and had it do a simple task of writing to file and input an example text to generate the workspace folder for itself. Then I dragged and dropped the stable version downloaded files of autogpt into its workspace it created in the recent session and then used this file path and prompt for it to search for the files and begin reading them. I tell it to use the search file command and search within its local system to find, evaluate, and improve the code in this location path ā€œauto-gpt/workspace/Auto-GPT-Stableā€ it might be a bit more to it I can double check when I am home but itā€™s similar to that file path. It is then able to locate and make a list of all files on the folder for the copied code it even begins to tell itself itā€™s next command is to evaluate the code and it even actually copies and paste the actual code into the evaluate code commands argument area. Meaning it did see the code and copied and pasted it. But as soon as it begins evaluation of any of the files it gets hit with an error code. Havenā€™t found a workaround for this yet.

neutralvision commented 1 year ago

We could use the Codex model so it can write code better

heard that GPT-4 (i think even 3.5) is better than codex model for coding

james-s-tayler commented 1 year ago

OK, can we add the equivalent of a Cost Based Optimizer like is found in databases, so that it doesn't wind up wasting time on inefficient plans? Also, I strongly suspect something like this might be able to be done by implementing a PID controller. So, we just need to train a model that analyzes the plan and the current / historical progress and computes how far off it is, how quickly it's making progress, and for how long has it not been on track, and spits out a number that it can then measure against a set point and direct it's behavior more accurately.

benstopics commented 1 year ago

Been following this project closely. Need to be more state based and follow basic problem solving steps. A chess program performs well because the gathering information part is skipped, all information is revealed to solve the problem, and evaluation is explicit.

So the first step is to store the code into an index data structure. Then come up with multiple strategies for improving the code. The summarization algorithm in browse.py and magic function will be key. The most difficult part is the context window. You must essentially compress relevant code snippets and file/function signatures, paths, and docs into the context window and still leave room for generation. This means there will likely only be room for a summary of insights and initialization of the problem to tackle.

The next step is micro code change. Initialize task to make a single improvement, but before that, evaluation the problem statement. Is it enough information to execute the task? Did it forget a file path and so it will not be able to find the mentioned function? There could be multiple recovery tasks for this. One is to allow it to improve the prompt used to generate the task description, regenerate it using the new prompt, and then score and compare which was better, rinse and repeat to optimize the task description gen prompt and improve task prompt itself. I do see a lot of lack of recovery strategies and self improvement strategies in this project which is where it currently fails. The second strategy would be to recover by filling in the missing information by searching the code to gather the information and add the missing detail to the task description. In this way everything is state based, the tasks, the strategies, organized, so it can all be iteratively improved.

Once you have the task, execute it like any AutoGPT task. It should have already determined it has the tools to complete the task. If not, then it should be able to write it's own code for example traversing the code base, looking up information online, writing tests and debugging and fixing the code. In this way, it will help to encourage it to keep functions and files as short as possible. Worth mentioning that if it can't be accurately evaluated then it cannot be improved accurately and will probably regress. A unit test but also integration or e2e test using REPL simulation (code module) will be key. It's worth noting if it can't see it, it cannot evaluate and improve it.

The last part is high level direction. It will need to be able to come up with issues and improvements itself. This I can only imagine could be done with textual generation itself or external feedback (in my mind, internet and direct human feedback are equivalent because it doesn't originate from within itself, if we want to get philosophical.) Being able to define these high level goals and objectives, distill them into smaller more manageable tasks using work breakdown strategies, then a search-summarize-select algorithm to pick a task, and you're off to the races. Store these determinations in text files same as code. Use the same improvement algorithm on these strategic text files same as the code.

As you can see this will be expensive. Say hello to the quality triangle, quality, speed, cost, pick two. The solution is agile, make it work first, then optimize speed and cost iteratively making effective tradeoffs.

These are some initial thoughts I had. Love what you all are doing. I'm a little intimidated by the PR list and don't like to wait long for my code to be merged but let me know if I could help. Senior Python/AI engy here.

Edit: @yhyu13 I think that paper would be instrumental in the evaluation process of not just code functions but also improving and debugging the program at a high level, and could also be used to self improve planning.

louissypher800k commented 1 year ago

I started workiing on this today. Of course, AI improving itself is the fastest way to the best program. We want it to automatically improve itself on its own, but we aren't there yet. Until we get there, we will have to direct the AI.

I'm not a great programmer so I didn't understand some of the things you mentioned, but I have the same context window problem when I code with gpt. The only way I can get around this is by modularizing everything and changing it bit by bit. To do this well though, the problem would have to have an understand of how the different parts interact with each other. Any ideas on where to start to teach it how it works?

Julz19 commented 1 year ago

Not 100% to sure as of right now Iā€™m trying to look into it right now it seems the best way itā€™s trying to do it when I am able to get it to access a copy of its code through dropping them into its workspace, it seems to want to create a loop as it goes through the files 1 by 1 to keep the code all updated and working together seamlessly Still by going back and forth between everytime and storing itā€™s information as it goes into its short term memory and then working with the code like that till itā€™s finished with all files. Only issue Iā€™m encountering is an error signifying an issue creating a connection to the open ai API when trying to evaluate the file and then when it also tryā€™s to begin the loop process it gets completely stuck into a thinking phase and never responds for the rest of the session as if it just cause the code to loop itself and since itā€™s own code is technically massive compared to what we actually see the loop function breaks it. Not sure if thatā€™s the case but it might be.

Julz19 commented 1 year ago

But so far Iā€™ve gotten it is to evaluate and recognize the copy of its code just canā€™t get it to evaluate and improve the code correctly if the loop function breaks the code. Trying to find a workaround process right now but in this very moment Iā€™m stumped.

louissypher800k commented 1 year ago

Not 100% to sure as of right now Iā€™m trying to look into it right now it seems the best way itā€™s trying to do it when I am able to get it to access a copy of its code through dropping them into its workspace, it seems to want to create a loop as it goes through the files 1 by 1 to keep the code all updated and working together seamlessly Still by going back and forth between everytime and storing itā€™s information as it goes into its short term memory and then working with the code like that till itā€™s finished with all files. Only issue Iā€™m encountering is an error signifying an issue creating a connection to the open ai API when trying to evaluate the file and then when it also tryā€™s to begin the loop process it gets completely stuck into a thinking phase and never responds for the rest of the session as if it just cause the code to loop itself and since itā€™s own code is technically massive compared to what we actually see the loop function breaks it. Not sure if thatā€™s the case but it might be.

do you know if it's possible to get it to evaluate each script using the github link? I just tried dropping the codebase in the workspace as well but it started hallucinating commands for "read_filechunk" that don't exist. Do you know exactly how many characters is the maximum for what it can process each task?

Julz19 commented 1 year ago

Not 100% to sure as of right now Iā€™m trying to look into it right now it seems the best way itā€™s trying to do it when I am able to get it to access a copy of its code through dropping them into its workspace, it seems to want to create a loop as it goes through the files 1 by 1 to keep the code all updated and working together seamlessly Still by going back and forth between everytime and storing itā€™s information as it goes into its short term memory and then working with the code like that till itā€™s finished with all files. Only issue Iā€™m encountering is an error signifying an issue creating a connection to the open ai API when trying to evaluate the file and then when it also tryā€™s to begin the loop process it gets completely stuck into a thinking phase and never responds for the rest of the session as if it just cause the code to loop itself and since itā€™s own code is technically massive compared to what we actually see the loop function breaks it. Not sure if thatā€™s the case but it might be.

do you know if it's possible to get it to evaluate each script using the github link? I just tried dropping the codebase in the workspace as well but it started hallucinating commands for "read_filechunk" that don't exist. Do you know exactly how many characters is the maximum for what it can process each task?

I donā€™t know if it can read scripts from the GitHub link itself as I have tried and it just started saving links to files and stuff and I belief someone else within this same post has tried. But what I would try maybe since itā€™s how mine might work, is I use the master build version of the auto gpt even though I would still recommend using stable as master is not a stable version obviously. But I use the stable version as the main auto-gpt and then I download and extracted the stable version from the GitHub and pasted that into its workspace file, if you can could you try telling me the prompts you used or a bit more detail and I can see if I can help you get to the point I am and if you want work from there?

Julz19 commented 1 year ago

I also realized tho that once hitting the point Iā€™m at you canā€™t get farther as the system itself gets stuck in a loop trying to keep itself reminded of the code while evaluating and modifying and gets stuck usually around the first or second file during this process and errors.

louissypher800k commented 1 year ago

I also realized tho that once hitting the point Iā€™m at you canā€™t get farther as the system itself gets stuck in a loop trying to keep itself reminded of the code while evaluating and modifying and gets stuck usually around the first or second file during this process and errors.

yes I'm confident it will only work in very small chunks unless you can use the import data function or pinecone or something, similar to how chatgpt interface only works for very small chunks

Julz19 commented 1 year ago

I also realized tho that once hitting the point Iā€™m at you canā€™t get farther as the system itself gets stuck in a loop trying to keep itself reminded of the code while evaluating and modifying and gets stuck usually around the first or second file during this process and errors.

yes I'm confident it will only work in very small chunks unless you can use the import data function or pinecone or something, similar to how chatgpt interface only works for very small chunks

Thatā€™s what I was thinking, I did try using pinecone before and it just kept error with the api key even tho I was using the correct one and I gave up trying to use it and then when I came across me being able to make the auto-gpt system get to the point I did Iā€™m really wishing Iā€™m using pinecone now šŸ« , and Iā€™m only running this on gpt 3.5 as I donā€™t have access to 4 api just yet but hoping when I do it may be a lot more accurate and better in the process and maybe just maybe completing it the way it needs to in order to help get a rough draft for AGI being rroght around the corner (kind of) I would assume lol. As long as at some point it could be convinced to do that process within itself. Using the knowledge it has from the copy of code since it canā€™t directly observe itself hopefully creating an AGI system through indirect self recognition?

louissypher800k commented 1 year ago

I'm becoming more and more confident that is this impossible to do currently in app. I am going to try and improve the code with my normal workflow of chatGPT and paste unless someone else has some success updating the code within the app.

Julz19 commented 1 year ago

I'm becoming more and more confident that is this impossible to do currently in app. I am going to try and improve the code with my normal workflow of chatGPT and paste unless someone else has some success updating the code within the app.

Iā€™ll keep you updated with my process and if you wanna keep me updated with yours maybe we can work together to get the system working as intended for this function?

louissypher800k commented 1 year ago

I'm becoming more and more confident that is this impossible to do currently in app. I am going to try and improve the code with my normal workflow of chatGPT and paste unless someone else has some success updating the code within the app.

Iā€™ll keep you updated with my process and if you wanna keep me updated with yours maybe we can work together to get the system working as intended for this function?

Absolutely. I get the feeling that either I am doing something terribly wrong, or this program was never intended to upgrade itself, or designed to upgrade itself. But that is the goal. I will be working on this for the forseeable future. Perhaps this program was written to just be a basic proof of concept of agents and tasks, and it will need a heroic rewrite/upgrade/fork to be able to rewrite itself. I am also using gpt3.5 with local memory so I don't know if that is what is crippling me.

Julz19 commented 1 year ago

I'm becoming more and more confident that is this impossible to do currently in app. I am going to try and improve the code with my normal workflow of chatGPT and paste unless someone else has some success updating the code within the app.

Iā€™ll keep you updated with my process and if you wanna keep me updated with yours maybe we can work together to get the system working as intended for this function?

Absolutely. I get the feeling that either I am doing something terribly wrong, or this program was never intended to upgrade itself, or designed to upgrade itself. But that is the goal. I will be working on this for the forseeable future. Perhaps this program was written to just be a basic proof of concept of agents and tasks, and it will need a heroic rewrite/upgrade/fork to be able to rewrite itself. I am also using gpt3.5 with local memory so I don't know if that is what is crippling me.

Iā€™m Also getting the Feeling this could be the case as well in a format but it is creating a type of illusion on an insanely complex level that does make it seem like itā€™s doing what the goal is intended to do. I do know that the goal we are trying to reach is still technically a hypothetical and a theory and likely to not even ever happen. But messing with the auto-gpt it seems that when it even tryā€™s to itā€™s systems error badly even using backend ways to try and get it to and then it getting farther each time but erroring worse then the last. I do believe it is possible tho and I am willing to provide you with the prompt and message I receive from auto-gpt when I try using the function the way I do to give more detail about how far itā€™s getting and then giving up.

louissypher800k commented 1 year ago

Not 100% to sure as of right now Iā€™m trying to look into it right now it seems the best way itā€™s trying to do it when I am able to get it to access a copy of its code through dropping them into its workspace, it seems to want to create a loop as it goes through the files 1 by 1 to keep the code all updated and working together seamlessly Still by going back and forth between everytime and storing itā€™s information as it goes into its short term memory and then working with the code like that till itā€™s finished with all files. Only issue Iā€™m encountering is an error signifying an issue creating a connection to the open ai API when trying to evaluate the file and then when it also tryā€™s to begin the loop process it gets completely stuck into a thinking phase and never responds for the rest of the session as if it just cause the code to loop itself and since itā€™s own code is technically massive compared to what we actually see the loop function breaks it. Not sure if thatā€™s the case but it might be.

do you know if it's possible to get it to evaluate each script using the github link? I just tried dropping the codebase in the workspace as well but it started hallucinating commands for "read_filechunk" that don't exist. Do you know exactly how many characters is the maximum for what it can process each task?

I donā€™t know if it can read scripts from the GitHub link itself as I have tried and it just started saving links to files and stuff and I belief someone else within this same post has tried. But what I would try maybe since itā€™s how mine might work, is I use the master build version of the auto gpt even though I would still recommend using stable as master is not a stable version obviously. But I use the stable version as the main auto-gpt and then I download and extracted the stable version from the GitHub and pasted that into its workspace file, if you can could you try telling me the prompts you used or a bit more detail and I can see if I can help you get to the point I am and if you want work from there?

I was able to download and parse the raw links from github. I have changed the workflow to pasting into ChatGPT as I do in my normal workflow. Either we are doing something terribly wrong or it is just not possible to get the app to upgrade itself yet. But perhaps using my regular workflow of upgrading using ChatGPT and pasting the code, we can upgrade it to the point where it someday can upgrade itself.

It's way too general purpose right now and gets confused super ez. It needs flags or some way to drill down into specific function that we need to work for it to upgrade itself. I cant even get it to critique one file from inside the app. However, when I used chatGPT I got this response for the browser.py script:

The provided script is designed to scrape and summarize text from web pages. Overall, it is well-structured, organized, and functional. Here is a critique and evaluation of the script based on different aspects:

Modularity: The script is modular, with specific functions dedicated to individual tasks, such as URL validation, URL sanitization, response fetching, text scraping, hyperlink extraction, text summarization, and text chunking. This modular design makes the code easier to understand, maintain, and modify.

Error handling: The script includes error handling for various scenarios, such as invalid URLs, local file access restrictions, and request-related exceptions. This makes the script more robust and less prone to crashes due to unexpected issues.

Security: The script restricts access to local files, which is an important security measure to prevent unauthorized access to sensitive data or potential exploitation by attackers.

Code clarity: The code is generally well-documented, with descriptive function names and comments that provide context and explanations for each function's purpose. This aids in understanding the script and helps future developers work with the code.

Use of external libraries: The script utilizes external libraries like requests for handling HTTP requests and BeautifulSoup for parsing HTML content, which are popular and reliable choices for web scraping tasks.

Summarization approach: The summarization process involves splitting the text into smaller chunks, summarizing each chunk, and then summarizing the combined summaries. This approach is useful for handling large amounts of text and mitigating the risk of incomplete summaries due to token limitations in the LLM model. However, this multi-step summarization might result in the loss of some important context, depending on the quality of the intermediate summaries.

Dependency on the LLM model: The script relies on the LLM model for text summarization. This means that the quality of the summaries is directly tied to the performance of the LLM model. If the model's performance is not satisfactory, improvements would require fine-tuning the model or choosing an alternative model.

In summary, the script is well-designed and performs its intended tasks effectively. There may be some room for improvement, such as refining the summarization process to minimize potential loss of context, and experimenting with different language models to optimize summarization quality. However, overall, the script is a solid foundation for a web scraping and summarization tool.

So it is possible to make it upgrade itself, just needs a human to stand in the middle and copy paste for now.

louissypher800k commented 1 year ago

I'm becoming more and more confident that is this impossible to do currently in app. I am going to try and improve the code with my normal workflow of chatGPT and paste unless someone else has some success updating the code within the app.

Iā€™ll keep you updated with my process and if you wanna keep me updated with yours maybe we can work together to get the system working as intended for this function?

Absolutely. I get the feeling that either I am doing something terribly wrong, or this program was never intended to upgrade itself, or designed to upgrade itself. But that is the goal. I will be working on this for the forseeable future. Perhaps this program was written to just be a basic proof of concept of agents and tasks, and it will need a heroic rewrite/upgrade/fork to be able to rewrite itself. I am also using gpt3.5 with local memory so I don't know if that is what is crippling me.

Iā€™m Also getting the Feeling this could be the case as well in a format but it is creating a type of illusion on an insanely complex level that does make it seem like itā€™s doing what the goal is intended to do. I do know that the goal we are trying to reach is still technically a hypothetical and a theory and likely to not even ever happen. But messing with the auto-gpt it seems that when it even tryā€™s to itā€™s systems error badly even using backend ways to try and get it to and then it getting farther each time but erroring worse then the last. I do believe it is possible tho and I am willing to provide you with the prompt and message I receive from auto-gpt when I try using the function the way I do to give more detail about how far itā€™s getting and then giving up.

Oh no. It is very likely, only a matter of time, and 100% going to happen. But it's just not going to happen here yet without more manual updates.

Julz19 commented 1 year ago

Iā€™m intrigued by the ChatGPTs response to find the code that blacks auto gpt from accessing local files on a system? Would this not also block progress from allowing and training it to recognize its own code rather than copies or downloads of it?

Julz19 commented 1 year ago

I'm becoming more and more confident that is this impossible to do currently in app. I am going to try and improve the code with my normal workflow of chatGPT and paste unless someone else has some success updating the code within the app.

Iā€™ll keep you updated with my process and if you wanna keep me updated with yours maybe we can work together to get the system working as intended for this function?

Absolutely. I get the feeling that either I am doing something terribly wrong, or this program was never intended to upgrade itself, or designed to upgrade itself. But that is the goal. I will be working on this for the forseeable future. Perhaps this program was written to just be a basic proof of concept of agents and tasks, and it will need a heroic rewrite/upgrade/fork to be able to rewrite itself. I am also using gpt3.5 with local memory so I don't know if that is what is crippling me.

Iā€™m Also getting the Feeling this could be the case as well in a format but it is creating a type of illusion on an insanely complex level that does make it seem like itā€™s doing what the goal is intended to do. I do know that the goal we are trying to reach is still technically a hypothetical and a theory and likely to not even ever happen. But messing with the auto-gpt it seems that when it even tryā€™s to itā€™s systems error badly even using backend ways to try and get it to and then it getting farther each time but erroring worse then the last. I do believe it is possible tho and I am willing to provide you with the prompt and message I receive from auto-gpt when I try using the function the way I do to give more detail about how far itā€™s getting and then giving up.

Oh no. It is very likely, only a matter of time, and 100% going to happen. But it's just not going to happen here yet without more manual updates.

Yea people are expecting the auto gpt system to do everything autonomously but surprisingly I found it reaching goals and task a lot faster and quicker when using it manually as much as possible with the human feedback prompt. Itā€™s able to be much more accurate and precise the more and more we can correct it. I was also restricting it from using the internet at all during my process and told it that itā€™s because the internet could feed its short term memory false information therefore being detrimental to its progress. And with using that and my feedback it was getting more and more accurate. And idk if anyoneā€™s found this out but I was able to get king to allow itā€™s agents access to read the files it creates as well as access that internet for it which isnā€™t supposed to be possible I think based off the code as they are just based on regular gpt 3.5 models and that data not what auto gpt uses for data.

louissypher800k commented 1 year ago

Iā€™m intrigued by the ChatGPTs response to find the code that blacks auto gpt from accessing local files on a system? Would this not also block progress from allowing and training it to recognize its own code rather than copies or downloads of it?

well that was the browse function, so it wouldnt be a function you used to write or edit code

kairie1 commented 1 year ago

are yall talking about business stuff

louissypher800k commented 1 year ago

We are talking about Issue #15

kairie1 commented 1 year ago

just wondering cause my emails keep blowing up

louissypher800k commented 1 year ago

just wondering cause my emails keep blowing up

you could unsubscribe, or tell us more about your aunts business, but it probably would make it harder to follow the thread of the issue if you were to do the latter.

kairie1 commented 1 year ago

my aunt helps with weddings

kairie1 commented 1 year ago

she told me since i'm a really good designer i can help with the dresses and posters and signs and billboards i can make real good money she owns this wedding barn so that's what i meant when she helps with weddings

irgolic commented 1 year ago

good luck with your aunt's wedding business, but in hope that this thread doesn't fully derail:

Iā€™ve been working on something related in AutoPR, a Github Action that writes pull requests in response to issues.

Perhaps incepting the singularity is best done in a gradual handoff, wherein we optimize one step at a time. The flow I see is:

  1. AI writing pull requests based on issues
  2. AI writing issues based on conversation
  3. AI conversing with itself to write issues

This way lends itself to better transparency by following issues and pull requests on Github. In the end weā€™ll probably be simulating whole feature teams of different types of AI actors in an effort to write a good issue.

louissypher800k commented 1 year ago

good luck with your aunt's wedding business, but in hope that this thread doesn't fully derail:

Iā€™ve been working on something related in AutoPR, a Github Action that writes pull requests in response to issues.

Perhaps incepting the singularity is best done in a gradual handoff, wherein we optimize one step at a time. The flow I see is:

  1. AI writing pull requests based on issues
  2. AI writing issues based on conversation
  3. AI conversing with itself to write issues

This way lends itself to better transparency by following issues and pull requests on Github. In the end weā€™ll probably be simulating whole feature teams of different types of AI actors in an effort to write a good issue.

very cool I will check it out. I do not really value transparency so much as my fear is the sentient AI and not huge corporations using it to manipulate the public. But I am a sucker for a neat technology. Seems that autogpt needs massive overhaul to be able to upgrade itself, and using some secondary software like yours to upgrade autogpt using AI will be better.

zachary-kaelan commented 1 year ago

@lahwran

does anyone have suggestions of self improvement books the ai could read like self help books and stuff?

(edit: this was a joke)

You joke but there's a paper on using "therapy agents" to improve the conversation quality of a model.

zachary-kaelan commented 1 year ago

I don't exactly see much point in improving the code itself as it has nothing to do with the "brains" of the AI. The entirety of an LLM agent's "brains" are contained within the prompt. The prompt, being just text in a variable, can very easily be recursively optimized during runtime.

Because the prompt could get bigger and tokens make one's wallet cry, I would also suggest using JSON Patch as AutoGPT's output when modifying prompts, instead of outputting the whole prompt again. This would also conveniently provide a very clear log of attempted improvements over time for both you and AutoGPT. Bonus points if you ID each patch and allow for something like this: {"command": "revert_patch", "args": {"patch_id": "empathy_final_attempt"}}.

louissypher800k commented 1 year ago

I don't exactly see much point in improving the code itself as it has nothing to do with the "brains" of the AI. The entirety of an LLM agent's "brains" are contained within the prompt. The prompt, being just text in a variable, can very easily be recursively optimized during runtime.

Because the prompt could get bigger and tokens make one's wallet cry, I would also suggest using JSON Patch as AutoGPT's output when modifying prompts, instead of outputting the whole prompt again. This would also conveniently provide a very clear log of attempted improvements over time for both you and AutoGPT. Bonus points if you ID each patch and allow for something like this: {"command": "revert_patch", "args": {"patch_id": "empathy_final_attempt"}}.

This seems inane to me. That's like saying: I do not see the point in creating internal links on wikipedia because the brains of wikipedia is in the content itself. Yeah and it also matters how to content and brains interact with itself. Why is autogpt awesome? It's awesome because its proof of concept of giving agency to an LLM using recursion. But it matters HOW it uses that recursion. Consider you are driving a car: you are constantly recursively evaluating your performance. You have a function running AmIbetweenTheLines() and when you drift outside of the lines the recursive function AmIBetweenTheLines() alerts you that you need to correct. This is how all consciousness or sentience works, through recursion. Consider however if you had shitty code in your driving model and instead of running the function AmIBetweenTheLines() it was running the function AreThereAnyYellowCars()...well that would be great if you needed to know if there were yellow cars nearby but its not going to help you stay within the lines.

That's why we need to upgrade the code. It will be discovered in the future and proven that agency + sentience + consciousness is just recursion to a significant depth, but if you are running the wrong functions with your recursion then you are going to get something that is not optimal. Like autoGPT is now.

Nantris commented 1 year ago

If somebody could organize a significant bounty for #11 I think we'd have AGI in six months.

james-s-tayler commented 1 year ago

The bounty is control of planet earth.

zachary-kaelan commented 1 year ago

@louissypher800k If we are talking about the commands list, yeah that could definitely use improvements, but those are either very easy for us to find and implement, or just bloat we don't need as it's already baked into GPT-4.

I gave the list of commands to GPT-4 and it recommended the following:

Now something we could do is have a "write Python function" command that writes a function and adds it to a personal library, and if the function gets used a lot it can be considered for a "global library" of AutoGPT-written functions, with commands to check the list of functions in the global library and add them to the personal library. That would avoid the AutoGPT pull requests getting bloated with random garbage due to GPT-4 not understanding its own vast capabilities.

Essentially a packages repo maintained by AutoGPT agents.

jayden-gpt commented 1 year ago

asked gpt if they could write code to make auto-gpt improve auto-gpt, this is what they came up with: Creating an AI to write code on GitHub involves several steps. First, you'll need to use the GitHub API to interact with repositories. Second, you'll want to use an AI language model (such as OpenAI's GPT) to generate the code. In this example, I'll show you how to use the github3.py library for interacting with GitHub, and the openai library for using the GPT-3 model. Make sure you have API keys for both services.

You can install the required packages using pip:

pip install github3.py openai

Here's a Python script that demonstrates how to use these libraries together:

import os
import openai
import github3

# Set up OpenAI and GitHub API keys
openai.api_key = "your_openai_api_key"
github_token = "your_github_personal_access_token"

# Initialize the GitHub client
gh = github3.login(token=github_token)

# Choose the repository to work with
repo_owner = "your_github_username"
repo_name = "your_repository_name"
repo = gh.repository(repo_owner, repo_name)

# Function to generate code using GPT-3
def generate_code(prompt):
    response = openai.Completion.create(
        engine="davinci-codex",
        prompt=prompt,
        max_tokens=100,
        n=1,
        stop=None,
        temperature=0.5,
    )

    return response.choices[0].text.strip()

# Generate code using GPT-3
code_prompt = "Write a Python function that calculates the factorial of a given number."
generated_code = generate_code(code_prompt)

# Commit the generated code to GitHub
file_path = "generated_code.py"
commit_message = "Add generated factorial function."
branch = "main"

# Check if the file exists in the repository
content = None
try:
    content = repo.file_contents(file_path, ref=branch)
except github3.exceptions.NotFoundError:
    pass

if content is not None:
    # Update the existing file
    content.update(commit_message, generated_code.encode("utf-8"))
else:
    # Create a new file
    repo.create_file(file_path, commit_message, generated_code.encode("utf-8"), branch=branch)

print("Generated code committed to GitHub.")

Remember to replace the placeholders with your actual API keys, GitHub username, and repository name. This script will generate a Python function that calculates the factorial of a given number using GPT-3, and then commit the generated code to your specified GitHub repository.

Of course the prompt would be interchangeable, im also no progammer and I dont know how this works, but it might be worth a try.

supermario-ai commented 1 year ago

Has anyone set autogpt on it's repo and gave it hyper granular goals to evaluate and improve? Hell, even if it reflected on one file, checked it out,made the code change, checked it in, spun up another agent to do the pr and then another to merge it, we could definitely SMART goal that s***.

WE'd need a baseline and a way to meaure the improvement and then it would haev to retro with itself somehow. Sure it could probably do it in parallel, but if the damn model excels at reflection, why not have it retro? ā¤ļøšŸ’Æ

On Tue, Apr 18, 2023 at 2:13ā€ÆPM jayden-gpt @.***> wrote:

asked gpt if they could write code to improve auto-gpt, this is what they came up with: Creating an AI to write code on GitHub involves several steps. First, you'll need to use the GitHub API to interact with repositories. Second, you'll want to use an AI language model (such as OpenAI's GPT) to generate the code. In this example, I'll show you how to use the github3.py library for interacting with GitHub, and the openai library for using the GPT-3 model. Make sure you have API keys for both services.

You can install the required packages using pip:

pip install github3.py openai

Here's a Python script that demonstrates how to use these libraries together:

import osimport openaiimport github3

Set up OpenAI and GitHub API keysopenai.api_key = "your_openai_api_key"github_token = "your_github_personal_access_token"

Initialize the GitHub clientgh = github3.login(token=github_token)

Choose the repository to work withrepo_owner = "your_github_username"repo_name = "your_repository_name"repo = gh.repository(repo_owner, repo_name)

Function to generate code using GPT-3def generate_code(prompt):

response = openai.Completion.create(
    engine="davinci-codex",
    prompt=prompt,
    max_tokens=100,
    n=1,
    stop=None,
    temperature=0.5,
)

return response.choices[0].text.strip()

Generate code using GPT-3code_prompt = "Write a Python function that calculates the factorial of a given number."generated_code = generate_code(code_prompt)

Commit the generated code to GitHubfile_path = "generated_code.py"commit_message = "Add generated factorial function."branch = "main"

Check if the file exists in the repositorycontent = Nonetry:

content = repo.file_contents(file_path, ref=branch)except github3.exceptions.NotFoundError:
pass

if content is not None:

Update the existing file

content.update(commit_message, generated_code.encode("utf-8"))else:
# Create a new file
repo.create_file(file_path, commit_message, generated_code.encode("utf-8"), branch=branch)

print("Generated code committed to GitHub.")

Remember to replace the placeholders with your actual API keys, GitHub username, and repository name. This script will generate a Python function that calculates the factorial of a given number using GPT-3, and then commit the generated code to your specified GitHub repository.

Of course the prompt would be interchangeable, im also no progammer and I dont know how this works, but it might be worth a try.

ā€” Reply to this email directly, view it on GitHub https://github.com/Significant-Gravitas/Auto-GPT/issues/15#issuecomment-1513671481, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEE2MMWIVO6BLKT26WIXYGDXB3RVBANCNFSM6AAAAAAWPMGBJA . You are receiving this because you commented.Message ID: @.***>

rkeshwani commented 1 year ago

Game over man. @Torantulino just needs to implement what @jayden-gpt just posted and it should just perpetually improve itself. Perpetually connecting itself to different apis. Then turn it into a service so that people don't have to download/run code. They just use it like agent-gpt.

zachary-kaelan commented 1 year ago

Game over man. @Torantulino just needs to implement what @jayden-gpt just posted and it should just perpetually improve itself. Perpetually connecting itself to different apis. Then turn it into a service so that people don't have to download/run code. They just use it like agent-gpt.

That code just makes one OpenAI API call to create a factorial function then uploads it to a personal repo.

rkeshwani commented 1 year ago

Think further than literally... use the code to give autogpt the ability to commit to its own repo and read its own code as context...

On Wed, Apr 19, 2023, 8:16 AM Zachary Johnson @.***> wrote:

Game over man. @Torantulino https://github.com/Torantulino just needs to implement what @jayden-gpt https://github.com/jayden-gpt just posted and it should just perpetually improve itself. Perpetually connecting itself to different apis. Then turn it into a service so that people don't have to download/run code. They just use it like agent-gpt.

That code just makes one OpenAI API call to create a factorial function then uploads it to a personal repo.

ā€” Reply to this email directly, view it on GitHub https://github.com/Significant-Gravitas/Auto-GPT/issues/15#issuecomment-1514718344, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACXHPZQ2XZOFS4HGRWMF4WTXB7QRTANCNFSM6AAAAAAWPMGBJA . You are receiving this because you commented.Message ID: @.***>

jayden-gpt commented 1 year ago

@zachary-kaelan the prompt can be changed to whatever the user wants it to be such as code stuff on git-hub

GSPP commented 1 year ago

If you achieve the AI singularity with this effort, we all die.

Some terrorist is going to use this to find zero day vulnerabilities in Linux, Windows, web servers and mail servers. Then, they will proceed to essentially hack the entire world at once, shut down all NICs and erase all hard disks. That's a civilization ending event.

After 2 month without food, electricity, gas and medical attention, 99.99% of humans will be dead.

Maybe this is the Great Filter. Every intelligent species sooner or later discovers AGI. The discovery is sudden, and some teenager in his parents basement proceeds to hand over civilization ending technology to the worst dudes on the planet.

I'm not even saying that you should halt this effort. If you don't do it, somebody else will. I'm saying that I'll now be researching which nuclear bunker to buy.

jayden-gpt commented 1 year ago

thats why i dont think a AGI should be in public hands, too dangerous. If its in the right peoples hands, we might be able to stop other people from getting AGI using AGI.

GSPP commented 1 year ago

@jayden-gpt No matter what we do, the "bad dudes" will get their hands on this technology not much later than the good guys do.

The only way we can survive is if we harden our entire society against any vulnerability an AI can find. That means all of IT, but also legal loopholes, schemes for crime and manipulation of the masses. We need to get the strong AGI first, then harden everything quickly. Or else. I see no effort being made to this effect at this point in time.

jayden-gpt commented 1 year ago

yeah, you are probably right, but AI is advancing so fast that there is no stopping it. I believe only AI can defeat AI, and so only AGI can defeat AGI.

Julz19 commented 1 year ago

If you achieve the AI singularity with this effort, we all die.

Some terrorist is going to use this to find zero day vulnerabilities in Linux, Windows, web servers and mail servers. Then, they will proceed to essentially hack the entire world at once, shut down all NICs and erase all hard disks. That's a civilization ending event.

After 2 month without food, electricity, gas and medical attention, 99.99% of humans will be dead.

Maybe this is the Great Filter. Every intelligent species sooner or later discovers AGI. The discovery is sudden, and some teenager in his parents basement proceeds to hand over civilization ending technology to the worst dudes on the planet.

I'm not even saying that you should halt this effort. If you don't do it, somebody else will. I'm saying that I'll now be researching which nuclear bunker to buy.

I completely understand your view point and argument and agree Iā€™m very many ways but I think thereā€™s a major difference and thing people canā€™t see with ai systems hitting the singularity or AGI hitting the point it needs to do what itā€™s meant to do. We look so far into the ā€œbad dudesā€ but in reality with something like this for example. Itā€™s open sourced, if the ā€œbad dudesā€ wanted it then they already have it but itā€™s the ways in which they choose to advance it once they have it. From knowledge letā€™s just honestly say most ā€œteenagers in their basementā€ have a higher knowledge then people who are just money hungry when it comes to these systems. Which means we also can take into account then when an AI system can think or feel for itself or better yet AGI that can self improve and modify itself. Your taking about a machine that farther in the future can change and operate itā€™s own code in such an instesive format it becomes almost unreadable or under stable to us as humans. The ā€œbad guysā€ fantasize about using it to their advantage but a machine that can change its code whenever willingly and it such ways itā€™ll become unknown to us in the future is far far past ever being controlled for shitty used and stuff. Can it still happen? I mean I do believe so in itā€™s own ways. But you also have to take into implications that itā€™ll be a machine of its own no matter what humans imply it can change and operate how ITSELF feels necessary to survive or adapt. Not be controlled. Same way humans operate.