  Recent anomalies in $B\to K^{(*)}\ell\ell$ meson decays are consistent with
exchange of a heavy $Z'$ vector boson. Here we try to connect such new physics
to understanding the origin of flavor, by gauging generation number.
Phenomenological and theoretical considerations suggest that the smallest
viable flavor symmetry (not including any extra U(1) factors) is chiral ${\rm
SU(3)}_L\times{\rm SU(3)}_R$, which acts only on generation indices and does
not distinguish between quarks and leptons. Spontaneous breaking of the
symmetry gives rise to the standard model Yukawa matrices, and masses for the
16 $Z'$-like gauge bosons, one of which is presumed to be light enough to
explain the $B\to K^{(*)}\ell\ell$ anomalies. We perform a bottom-up study of
this framework, showing that it is highly constrained by LHC dilepton searches,
meson mixing, $Z$ decays and CKM unitarity. Similar anomalies are predicted for
semileptonic decays of $B$ to lighter mesons, with excesses in the
$ee,\tau\tau$ channels and deficits in $\mu\mu$, but no deviation in $\nu\nu$.
The lightest $Z'$ mass is $\lesssim 6\,$TeV if the gauge coupling is $\lesssim
1$.
