Hi,
I would guess you have something caught in the water pump.
During agitate the pump turns a different direction then when it's pumping out or spinning.
I would remove the pump and take a look inside.
If there is something in the pump you don't want to leave it as it could end up cutting a hole in the pump. Then you would have a leak.
This video will help show you have to remove the water pump.
Video: How To Replace a Water Pump On A Whirlpool Made Direct Drive Washer