Remember Your Trace: Memory-Guided Long-Horizon Agentic Framework for Consistent and Hierarchical Repository-Level Code Documentation
Suyoung Bae, Jaehoon Lee, Changkyu Choi, YunSeok Choi, Jee-Hyong Lee
NeurIPS page · OpenReview · Open on the map
Category: LLM Agents, Evals & Benchmarks › Software Engineering Benchmarks · Type: new method · Keywords: repository-level code documentation, dependency-aware traversal, memory-guided interaction, hierarchical documentation generation, agentic framework for software
Areas: Memory › Agent Memory Systems › Agent Memory; Code & Coding Agents › Code Verification › Software engineering agents; AI Agents › Agent Benchmarking › Repository agents
Summary
MemDocAgent is a long-horizon agentic framework that generates consistent, hierarchical repository-level code documentation by integrating dependency-aware traversal and a shared memory of prior work traces.
Explained to a 5-year-old
People write notes to help them understand computer code. Usually these notes are made piece by piece, which can cause confusion. This new system makes notes all together in a smart way. It follows the order things depend on and remembers what it has already done. This helps everyone see the code clearly and easily.
Explained to a 5-year-old, longer
Computers have lots of code that does many things. When we write notes about this code, we want them to be helpful. Sometimes the notes are made separately, which can lead to repeating information. This can also cause different notes to say different things. The new idea makes notes for the whole code at once. It looks at how parts of the code depend on each other and decides the best order to explain them. It also keeps a memory of what has already been explained, so it does not repeat itself. This memory helps the system check its work and make sure everything fits together. The result is a set of notes that are consistent, not contradictory, and organized in a clear hierarchy. Developers can read these notes to understand the code faster. Coding assistants also benefit because they have a reliable guide. In real projects, this approach has been shown to work well and save time.
For a technical reader
The system generates documentation for an entire software repository in a single pass, avoiding the redundancy and inconsistency of component-wise approaches. It first determines a traversal order that respects dependencies and granularity among code elements. During generation, an agent consults a shared memory that stores previous read, write, and verification actions, allowing it to build on prior context. This combination yields documentation that is hierarchically structured and consistent across files. Evaluations show it outperforms existing open- and closed-source baselines on multiple criteria and works in real development workflows.
Problem
Existing repository-level code documentation approaches process components independently, leading to redundant retrieval, conflicting descriptions, and a lack of hierarchical structure.
Method
The approach uses a dependency-aware traversal to determine an order that respects dependencies and granularity, and a memory-guided interaction where an agent consults a shared memory that accumulates prior work traces from read, write, and verify operations.
Results
The approach outperforms open and closed-source baselines in a multi-criteria evaluation and shows practical applicability in real development workflows.
Contributions
It introduces a unified, hierarchical documentation generation framework that integrates dependency-aware traversal with a shared memory of prior work traces, enabling consistent repository-level documentation.
Practical relevance
It enables developers and coding agents to efficiently navigate large codebases with reliable, structured documentation, improving software maintainability.
This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction