The increasing concern on water pollution and water-energy nexus have aroused the in-depth research on the eco-friendly design of molecule-separating nanofiltration membranes capable for both surface water and ground water treatments. Herein, a novel nanocoating was constructed by the layer-by-layer (LBL) assembly approach for confining the reaction between plant-derived polyphenol tannic acid (TA) and water-soluble polycation polyethyleneimine (PEI) to build advanced nanofiltration membrane focusing on dye removal in wastewater. Our approach can avoid the failure of the formation of nanofilm on porous membranes owing to instantaneous flocculation by the traditional direct co-deposition method. In addition, the entire assembling procedure was conducted in aqueous solution at ambient conditions. The incubation conditions and surface nanostructure and chemistry were investigated in detail for optimizing surface manipulation technology and improving membrane efficiency. PEI played significant roles in improving the membrane surface wettability and infiltration performance. The optimized membrane toward methyl blue (MB) and Victoria blue B (VB) removal gave the rejection rate beyond 92% with permeance of ca. 57.6 L m-2 h-1 bar-1. The delicate control of assembly conditions can flexibly regulate the membrane performance trade-off. The analogous polyphenol-based assemblies would power the advancement of membrane surface engineering for water treatments towards the bright water-energy nexus.