SuperAGI icon indicating copy to clipboard operation
SuperAGI copied to clipboard

Loop detection and handling

Open eqxwow opened this issue 2 years ago • 4 comments

If Agent goes into a loop, it should detect it and find ways to come out of it and proceed to the next step.

eqxwow avatar May 19 '23 04:05 eqxwow

Interesting. Any pointers on how to go ahead with this?

neelayan7 avatar Jul 03 '23 11:07 neelayan7

Literally solving it could be difficult because it's equivalent to the halting problem. The possible solution could be engineering workarounds such as putting a hard time limit etc.

luocfprime avatar Jul 09 '23 13:07 luocfprime

how about on each iteration it examines if it has previously carried out this task, the result and so on, and if it concludes it is carrying out, or intends to carry out a routine that has failed before, twice... it stops and reexamines the goal. The halting problem you see is trying to get out of a loop from inside the loop. This current issue with SuperAGI however is simply looking at the loop from outside the loop. I'm not a fan of counters or hard coded time limits. I'm not sure first that its a scalable idea on lengthy, or especially on complex tasks, nor is it elegant.

The important thing is to ensure the previous attempt is held in embeddings in pinecone perhaps, even locally on the users workspace OR that all tasks are counted anyway... even the successful ones.

Its just an idea, but how about a 'sign off agent' that evaluates all tasks completed and a function that returns 'if the task worked'. If it did not work then it not working itself becomes a task and the model is tasked with finding out WHY it didn't work.

Mickelodian avatar Jul 19 '23 14:07 Mickelodian

can we submit this problem to an AI, i mean we can design a role named watcher, It is responsible for monitoring the entire task execution process, recording the number of cycles, and the deviation of the target. Let AI judge it and give it some exit forms similar to strategies, instead of directly limiting the number of cycles.

whybeyoung avatar Aug 10 '23 05:08 whybeyoung