  In this paper, we provide a way of attaching to a torsion pair $(T,F)$ on the
heart of a stable $\infty$-category $C$ a cohomological (K-theoretical,
categorified) Hall algebra and corresponding left and right representations.
More precisely, the algebra is associated to the torsion part, while the
representation is associated to the torsion-free part.
  The left and right actions enable us to construct canonical subalgebras of
the endomorphism ring of the Borel-Moore homology and K-theory of the moduli
stack of torsion-free objects, whose "positive parts" recover the cohomological
Hall algebra and the K-theoretical Hall algebra associated to the torsion part
$T$, respectively. This provides a new direction that might lead to overcome
the long-standing limitation of the theory of cohomological Hall algebras to
just produce "positive parts" of whole algebras. We also provide a geometric
sufficient criterion ensuring the vanishing of the commutator between two
different operators.
  In the quiver case, we obtain the action of the two-dimensional cohomological
Hall algebra of a quiver on the cohomology of Nakajima quiver varieties within
our framework. Besides the quiver case, we also apply our framework to two
torsion pairs on a smooth projective complex surface, and we investigate the
corresponding Hall algebras and their representations associated to them.
Finally, we slightly modify our method to construct representations of the
cohomological Hall algebra of zero-dimensional sheaves on $S$ on the
Borel-Moore homology of the moduli spaces of Pandharipande-Thomas stable pairs
on surfaces and on relative Hilbert schemes of points (and we obtain similar
results at the level of K-theory and bounded derived category).
