DOI: 10.1145/3846193 ISSN: 1049-331X
RAHGRec: A Role-Aware Hypergraph-Based Framework for Project–Library Recommendation in Python Ecosystem with Knowledge-Graph Relations
Abhinav Jamwal, Sandeep KumarThe Project-Library relationship plays a central role in modern-day software development but choosing libraries which are not just compatible but also well-suited to the particular setting of the project has always been an issue. Most of today's project-library recommendations systems rely on the co-usage information extracted from history or the latent representations derived through pairwise interactions. These systems have proven to perform excellently in environments where there is abundant data but they tend to face challenges distinguishing between common co-adoption and actual compatibility, thus enhancing false correlations.
In this paper, we propose
RAHGRec
, a role-aware hypergraph–based recommendation framework that integrates higher-order co-use patterns with semantic relationships from a knowledge graph to support Project library recommendation.
RAHGRec
models project–library usage as hypergraphs to reflect how groups of libraries are adopted together, and it directly leverages typed semantic relations such as dependency links, topical similarity, and maintainer-related signals through role-aware propagation mechanisms. By restricting higher-order message passing according to these semantic roles, the framework can differentiate between co-usage that is merely frequent in the data and adoption that truly fits the surrounding context. We evaluated
RAHGRec
on a large-scale Python ecosystem benchmark comprising 12,421 projects, 963 libraries, and over 121,000 project–library interactions enriched with contextual metadata. The results show that
RAHGRec
consistently surpasses the state-of-the-art baselines across all reported metrics, including precision, recall, F1, MRR, and coverage. The advantage is most pronounced under the sparse and long-tail interaction settings, which underscores the value of role-aware, semantically constrained higher-order modeling for producing reliable and context-sensitive library recommendations when observed project–library histories are limited.