In this article we develop a broad generalization of the classical Bost–Connes system, where roots of unity are replaced by an algebraic datum consisting of an abelian group and a semi-group of endomorphisms. Examples include roots of unity, Weil restriction, algebraic numbers,Weil numbers, CM fields, germs, completion ofWeil numbers, etc. Making use of the Tannakian formalism, we categorify these algebraic data. For example, the categorification of roots of unity is given by a limit of orbit categories of Tate motives while the categorification of Weil numbers is given by Grothendieck’s category of numerical motives over a finite field. To some of these algebraic data (e.g. roots of unity, algebraic numbers, Weil numbers, etc), we associate also a quantum statistical mechanical system with several remarkable properties, which generalize those of the classical Bost–Connes system. The associated partition function, low temperature Gibbs states, and Galois action on zero-temperature states are then studied in detail. For example, we show that in the particular case of the Weil numbers the partition function and the low temperature Gibbs states can be described as series of polylogarithms.