Skip to content
Open access

A Software Repository Tag Method Based on Hybrid Search and Graph Enhancement

Aug 2026 · Applied Sciences · Vol 16, pp. 7777 · 0 citations · 15 references

TL;DR

ReG-TG is proposed, a retrieval-augmented framework for repository tag recommendation that integrates hybrid retrieval, a tag co-occurrence knowledge graph, and Chain-of-Thought reasoning within a large language model (LLM)-based architecture and consistently outperforms representative baselines.

Abstract

Software repositories play an essential role in modern software engineering by enabling code sharing, collaboration, and reuse. Repository tag recommendation is a key technique for improving the discoverability and organization of software repositories. However, existing methods still suffer from noisy annotations, incomplete tag coverage, long-tailed label distributions, and limited adaptability to emerging technical terms. To address these issues, this paper proposes ReG-TG, a retrieval-augmented framework for repository tag recommendation. ReG-TG integrates hybrid retrieval, a tag co-occurrence knowledge graph, and Chain-of-Thought (CoT) reasoning within a large language model (LLM)-based architecture. Specifically, the hybrid retrieval module combines dense semantic embeddings and sparse lexical matching to retrieve relevant reference repositories, followed by a reranking mechanism to refine candidate results. A tag co-occurrence graph is further constructed to model structural relationships among tags and provide graph-enhanced tag knowledge. The retrieved context and graph-enhanced information are then incorporated into structured prompts to guide LLM-based tag generation. Experimental results on multiple GitHub repository datasets show that ReG-TG consistently outperforms representative baselines, including TF-IDF+LR, ZestXML, and LEGION, in terms of Precision@5, Recall@5, and F1-score@5. Further ablation studies demonstrate that retrieval augmentation, hybrid retrieval, reranking, graph enhancement, and structured reasoning each contribute to performance improvement. In addition, long-tail analysis shows that ReG-TG maintains better robustness on low-frequency labels, indicating its effectiveness in alleviating the sparsity and long-tail challenges in repository tag recommendation.

Read PDF

Similar papers

Preprint Aug 2026

Effective and Efficient Context Retrieval via Partial Dependency Graph for Repository-Level Code Generation

LLM-based repository-level code generation aims to generate code using the context available in a software repository, requiring LLMs to reason over complex code dependencies. Due to limited context windows and insufficient repository-specific understanding, LLMs typically rely on retrieval-augmented generation (RAG) to incorporate relevant code. Early RAG approaches primarily employ similarity-based retrieval, which often fails to retrieve code snippets that the target function depends on. Recent work introduces graph-based retrieval to model such dependencies, but typically relies on manually designed rules and static global graphs, leading to limited flexibility and high construction and maintenance costs. In contrast, human developers collect helpful context by implicitly constructing a partial dependency graph and iteratively inspecting along it. Inspired by this behavior, we propose DyRetriever, an efficient context retrieval method via partial dependency graphs. DyRetriever uses an LLM to first select a set of entry-point functions and then perform multi-hop reasoning along the code dependency graph. During multi-hop reasoning, it uses the LLM's semantic understanding to validate whether a function can help generate the target function, eliminating manually designed rules and enabling flexibility across scenarios. Instead of statically constructing a global dependency graph, DyRetriever builds a partial graph on demand and discards it after use, reducing construction and maintenance costs. We integrate DyRetriever with a similarity-based code retriever to build DyCoder and evaluate it on CoderEval and DevEval. Experimental results show that DyCoder achieves relative Pass@1 improvements of 25.63% and 59.73% on CoderEval and DevEval, respectively, compared with existing RAG-based methods, while being 7.4x faster than baselines based on static dependency graph construction.

Zhongxin Liu, Zhonghao Jiang, Zhifan Ye et al. · 1 citation
Aug 2026

Balancing Richness and Reliability: An Explore-Construct-Verify Framework for API Knowledge Graph Construction

This work proposes Explore-Construct-Verify (ECV), a three-stage framework for API KG construction using large language models (LLMs), which preserves LLMs’ ability to discover domain-specific knowledge while enabling efficient post-hoc validation.

Yanbang Sun, Qing Huang, Zhenchang Xing et al. · 0 citations
#artificial intelligence Preprint Sep 2026

Automated Tree Knowledge Graph Construction using Ontology Expansion and Retrieval from Vietnamese History Textbooks

Hierarchical Knowledge graph (KG)-based retrieval augmented generation (RAG) has emerged as a powerful approach for supporting large language models with structured knowledge. However, there are primary challenges: (i) the lack of methods for automatic KG construction using ontology expansion for low-resource languages such as Vietnamese, (ii) the absence of systematic evaluation for knowledge retrieval strategies leveraging the hierarchical structures. In this paper, we propose an end-to-end pipeline for KG construction and retrieval strategies evaluation. In the KG construction, we employ a three-phase hybrid relation extraction pipeline: intra-batch deduplication via Union-Find, approximate cross-batch search, and LLM extraction with a centroid filter that reduces prompts combined with a five-step dual-LLM validator to prevent bloated ontology. A two-tier architecture consists of unmergeable structural nodes to preserve the document structure and mergeable content nodes. The retrieval evaluation consists of three graph traversal strategies: Top-Down, Horizontal, and Bottom-Up, which are evaluated on a synthetically generated benchmark of 1,210 Vietnamese queries from 109 subgraphs, categorized by five query directions. In this paper, we construct the tree knowledge graph from Vietnamese high school History textbooks (nearly 400 pages) to produce 750 nodes and 4,341 semantic edges with controlled ontology growth from 40 to 41 types. Among experimental graph traversal strategies, the Top-Down strategy with structure surpasses the vector baseline by 4.7 percentage points in NDCG@10. As a result, tree-structural information provides valuable information beyond flat cosine similarity but degrades performance when the query does not require structural context.

Ket Doan Nguyen, M. H. Nguyen · 0 citations
Jul 2026

An Ontology-Guided, Deduplication-Aware Extraction Layer for Knowledge Graph Construction from Heterogeneous Documents

A production extraction layer that converts a live document stream into a validated knowledge graph aligned to a formal ontology, and improved search recall from roughly 70 to 95 percent with no false merges, and corrected seven classes of silent quality defect.

Vaibhav Dangaich, Kevin Lewis, Kundeshwar Pundalik · 0 citations
Preprint Jul 2026

OptGraph: Large Language Models Enhanced Evolutionary Optimization Via Graph Retrieval-Augmented Generation

OptGraph is the first optimization agentic workflow that introduces graph retrieval-augmented generation (GraphRAG) and first constructs reusable experience as a typed graph, capturing the relationships among modeling patterns, problem formalization, implementation details, and error corrections.

Xianchao Xiu, Jianhao Li, Huangyue Chen et al. · 1 citation
Preprint Aug 2026

W-RAG: Source-Aware Retrieval for Enterprise Document Generation from Heterogeneous Knowledge Bases

W-RAG is proposed, a source-aware retrieval framework that performs ontology-guided retrieval, local ranking within each knowledge base, and source-level weighting to regulate evidence composition to improve document coverage and generation quality.

Hridya Dhulipala, Rajesh Ombase, Michael Wang et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.