We develop a general homological approach to presentations of connected graded associative algebras, and apply it to loop homology of moment-angle complexes Z K that correspond to flag simplicial complexes K. For arbitrary coefficient ring, we describe generators of the Pontryagin algebra H * (ΩZ K ) and defining relations between them. We prove that such moment-angle complexes are coformal over Q, give a necessary condition for rational formality, and compute their homotopy groups in terms of homotopy groups of spheres.