Remember Your Trace: Memory-Guided Long-Horizon Agentic Framework for Consistent and Hierarchical Repository-Level Code Documentation

πŸ“… 2026-05-14
πŸ“ˆ Citations: 0
✨ Influential: 0
πŸ“„ PDF

career value

209K/year
πŸ€– AI Summary
Existing repository-level code documentation approaches often treat individual components in isolation, leading to redundant retrieval, conflicting descriptions, and a lack of hierarchical structure. This work proposes MemDocAgent, a framework that enables collaborative generation of structured documentation through dependency-aware traversal order and a shared memory mechanism, allowing agents to operate within a unified context. The framework introduces RepoMemory, which supports agents in reading, writing, and validating historical trajectories to ensure consistency and hierarchy over long-horizon documentation tasks. Experimental results demonstrate that MemDocAgent significantly outperforms both open-source and closed-source baselines across multiple evaluation dimensions, highlighting its practical utility in real-world software development scenarios.
πŸ“ Abstract
Automated code documentation is essential for modern software development, providing the contextual grounding that both human developers and coding agents rely on to navigate large codebases. Existing repository-level approaches process components independently, causing redundant retrieval and conflicting descriptions across documents while producing outputs that lack hierarchical structure. Therefore, we propose MemDocAgent, a long-horizon agentic framework that generates documentation within a single, integrated context spanning the entire repository. It combines two components: (i) Dependency-Aware Traversal Guiding that predetermines a traversal order respecting dependency and granularity hierarchies; (ii) Memory-Guided Agentic Interaction, in which the agent interacts with RepoMemory, a shared memory accumulating prior work traces through read, write, and verify operations. Through an in-depth multi-criteria evaluation, MemDocAgent achieves the best performance over both open and closed-source baselines and demonstrates practical applicability in real software development workflows.
Problem

Research questions and friction points this paper is trying to address.

code documentation
repository-level
hierarchical structure
consistency
long-horizon
Innovation

Methods, ideas, or system contributions that make the work stand out.

Memory-Guided Agentic Framework
Repository-Level Code Documentation
Dependency-Aware Traversal
Shared Memory
Long-Horizon Planning
πŸ”Ž Similar Papers
No similar papers found.