state based agent