We prove a regularity result for Lagrangian flows of Sobolev vector fields over RCD(K, N ) metric measure spaces, regularity is understood with respect to a newly defined quasi-metric built from the Green function of the Laplacian. Its main application is that RCD(K, N ) spaces have constant dimension. In this way we generalize to such abstract framework a result proved by Colding-Naber for Ricci limit spaces, introducing ingredients that are new even in the smooth setting. * Scuola Normale Superiore, elia.brue@sns.it. † Scuola Normale Superiore, daniele.semola@sns.it.