This paper presents an adaptive algebraic multigrid setup algorithm for positive definite linear systems arising from discretizations of elliptic partial differential equations. The proposed method uses compatible relaxation to select the set of coarse variables. The nonzero supports for the coarse-space basis are determined by approximation of the so-called two-level "ideal" interpolation operator. Then, an energy minimizing coarse basis is formed using an approach aimed to minimize the trace of the coarse-level operator. The variational multigrid solver resulting from the presented setup procedure is shown to be effective, without the need for parameter tuning, for some problems where current algorithms exhibit degraded performance.