Hypernuclei He-4(Y), H-4(Y), He-4(YY), H-4(YY), where Y = Lambda, Sigma(0), Sigma(+), Sigma(-), with the atomic (baryon) number A = B = 4, are described by the relativistic twelve-quark equations in the framework of the dispersion relation technique. Hypernuclei as the systems of interacting quarks and gluons are considered. The relativistic twelve-quark amplitudes of hypernuclei, including the constituent quarks of three flavors u, d, s are calculated. The approximate solutions of these equations are obtained using a method based on extraction of leading singularities of the amplitudes. The poles of the multiquark amplitudes allow us to determine the masses and the binding energy of hypernuclei with A = 4. The mass and the binding energy of state H-4(Lambda Lambda) with the isospin projection I-3 = 0 and the spin-parity J(P) = 0(+) is equal to M = 4118 MeV and B = -8 MeV, respectively. We predict the mass spectrum of hypernuclei with A = 4, which is valuable for further experimental study of the hypernuclei.