AgentGPT icon indicating copy to clipboard operation
AgentGPT copied to clipboard

📢 Explain that agents won't run forever, even with a custom key

Open sergedahdouh opened this issue 2 years ago • 15 comments

Hello, I have test the web version of Agent GPT and i provide my own API key and it start to work but after sometimes it cut and saying we are sorry, because this a demo we cannot ....... Please i would like to know what is the issue

sergedahdouh avatar Apr 11 '23 20:04 sergedahdouh

I also keep running into the same issue multiple times despite using my own key...

image

Concept211 avatar Apr 11 '23 20:04 Concept211

I believe this is happening whenever the agent is "done" and not strictly indicative of long runs. That said, even with a private key there is a limitation to the number of cycles. https://github.com/reworkd/AgentGPT/blob/34956eefdfd2ab263498af64561e11fba605f1f1/src/components/AutonomousAgent.ts#L68

mrayonnaise avatar Apr 11 '23 21:04 mrayonnaise

I believe this is happening whenever the agent is "done" and not strictly indicative of long runs. That said, even with a private key there is a limitation to the number of cycles.

https://github.com/reworkd/AgentGPT/blob/34956eefdfd2ab263498af64561e11fba605f1f1/src/components/AutonomousAgent.ts#L68

I think we need to run it locally and change the limitation

sergedahdouh avatar Apr 11 '23 23:04 sergedahdouh

Hey folks, this is so no one accidentally runs their agent in an infinite loop and burns through their key. We'll remove it once our agents become smart enough to come up with valuable conclusions

asim-shrestha avatar Apr 12 '23 00:04 asim-shrestha

I was writing the exact same thing @asim-shrestha , this is actually a smart move to limit the cycles cause it can run indefinitely and burn through your cash fast, the AI don't know when the task is done sometimes.

@sergedahdouh suggestion, If you want to do a big task it's not possible only with one agent, try to make an agent to simplify tasks and organize them so you can do it with multiple agents and make sure everything gets done and you won't be stuck in the middle of a task without a proper result and lots of tokens used.

TheMehranKhan avatar Apr 12 '23 00:04 TheMehranKhan

Hey folks, this is so no one accidentally runs their agent in an infinite loop and burns through their key. We'll remove it once our agents become smart enough to come up with valuable conclusions

None of my projects are completing. Can you remove the cap now and let Darwinism deal with those who want to use up their API. At $0.50 per hour of run time, I can handle letting it run for days and it will still be cheaper than my wife's trips to Starbucks.

Cossackx avatar Apr 12 '23 01:04 Cossackx

Would you all support making this piece configurable via the .env file? const maxLoops = this.customApiKey === "" ? 3 : 30; so that it would be more like const maxLoops = this.customApiKey === "" ? 3 : this.maxCycles; or something of the sort?

mrayonnaise avatar Apr 12 '23 01:04 mrayonnaise

My opinion: It's great to have a filter that limits the amount of $ not the cycles, the whole point of running autonomously is to let it complete a task it's just a bummer when it's working like a clock and suddenly everything stops and AI forgets all the work.

limiting it to $/hour and not cycles allow us to budget the API usage too so that's win/win and also making it configurable via .env file is better, more people understand it compared to code.

Edit: or maybe $/minute

TheMehranKhan avatar Apr 12 '23 01:04 TheMehranKhan

I'm working on a branch to add optional MAX_LOOPS config to the .env file now. Hoping the code owners dig it

mrayonnaise avatar Apr 12 '23 01:04 mrayonnaise

I'm working on a branch to add optional MAX_LOOPS config to the .env file now. Hoping the code owners dig it

@mrayonnaise that would be a great addition! Tag me when ready and I can give you a quick review!

awtkns avatar Apr 12 '23 03:04 awtkns

There should be a couple more settings such as max loops when you have a custom token. You could also add support for gpt-4 when using a custom token in the settings.

OVAWARE avatar Apr 12 '23 05:04 OVAWARE

I'm working on a branch to add optional MAX_LOOPS config to the .env file now. Hoping the code owners dig it

@mrayonnaise that would be a great addition! Tag me when ready and I can give you a quick review!

@awtkns PR to add MAX_LOOPS config https://github.com/reworkd/AgentGPT/pull/51

mrayonnaise avatar Apr 12 '23 15:04 mrayonnaise

The agent probably often runs forever because here https://github.com/reworkd/AgentGPT/blob/c7f1dac4e3d01937e455af4b148715c8cba97ed2/src/components/AutonomousAgent.ts#L98 subtasks of the current task are added to the end of the list. As the tasks usually depend on each other it means other tasks are blocked by subtasks of the first task. I think subtasks should be added at the start and when task is completed another task should be processed. Another option is to find independent tasks and execute them first, then execute tasks depending on them and so on. I also think it would be useful to assign acceptance criteria to each task and ask language model check if they are met.

Dron007 avatar Apr 13 '23 02:04 Dron007

Search 'max: 100' in the source code, change it to 'max: 10000' , then you can set the maxloop to 10000 in advanced setting in AgentGPT's webpage. This approach works for me

duterhappy avatar Apr 22 '23 07:04 duterhappy

See #51 max_loops in env.

APiTJLillo avatar Apr 30 '23 00:04 APiTJLillo

Closing due to being an early safeguard set in place. @Dron007 @Concept211 @TheMehranKhan @duterhappy If any of yall are still experiencing this problem feel free to reopen this!!!!

jasangill1 avatar Jun 27 '23 22:06 jasangill1