Networks are a fundamental tool for understanding and modeling complex systems in physics, biology, neuro, and social sciences. Present network algorithms are almost exclusively focusing on first-order, or edge-based, structures in networks. However, what is missing from the picture are methods for analyzing higher-order organization of complex networks. We present a generalized framework for a network clustering and classification based on higher-order network connectivity patterns. This framework allows for identifying rich higher-order clusters in networks. Our framework scales to networks with billions of edges and provides mathematical guarantees on the optimality of obtained clusters.