Heavy quarks are useful probes to investigate the properties of the Quark--Gluon Plasma (QGP) produced in heavy-ion collisions at the LHC, since they are produced in initial hard scattering processes. To single out the signals that are characteristic of the QGP, it is nevertheless crucial to understand the primordial heavy-quark production in vacuum, and to disentangle hot from cold nuclear matter effects. Moreover, observations of collective effects in high-multiplicity pp and p--Pb collisions show surprising similarities with those in heavy-ion collisions. Heavy-flavour production in such collisions could give further insight into the underlying processes.
The heavy-flavour production can be studied with $\rm e^{+}e^{-}$ pairs from correlated semileptonic decays of heavy-flavour hadrons. Compared to single heavy-flavour measurements, the dielectron yield contains information about the initial kinematical correlations between the charm and anti-charm quarks, which is otherwise not accessible, and is sensitive to soft heavy-flavour production.
We report results on correlated $\rm e^{+}e^{-}$ pairs in pp collisions recorded by the ALICE detector at different collision energies. The production of heavy quarks is discussed by comparing the yield of dielectrons from heavy-flavour hadron decays as a function of invariant mass, pair transverse momentum and distance of closest approach to the primary vertex with different Monte Carlo event generators. The heavy-flavour production cross sections are also presented. Results from high-multiplicity pp collisions at $\sqrt{s} = 13$ TeV and the status of the p--Pb analysis at $\sqrt{s_{\rm NN}} = 5.02$ TeV are reported as well.