RepoDoc: A Knowledge Graph-Based Framework to Automatic Documentation Generation and Incremental Updates
- URL: http://arxiv.org/abs/2604.26523v1
- Date: Wed, 29 Apr 2026 10:43:02 GMT
- Title: RepoDoc: A Knowledge Graph-Based Framework to Automatic Documentation Generation and Incremental Updates
- Abstract summary: We propose RepoDoc, a system that uses a repository knowledge graph (RepoKG) as the semantic foundation for the entire documentation lifecycle.<n>For incremental updates, it cuts update time by 73% and token usage by 77%, and achieves 10.2% higher update recall.<n> Evaluated on 24 repositories across 8 languages, RepoDoc substantially outperforms state-of-the-art alternatives.
- Score: 41.56228301287882
- License: http://creativecommons.org/licenses/by-nc-nd/4.0/
- Abstract: Maintaining up-to-date, comprehensive documentation for large codebases is a persistent challenge. Recent progress in automated documentation has moved from template-based rules to large language models (LLMs), yet existing tools still process source code as flat fragments, producing isolated documents that lack semantic structure. This design also leads to excessive token consumption and slow generation, while failing to capture how code changes propagate across dependencies. We propose RepoDoc, a system that uses a repository knowledge graph (RepoKG) as the semantic foundation for the entire documentation lifecycle. Our framework consists of three stages: (1) RepoKG construction, which extracts code entities and their relationships; (2) module clustering, which groups code into functionally cohesive, hierarchical units; and (3) skillful agent-based generation, which queries the graph to create modular, cross-referenced documentation with auto-generated Mermaid diagrams. For incremental maintenance, a semantic impact propagation mechanism navigates the RepoKG bidirectionally to pinpoint all affected parts, allowing selective, targeted regeneration. Evaluated on 24 repositories across 8 programming languages, RepoDoc substantially outperforms state-of-the-art alternatives. It improves API coverage by 32.5% and completeness by 10.4%, while generating documentation 3x faster with 85% fewer tokens. For incremental updates, it cuts update time by 73% and token usage by 77%, and achieves 10.2% higher update recall, more accurately reflecting code changes in the regenerated documentation. The source code and experimental artifacts are available at https://github.com/SYSUSELab/RepoDoc.
Related papers
- Skill Issue: Lessons from Optimizing Repository SKILLs for Coding Agents [0.09558392439655013]
Coding agents increasingly read repository knowledge from SKILLs.<n>Recent work synthesizes these files automatically, by optimizing the document against a benchmark.<n>We mine harder tasks --- merged pull requests of the repository, reverted at a single frozen base commit; and score a candidate document by whether the same agent does better with it than without it.
arXiv Detail & Related papers (2026-09-11T11:41:29Z) - Code-QA-Bench: Separating Code Reasoning from Documentation Memorization in Repository-Level QA [7.478327602641997]
Code-QA-Bench is a framework for synthesizing repository-level code understanding benchmarks.<n>We generate 528 code-derivable and 100 doc-dependent tasks across 10 Python repositories.<n>The framework is open-source and applicable to any well-documented Python repository.
arXiv Detail & Related papers (2026-05-28T02:52:58Z) - Remember Your Trace: Memory-Guided Long-Horizon Agentic Framework for Consistent and Hierarchical Repository-Level Code Documentation [27.40384564559557]
We propose MemDocAgent, a framework that generates documentation within a single, integrated context spanning the entire repository.<n>MemDocAgent achieves the best performance over both open and closed-source baselines.
arXiv Detail & Related papers (2026-05-14T08:35:20Z) - Model Editing for New Document Integration in Generative Information Retrieval [110.90609826290968]
Generative retrieval (GR) reformulates the Information Retrieval (IR) task as the generation of document identifiers (docIDs)<n>Existing GR models exhibit poor generalization to newly added documents, often failing to generate the correct docIDs.<n>We propose DOME, a novel method that effectively and efficiently adapts GR models to unseen documents.
arXiv Detail & Related papers (2026-03-03T09:13:38Z) - What Papers Don't Tell You: Recovering Tacit Knowledge for Automated Paper Reproduction [57.86097956633207]
method is a graph-based agent framework for generating executable code from academic papers.<n>On an extended ReproduceBench spanning 3 domains, 10 tasks, and 40 recent papers, method achieves an average performance gap of 10.04% against official implementations.
arXiv Detail & Related papers (2026-03-02T12:33:31Z) - Code2Doc: A Quality-First Curated Dataset for Code Documentation [0.0]
We introduce Code2Doc, a quality-first curated dataset for function-level code documentation generation.<n>Code2Doc consists of 13,358 high-quality function-documentation pairs extracted from open-source repositories.<n>Starting from 52,069 extracted candidates, only 25.6% satisfy all quality constraints.<n>Overall, 86.9% of samples contain explicit type annotations, and only 2.9% are flagged as potentially AI generated.
arXiv Detail & Related papers (2025-12-21T14:28:51Z) - CodeWiki: Evaluating AI's Ability to Generate Holistic Documentation for Large-Scale Codebases [7.75137961900221]
We present bftextCodeWiki, a unified framework for automated repository-level documentation across seven programming languages.<n>CodeWiki introduces three key innovations: (i) hierarchical decomposition that preserves architectural context across multiple levels of granularity, (ii) recursive multi-agent processing with dynamic task delegation for scalable generation, and (iii) multi-modal synthesis that integrates textual descriptions with visual artifacts such as architecture diagrams and data-flow representations.<n>CodeWiki achieves a 68.79% quality score with proprietary models, outperforming the closed-source DeepWiki baseline (64.06%) by 4.73%
arXiv Detail & Related papers (2025-10-28T13:52:46Z) - Paper2Code: Automating Code Generation from Scientific Papers in Machine Learning [70.04746094652653]
We introduce PaperCoder, a framework that transforms machine learning papers into functional code repositories.<n>PaperCoder operates in three stages: planning, designs the system architecture with diagrams, identifies file dependencies, and generates configuration files.<n>We then evaluate PaperCoder on generating code implementations from machine learning papers based on both model-based and human evaluations.
arXiv Detail & Related papers (2025-04-24T01:57:01Z) - EpiCoder: Encompassing Diversity and Complexity in Code Generation [66.43738008739555]
Existing methods for code generation use code snippets as seed data.<n>We introduce a novel feature tree-based synthesis framework, which revolves around hierarchical code features.<n>Our framework provides precise control over the complexity of the generated code, enabling functionalities that range from function-level operations to multi-file scenarios.
arXiv Detail & Related papers (2025-01-08T18:58:15Z) - Linking Code and Documentation Churn: Preliminary Analysis [2.033674689332928]
This study investigates the synchrony between code churn and documentation updates in three GitHub open-source projects.
Preliminary results indicate varying degrees of synchrony across projects, highlighting the importance of integrated concurrent documentation practices.
The novelty of this study lies in demonstrating how synchronizing code changes with documentation updates can improve the development lifecycle by enhancing diversity and efficiency.
arXiv Detail & Related papers (2024-10-08T12:41:58Z) - RepoCoder: Repository-Level Code Completion Through Iterative Retrieval
and Generation [96.75695811963242]
RepoCoder is a framework to streamline the repository-level code completion process.
It incorporates a similarity-based retriever and a pre-trained code language model.
It consistently outperforms the vanilla retrieval-augmented code completion approach.
arXiv Detail & Related papers (2023-03-22T13:54:46Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.