agentic ai process loop perceive reason act learn