Creating loops for planning, review, or retry mechanisms