  We investigate compactifications of type II and M-theory down to $AdS_5$ with
generic fluxes that preserve eight supercharges, in the framework of
Exceptional Generalized Geometry. The geometric data and gauge fields on the
internal manifold are encoded in a pair of generalized structures corresponding
to the vector and hyper-multiplets of the reduced five-dimensional
supergravity. Supersymmetry translates into integrability conditions for these
structures, generalizing, in the case of type IIB, the Sasaki-Einstein
conditions. We show that the ten and eleven-dimensional type IIB and M-theory
Killing-spinor equations specialized to a warped $AdS_5$ background imply the
generalized integrability conditions.
