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 2026
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.
Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.
Claim this paperedit · history
NeurIPS 2026
Accept (poster) · 4 reviews · OpenReview
Updated 25 Nov 2026, 03:43 UTC.
- Decision
- Accept (poster)
Read decision
Meta-review
The paper proposes MemDocAgent, which reframes repository-level documentation as a single cumulative trajectory and combines dependency-aware traversal with a structured shared memory supporting READ/WRITE/VERIFY/FINISH operations to produce mutually consistent component-, module-, and repository-level documentation. The paper’s main strengths are the practical importance of the problem, the coherent memory-and-verification design, and an unusually broad evaluation that includes conventional documentation metrics, efficiency, and an execution-based information-sufficiency metric based on code regeneration. The initial concerns centered on conceptual novelty, fairness and circularity of the evaluation, statistical support, error propagation through memory, scalability, and whether information sufficiency measures documentation quality rather than length or generator capability. The rebuttal addressed these concerns particularly well. The authors added a generic vector-memory control and shuffled-order ablation to isolate the contribution of the documentation-specific memory and cumulative traversal; template-matched baseline comparisons and clarification that the post-hoc inconsistency metric is independent of the internal NLI verifier; paired significance tests and multi-seed results; manual verification-failure analysis and trusted-reference gating showing that below-threshold documents do not propagate as verification references; length-controlled and multi-generator information-sufficiency analyses; threshold sensitivity studies; and large-scale Java/C++ experiments with repositories containing thousands of components. Reviewers mH8C, 8jeK, and Dp3t explicitly stated that their concerns were addressed and raised or maintained their assessments at Accept, while kK9H remained positively inclined and retained a Borderline Accept score. In my view, the rebuttal materially changes the balance of the paper: the work is no longer supported merely by an effective integration of known components, but by controlled evidence that the structured, verification-gated RepoMemory and dependency-aware cumulative trajectory provide benefits beyond generic memory, formatting, or additional context. I therefore recommend Accept (Spotlight). The paper stands out because it introduces a clear formulation of repository documentation as a stateful cross-document consistency problem, provides a practical and reproducible system for addressing it, and supports the design with unusually comprehensive controls spanning quality, consistency, utility, scalability, and robustness.
Final justification
I recommend Accept (Spotlight). The rebuttal directly addressed the major concerns in the initial meta-review with strong controlled experiments, significance analysis, error-propagation checks, metric-validity studies, and large-scale cross-language evaluation. The resulting evidence convincingly supports the documentation-specific memory and cumulative-trajectory design rather than generic memory or formatting effects. The combination of a practically important problem, a clear system contribution, and unusually thorough empirical validation makes the paper stand out beyond a standard poster acceptance.
Read meta-review
Meta-review
The paper proposes MemDocAgent, which reframes repository-level documentation as a single cumulative trajectory and combines dependency-aware traversal with a structured shared memory supporting READ/WRITE/VERIFY/FINISH operations to produce mutually consistent component-, module-, and repository-level documentation. The paper’s main strengths are the practical importance of the problem, the coherent memory-and-verification design, and an unusually broad evaluation that includes conventional documentation metrics, efficiency, and an execution-based information-sufficiency metric based on code regeneration. The initial concerns centered on conceptual novelty, fairness and circularity of the evaluation, statistical support, error propagation through memory, scalability, and whether information sufficiency measures documentation quality rather than length or generator capability. The rebuttal addressed these concerns particularly well. The authors added a generic vector-memory control and shuffled-order ablation to isolate the contribution of the documentation-specific memory and cumulative traversal; template-matched baseline comparisons and clarification that the post-hoc inconsistency metric is independent of the internal NLI verifier; paired significance tests and multi-seed results; manual verification-failure analysis and trusted-reference gating showing that below-threshold documents do not propagate as verification references; length-controlled and multi-generator information-sufficiency analyses; threshold sensitivity studies; and large-scale Java/C++ experiments with repositories containing thousands of components. Reviewers mH8C, 8jeK, and Dp3t explicitly stated that their concerns were addressed and raised or maintained their assessments at Accept, while kK9H remained positively inclined and retained a Borderline Accept score. In my view, the rebuttal materially changes the balance of the paper: the work is no longer supported merely by an effective integration of known components, but by controlled evidence that the structured, verification-gated RepoMemory and dependency-aware cumulative trajectory provide benefits beyond generic memory, formatting, or additional context. I therefore recommend Accept (Spotlight). The paper stands out because it introduces a clear formulation of repository documentation as a stateful cross-document consistency problem, provides a practical and reproducible system for addressing it, and supports the design with unusually comprehensive controls spanning quality, consistency, utility, scalability, and robustness.
Final justification
I recommend Accept (Spotlight). The rebuttal directly addressed the major concerns in the initial meta-review with strong controlled experiments, significance analysis, error-propagation checks, metric-validity studies, and large-scale cross-language evaluation. The resulting evidence convincingly supports the documentation-specific memory and cumulative-trajectory design rather than generic memory or formatting effects. The combination of a practically important problem, a clear system contribution, and unusually thorough empirical validation makes the paper stand out beyond a standard poster acceptance.
1 comment
- Rating
- 5/6
- Confidence
- 4/5
- Quality
- 4/4
- Clarity
- 4/4
- Significance
- 3/4
- Originality
- 4/4
- Contribution type
- general
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
This paper proposes MemDocAgent, a long-horizon agentic framework for repository-level code documentation. The key idea is to treat documentation generation as a single cumulative trajectory over the whole repository rather than as independent per-component tasks. The framework combines dependency-aware traversal, which orders documentation units according to both code dependencies and the component/module/repository hierarchy, with memory-guided agentic interaction, where a shared RepoMemory stores retrieved context, generated documents, claims, and verification scores.
Strengths and weaknesses
- Innovative Framing and Problem Identification: The paper accurately points out that treating code components as isolated tasks leads to redundant retrieval and logical inconsistencies, and innovatively reframes this as a long-horizon agentic task with a shared memory state, intuitively and effectively solving this major pain point.
- Novel "Information Sufficiency" Metric: Introducing a quantitative "information sufficiency" metric that measures code regeneration capability via Pass@k and CodeBLEU provides an objective utility evaluation standard that surpasses subjective "LLM-as-a-judge" approaches.
- Comprehensive Evaluation and Ablations: Robust empirical results demonstrate the framework's superior performance across both open-source and closed-source models, and ablation studies successfully verify the indispensability of the three core components: ReAct-style reasoning, RepoMemory, and conflict verification.
- Scope Limitation of Information Sufficiency Evaluation: Although the framework advocates for hierarchical documentation generation, "information sufficiency" is only evaluated on component-level function regeneration, lacking quantitative data to prove how module-level or repository-level documentation functions in broader architectural tasks.
- Hyperparameter Sensitivity: The system relies on strict hardcoded thresholds, such as the number of revisions and verification passing scores, but lacks a sensitivity analysis to show the impact of altering these thresholds on the trade-offs among documentation quality, computational cost, and execution time.
Questions
-
When a component reaches the maximum revision limit (2 revisions) but still fails to meet the 0.90 verification threshold, is the flawed documentation forcibly committed to RepoMemory, or is it discarded entirely? Regardless of the outcome, how does this affect the NLI-based conflict verification process for downstream components that depend on it?
-
Given the framework's reliance on specific hardcoded thresholds (e.g., a maximum of 2 revisions, a maximum of 10 steps per sub-trajectory, and a 0.90 verification passing score), how sensitive is the overall system performance to these hyperparameter choices? Could the authors provide a sensitivity analysis to demonstrate the trade-offs between documentation quality, token cost, and execution time when these thresholds are relaxed or tightened?
Limitations
See weaknesses
Final justification
The author's response has addressed most of my concerns.
Formatting concerns
None
3 comments
Response to Reviewer Dp3t
Dear Reviewer Dp3t,
We sincerely thank the reviewer for the thoughtful and constructive review, and for taking the time to evaluate our manuscript. We especially appreciate your recognition of our novelty, the newly introduced evaluation metric, and the comprehensiveness of our experiments. We have carefully considered each of your comments and provide detailed responses below.
Response to W1: Scope of the Information Sufficiency Evaluation
We appreciate the reviewer raising this point. Our information sufficiency metric measures whether hierarchical context helps component-level function regeneration. We evaluate at the component-function level because DevEval's human-curated unit tests are available only at the function level, enabling objective, execution-based verification via Pass@k. This was a deliberate choice for metric rigor, and we acknowledge that it does not yet directly measure the standalone utility of module-/repository-level documents.
Still, our results give indirect evidence of their value: in Figure 3 (and Table 25), regeneration performance increases monotonically as context widens from C → C+M → C+M+R. This shows that higher-level documents carry repository-wide and architectural information that materially aids regeneration.
To address the limitation more directly, one could evaluate how module/repo documents directly support architecture-level tasks — e.g., providing only module/repo documents and measuring accuracy on inter-module dependency identification or feature localization. However, constructing a reliable, high-quality test set for this is infeasible within the one-week rebuttal period, so we will build this extended metric and include the results in the revised version.
Response to W2 and Q2: Hyperparameter Sensitivity
We accept this suggestion. Our system uses three fixed thresholds (max 2 revisions per unit, max 10 steps per sub-trajectory, verify-pass score 0.9). We add a sensitivity analysis measuring the trade-off among documentation quality, time cost, and termination behavior as each is varied (with 20 repositories, backbone: Qwen3-Coder).
(1) Max revisions.
| Max revisions | Completeness | Truthfulness | Helpfulness | Time/Doc (s) | Below-threshold termination |
|---|---|---|---|---|---|
| 1 | 0.842 | 0.892 | 0.684 | 50.27 | 11.8% |
| 2 (default) | 0.979 | 0.916 | 0.690 | 53.16 | 0.08% |
| 3 | 0.980 | 0.930 | 0.695 | 61.67 | 0.02% |
With only 1 revision, 11.8% of components terminate below threshold and completeness drops sharply. Moving from 2 to 3 revisions yields marginal quality gains but increases time by ~16%. 2 revisions is the balance point.
(2) Max steps per sub-trajectory.
| Max step | Completeness | Truthfulness | Helpfulness | Time/Doc (s) | Unfinished rate |
|---|---|---|---|---|---|
| 5 | 0.840 | 0.608 | 0.470 | 40.21 | 20.72% |
| 10 (default) | 0.979 | 0.916 | 0.690 | 53.16 | 0.08% |
| 15 | 0.979 | 0.916 | 0.682 | 71.24 | 0.01% |
With 5 steps, 20.7% of sub-tasks fail to finish and quality collapses. With 15 steps, quality no longer improves while time rises ~34% (more redundant looping). 10 steps is the balance point.
(3) Verify-pass threshold.
| Threshold | Completeness | Truthfulness | Helpfulness | Time/Doc (s) | Avg. revisions |
|---|---|---|---|---|---|
| 0.85 | 0.970 | 0.902 | 0.683 | 46.45 | 1.2 |
| 0.9 (default) | 0.979 | 0.916 | 0.690 | 53.16 | 1.47 |
| 0.95 | 0.975 | 0.926 | 0.695 | 68.23 | 1.9 |
A higher threshold improves quality only marginally (0.9 → 0.95: +0.010 Truthfulness) while raising time by ~28% and forcing more revisions. 0.9 offers the best quality–cost trade-off.
Across all three, the default configuration (2 / 10 / 0.9) sits at the quality efficiency balance point. We will add this analysis to the revised version.
Response to Q1: Handling Documents That Fail Verification
- When a component reaches the revision limit but still falls below the 0.90 threshold, the document is not discarded. It is committed to RepoMemory as its best available version, to preserve full documentation coverage. In our experiments, this occurs for only 0.08% of all components.
- Crucially, such a document does not corrupt later verification. The key is the reference-set filtering rule in Appendix A.3, Step 1. During cross-document conflict verification, the reference set retains only documents whose verification score exceeds 0.9 as trusted references. This structurally prevents a low-quality document from becoming a conflict-checking criterion and propagating errors to dependent components.
Our final comments
We have conducted and presented all additional experiments and analyses about all weaknesses and reviewer’s questions. If there are still concerns that need to be addressed, please let us know, and we would be glad to provide further clarification or additional analysis.
The author's response has addressed most of my concerns, I will increase my score to 5
Dear Reviewer Dp3t,
We appreciate your careful reevaluation of our work. We are glad our response was able to clarify the points you raised.
Best regards, The Authors
- Rating
- 5/6
- Confidence
- 3/5
- Quality
- 3/4
- Clarity
- 3/4
- Significance
- 3/4
- Originality
- 3/4
- Contribution type
- general
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
This paper focuses on repository-level code documentation, arguing that existing systems (RepoAgent, DocAgent, CodeWiki, DeepWiki) document each component in isolation, which causes redundant source-file retrieval, cross-document inconsistency, and a lack of hierarchical structure. The authors propose MemDocAgent, which reframes the task as a long-horizon agentic problem where a single agent documents the entire repository in one trajectory with persistent shared memory.
The method has two components: (1) Dependency-Aware Traversal Guiding, which precomputes a traversal order respecting both dependency relations and the component-module-repository granularity hierarchy and (2) Memory-Guided Agentic Interaction, where the agent interacts with RepoMemory via READ/WRITE/VERIFY/FINISH actions.
Beyond completeness, truthfulness, and helpfulness, the paper introduces information sufficiency—measuring whether documentation alone lets a model regenerate the original code.
Strengths and weaknesses
Strength:
- Sound and self-consistent method design. Reframing repository documentation as a single long-horizon trajectory with persistent memory is a natural and useful shift.
- Information sufficiency is a genuine contribution. It captures a dimension, implementation-level reconstructability, that prior metrics overlook.
- Broad and transparent evaluation involving 20 repositories across 10 domains.
Weakness:
-
Evaluation circularity. Several of the metrics appear coupled to the method itself, which inflates the apparent margin. For example, Section Presence checks whether documents conform to a prescribed template, but MemDocAgent is prompted with templates that match this metric exactly, while baselines use different formats. Helpfulness seems to have the same issue, giving credits to what is emphasized in the prompt of MemDocAgent. Also, if the Figure 1 inconsistency metric reuses the same NLI mechanism as the internal VERIFY, the method is being evaluated on a criterion entangled with its own verification module.
-
No statistical significance. Checklist Q7 is answered [Yes], but the justification ("fixed test set, same seed") is not an error bar. There are no variance estimates or multiple runs, despite most metrics depending on temperature-driven LLMs. For a paper whose claims rest on judge scores, single-run results are a real limitation.
-
Selective efficiency narrative. The "41% read-time reduction" is relative to DocAgent, the slowest strong baseline. Efficiency claims should be framed against the full spectrum of baselines.
Questions
- How is the cross-document inconsistency rate in Figure 1 computed, and what is its relationship (if there is any) to the NLI conflict score defined in Appendix A.3?
Limitations
See weaknesses.
Final justification
The insight provided by the paper, as well as its numerical demonstrations, are sound. One reservation I would like to record: documentation generation is a highly practical problem, and the effectiveness of any such method plausibly depends a great deal on the properties of the target repository and on the downstream task. In practice, the generated documentation is often not meant to be read by humans at all, but instead serves as an intermediate artifact in service of some other purpose. That said, I recognize this is a consideration that may not be fully addressable within the scope of an academic paper.
Formatting concerns
None.
3 comments
Response to Reviewer 8jeK
Dear Reviewer 8jeK,
Thank you very much for your thoughtful and constructive review, and for taking the time to evaluate our revised manuscript. We especially appreciate your recognition that the newly added information sufficiency metrics and our novelty. We have carefully considered each of your additional suggestions and provide detailed responses below.
Response to W1 and Q1
(W1) Evaluation Circularity
- Section Presence is a sanity check, not a head-to-head metric. We agree that Section Presence can be unfair for cross-method comparison, since baselines use different formats. However, it was never intended as a primary metric for ranking methods. It is a sanity check that verifies whether MemDocAgent actually produces the intended hierarchical structure with all prescribed sections (Table 16).
- The substantive comparison between methods rests on format-independent metrics: AST-based Entity Coverage, Truthfulness, Helpfulness, and information sufficiency. Our advantage holds consistently across all of these, so it does not stem from template alignment. We will state this explicitly in the main text.
- Helpfulness is not designed by us. We adopt DocAgent's [1] LLM-as-judge protocol as-is (line 202). The per-section rubrics (Tables 17–19) are general, granularity-level criteria not tailored to favor any method, and are applied identically to all systems. To avoid self-preference bias, the judge (Claude Haiku 4.5) is chosen not to overlap with any backbone (line 244).
(Q1) How is the cross-document inconsistency rate in Figure 1 computed?
-
The Figure 1 inconsistency rate does not share the internal VERIFY's NLI module. The two are distinct mechanisms.
- Internal VERIFY is a generation-time signal that checks each draft using an NLI model (
MoritzLaurer/DeBERTa-v3-large-mnli-fever-anli-ling-wanli). - The Figure 1 inconsistency rate is a post-hoc evaluation over the final document set, computed with a separate LLM-judge and applied identically to all baselines. Concretely: (1) collect dependency-linked document pairs, (2) have the LLM-judge decide whether each pair's descriptions contradict, and (3) report (contradictory pairs) / (evaluated pairs).
- Internal VERIFY is a generation-time signal that checks each draft using an NLI model (
-
Thus the two differ in timing (during vs. after generation), target (a single draft vs. all document pairs), and tool (DeBERTa NLI vs. LLM-judge), so the evaluation criterion is not entangled with our verification module. acknowledge this procedure was under-specified in the paper and will add its precise definition to the appendix.
Response to W2: Statistical Significance
We fully accept this concern. During the rebuttal period, we additionally report mean ± std from multi-seed re-runs on two representative repositories, and we will extend this to all 20 repositories in the revised version.
[Table: Mean and Std. on two repositories (backbone: Qwen3-Coder)]
| Repo | Metric | Mean ± Std. (3 seeds) |
|---|---|---|
| Wikipedia-API | Completeness | 0.983 ± 0.020 |
| Truthfulness | 0.910 ± 0.010 | |
| Helpfulness | 0.678 ± 0.023 | |
| bplustree | Completeness | 0.967 ± 0.011 |
| Truthfulness | 0.928 ± 0.015 | |
| Helpfulness | 0.772 ± 0.019 |
The standard deviations are small (≤ 0.023) across all metrics, and the reported single-run scores fall within one standard deviation of the mean, indicating that our results are stable across runs.
Response to W3: Selective Efficiency Narrative
Thank you for your valuable feedback. The "41% read-time reduction" in the main text is measured against DocAgent, the strongest agentic baseline, but efficiency should be framed across the full spectrum of baselines. We already report per-document generation time and API cost for all baselines in Table 26, and in the revised version we will expand the Section 6.3 analysis to cover not only DocAgent but also CodeWiki and RepoAgent, incorporating these appendix results into the main efficiency discussion.
Our final comments
We have addressed all three weaknesses by conducting additional experiments and providing detailed clarifications. If there are still concerns that need to be addressed, please let us know, and we would be glad to provide further clarification or additional analysis.
The authors address my specific concerns. I will raise my score to 5.
Dear Reviewer 8jeK,
Thank you for your thoughtful reassessment. We are pleased that our rebuttal addressed your specific concerns.
Best regards, Authors
- Rating
- 5/6
- Confidence
- 4/5
- Quality
- 3/4
- Clarity
- 3/4
- Significance
- 3/4
- Originality
- 3/4
- Contribution type
- general
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
This paper proposes MemDocAgent, a framework for repository-level code documentation. The method generates hierarchical documentation at the component, module, and repository levels. It combines dependency-aware traversal with a shared memory store that records previously generated documentation and retrieved context. During generation, the agent follows a structured READ/WRITE/VERIFY/FINISH workflow, where the VERIFY step combines self-evaluation with cross-document consistency checking.
The authors evaluate the system on 20 Python repositories and compare it with several open-source and closed-source documentation baselines. The evaluation covers completeness, truthfulness, helpfulness, efficiency, and an information sufficiency metric based on whether generated documentation helps an LLM reconstruct source code.
Strengths and weaknesses
Strengths
- The paper studies a practically important problem. Repository-level documentation is useful for human developers and may also help coding agents understand large codebases.
- The proposed system is clearly structured. The combination of dependency-aware traversal, hierarchical documentation, memory reuse, and verification is easy to understand and well presented.
Weaknesses
- The technical novelty seems limited. The main components of the system are largely combinations of existing ideas: dependency-aware traversal, external memory, iterative agent workflows, and NLI-based inconsistency detection. The integration is useful, but the paper does not clearly establish which part of the method constitutes a substantially new algorithmic contribution. As a result, the contribution appears more like a well-engineered system than a conceptually new method.
- The motivation for treating this as a long-horizon agent problem could be stronger. The documentation process is mostly organized by a predetermined traversal order, and each unit follows a relatively fixed read-write-verify pattern. While the trajectory may be long in terms of the number of processed components, it is less clear whether the task requires long-horizon planning or complex sequential decision making. The paper would be stronger if it more clearly distinguished long sequential processing from genuinely long-horizon reasoning.
- The verification mechanism may be less reliable than the paper suggests. The cross-document verification relies on decomposing documentation into claims and checking them against previously generated documentation using an NLI model. This may help catch explicit contradictions, but it is less likely to detect missing information, vague descriptions, wrong emphasis, or subtle code-level inaccuracies. In addition, previously verified documents are treated as trusted references, so errors introduced early in the trajectory may propagate to later documentation.
- The information sufficiency metric is interesting but difficult to interpret. The metric evaluates whether an LLM can regenerate code from documentation. However, this result depends not only on the documentation but also on the capabilities and biases of the downstream code-generation model. It may also favor longer or more implementation-heavy documentation, which is not always equivalent to better documentation for human developers. More analysis is needed to clarify what this metric measures beyond information density.
- Some baseline comparisons are not fully apples-to-apples. Several baselines operate at different documentation granularities. For example, some systems focus on component-level documentation, while others generate higher-level repository summaries. Since MemDocAgent explicitly generates documentation at all three levels, some improvements may partly come from the broader task formulation rather than the proposed memory and verification mechanisms alone.
- The evidence for scalability is still limited. The evaluation covers 20 repositories, which is useful, but it is not clear how well the method would scale to much larger industrial repositories with deeper dependency graphs, many more files, and more complex build or runtime environments. The reported per-document runtime also suggests that the method may still be expensive in large-scale deployment.
Questions
- Can the authors provide a clearer comparison between MemDocAgent and prior memory-augmented agent frameworks? Which part of the proposed memory design is specific to repository-level documentation rather than a direct adaptation of existing memory mechanisms?
- How often does the verification module fail to detect incorrect or incomplete documentation? A qualitative analysis of false positives and false negatives would make the verification results more convincing.
- What happens when an early generated document is incorrect but still passes verification? Does the error propagate to later module- or repository-level documentation?
- Can the authors disentangle the effect of documentation length from documentation quality in the information sufficiency evaluation? For example, would a longer but poorly organized document also improve code regeneration performance?
- Since several baselines generate documentation at different granularities, can the authors provide more controlled comparisons where all methods are evaluated under the same documentation scope?
- The paper reports consistent improvements across repositories, but I did not find a detailed statistical significance analysis with confidence intervals or hypothesis tests. Can the authors clarify whether the improvements are statistically significant across repositories?
Limitations
yes
Final justification
The paper presents a well-executed and practically meaningful framework for repository-level code documentation. The rebuttal addressed all concerns with concrete additional results, including a manual failure analysis for VERIFY, length-controlled information sufficiency results, controlled template-based baseline comparisons, large-scale Java/C++ repository experiments, and Wilcoxon significance tests. These additions make the empirical evidence substantially stronger and resolve most of my major concerns. Therefore, I recommend increasing my score to 5.
Formatting concerns
none
6 comments
Response to Reviewer mH8C [1/3]
Dear Reviewer mH8C,
Thank you very much for your thoughtful and constructive review, and for taking the time to evaluate our revised manuscript. We have carefully considered each of your additional suggestions and provide detailed responses below.
Response to W1 and Q1
(W1) We thank the reviewer for this comment. Our novelty lies in (i) a reformulation of the repository-level documentation task, (ii) three domain-specific design choices that this reformulation requires.
-
(i) Reformulation: Existing memory agents target a single-output setting, where memory supports one final answer (Section 2.1, lines 78–80). Repository documentation is different. The same entity must be described consistently across many interdependent documents. We reformulate this as generating a set of mutually-consistent documents over one cumulative trajectory, which cannot be met by directly applying existing memory mechanisms.
-
(ii) This reformulation requires three domain specific designs:
-
Documentation-specific RepoMemory schema (Table 1): Unlike generic text/embedding memory, each record stores decomposed atomic claims, verification scores, dependency relations, and child units. This structure is what enables commit-time, claim-level cross-document verification, impossible with plain embedding memory that stores neither claims nor dependency structure.
-
Verification-gated reference reliability : Whereas generic memory retrieves all items equally, RepoMemory admits only VERIFY-passed documents as trusted references. Memory thus acts as a consistency-enforcement mechanism, structurally preventing low-quality documents from becoming reference criteria and propagating errors.
-
Dependency and hierarchy-aware ordering (Section 4.2, Algorithms 1~2): Unlike DocAgent [1], our topological order jointly satisfies component-dependency order and the granularity hierarchy, so each unit is processed with its dependencies and child units already in memory, which is what makes memory reuse and verification meaningful.
-
(Q1) To directly compare with the effect of this design, we compare against a baseline that replaces RepoMemory with a generic vector memory (ReAct + embedding top-1 retrieval, no schema or verification gating):
[Table: Comparison between our RepoMemory and prior memory frameworks]
| Method | Completeness | Truthfulness | Helpfulness | Pass@1 | Pass@3 | CodeBLEU |
|---|---|---|---|---|---|---|
| Ours w/o memory | 0.903 | 0.768 | 0.593 | 0.324 | 0.333 | 0.190 |
| Ours w/ vector memory | 0.910 | 0.760 | 0.480 | 0.332 | 0.350 | 0.280 |
| Ours | 0.979 | 0.916 | 0.690 | 0.461 | 0.467 | 0.419 |
Adding a generic vector memory yields only marginal or even negative changes on quality metrics, because unverified, inconsistent context is injected without any consistency control. Only the full RepoMemory design — with its structured schema and verification gate — produces substantial gains across all metrics. This confirms that the improvement stems from the documentation-specific memory design, not from the mere presence of memory.
Response to W2
We accept this and refine our claim. We do not claim complex long-horizon planning, but long-horizon stateful execution with cumulative cross-document dependency, each document depends on outputs verified and stored in earlier steps, accumulating across a single trajectory.
The key point is that the traversal order itself forms a cumulative context. If each unit were an independent short-horizon task, shuffling the order would leave results unchanged; a drop under disruption is therefore direct evidence of cumulative, dependency-grounded execution rather than mere long sequential processing. To test this, we ran a shuffled-order ablation that randomizes the traversal order (10 repositories, Qwen3-Coder backbone):
| Setting | Completeness | Truthfulness | Helpfulness | CodeBLEU |
|---|---|---|---|---|
| Ordered (Ours) | 0.954 | 0.741 | 0.751 | 0.282 |
| Shuffled | 0.930 | 0.543 | 0.635 | 0.250 |
| Δ | −0.024 | −0.198 | −0.016 | −0.032 |
The drop is largest on Truthfulness (−0.198), the dimension governed by cross-document consistency, since disrupting the order removes the verified dependency documents needed at verification time. This confirms the traversal order is a cumulative context, not a mere processing sequence. We will extend this ablation to all repositories in the revised version.
Response to Reviewer mH8C [2/3]
Response to W3, Q2, and Q3
1. (W3) VERIFY is a complementary two-stage mechanism (See details in Appendix A.3)
- The concern that VERIFY catches explicit contradictions but misses missing/vague/mis-emphasized content assumes it relies on NLI alone. In fact, the final score is the average of two branches (Eq. 4), NLI cross-document check and (2) Self-evaluation scores factual consistency, completeness, and helpfulness.
- Thus the exact issues raised are covered by other branches: missing information by completeness, vague/mis-emphasized descriptions by helpfulness. Since both branches must jointly clear the threshold (0.9), self-evaluation complements the limits of NLI.
- Figure 5 in Section 6.4 confirms this: across VERIFY iterations, both self-evaluation and conflict scores rise together, showing the two branches jointly refine the document.
2. (Q2) Quantitative failure analysis
- To quantify reliability, three authors manually labeled pass/fail on 50 randomly sampled documents and compared against VERIFY's decisions (inter-annotator Kappa = 0.85, high agreement). We will add a qualitative analysis of representative false positives/negatives to the appendix.
- Results:
- Precision : 0.967 / Recall : 0.935 / F1 : 0.951 / Accuracy : 0.940
3. (Q3) Error propagation is structurally blocked
When a document fails to reach the threshold, it is stored in memory for coverage but is excluded from the trusted reference set. cross-document verification retains only documents with a verification score above 0.9 as references (See Appendix A.3, Step 1). A low-quality document therefore never serves as a conflict-checking criterion for later units, so early errors cannot propagate.
Response to W4 and Q4
1. (W4) Why we introduce information sufficiency
- Prior work relies mainly on subjective LLM-judge metrics [1,3,4], lacking an objective signal. Motivated by the real scenario where documentation serves as a context tool for coding agents, we add an execution-based metric measuring whether the documentation contains enough information to reproduce the code. It does not replace the LLM-judge metrics but complements their subjectivity, and is meant to be read together with the other metrics.
- To mitigate generator-specific bias, we already evaluate with two different code generators (GPT-4o-mini and Claude Haiku 4.5), and the ranking across systems is preserved under both (Figure 3, Table 25). We also chose evaluation generators that do not overlap with any backbone to avoid self-preference bias (line 244). The same trend holds when we use a stronger, different generator (Claude Sonnet), confirming that the ranking reflects the documentation rather than a particular generator's capacity:
[Table: Information sufficiency with Claude Sonnet as the generator (backbone: Qwen3-Coder)]
| Method | Pass@1 | Pass@3 | CodeBLEU |
|---|---|---|---|
| No docs | 0.180 | 0.205 | 0.270 |
| Ground-truth | 0.221 | 0.353 | 0.298 |
| Prompting | 0.262 | 0.345 | 0.347 |
| RepoAgent | 0.352 | 0.390 | 0.325 |
| DocAgent | 0.305 | 0.355 | 0.308 |
| Ours (C+M+R) | 0.573 | 0.608 | 0.501 |
2. (Q4) Disentangling length from quality
We ran a length-controlled analysis, binning documents by token length and comparing systems within each bin. The correlation between document length and pass rate is negligible (Pearson r = −0.084), and MemDocAgent leads within every bin:
| Length (tokens) | RepoAgent | DocAgent | MemDocAgent |
|---|---|---|---|
| ~2000 | – | 0.439 | 0.667 |
| 2000–3500 | 0.352 | 0.226 | 0.440 |
| 3500~ | 0.353 | 0.250 | 0.500 |
| Total | 0.352 | 0.305 | 0.535 |
(Pass@1, backbone Qwen3-Coder; RepoAgent produces no documents in the ~2000 range.)
Response to Reviewer mH8C [3/3]
Response to W5 and Q5
1. (W5) Fairness of Experimental Comparisons
- What we measure is which pipeline design produces better documentation, so differing pipelines are the object of comparison, not an unfairness. MemDocAgent's contribution is a pipeline design for repository-level documentation, not a prompt or backbone choice. Baselines such as DocAgent [1] and RepoAgent [2] likewise propose their own pipelines, and this line of work compares pipelines at the method level.
- A scope-matched comparison already exists in Table 2b. To control for differing output granularities, we report results separated by level (Table 2b in Section 6). Under this matched setting, MemDocAgent leads on all metrics.
2. (Q5) Providing More Controlled Comparisons
- To address the reviewer’s concern, we further evaluate all baselines with the same output template as MemDocAgent (templated) at the component level, fully aligning output format:
| Method | Completeness (orig / templated) | Truthfulness (orig / templated) | Helpfulness (orig / templated) |
|---|---|---|---|
| Prompting | 0.886 / 0.904 | 0.694 / 0.701 | 0.577 / 0.581 |
| RepoAgent | 0.813 / 0.890 | 0.835 / 0.850 | 0.391 / 0.400 |
| DocAgent | 0.845 / 0.880 | 0.800 / 0.857 | 0.556 / 0.576 |
| MemDocAgent | 0.987 / 0.987 | 0.916 / 0.916 | 0.691 / 0.916 |
- Even after fully aligning the output format, MemDocAgent still leads on all three metrics. This confirms that the improvement comes from the proposed memory and verification mechanisms, not from the task formulation or format differences.
- To isolate the effect of the pipeline design, we control every other factor across all methods, (1) the same agent models and hyperparameters, (2) the same evaluation framework and metrics, and (3) the same LLM judge model, deliberately chosen not to overlap with any backbone (line 244).
Response to W6 : Regarding limited scalability.
In Appendix C.2 (Table 24), we already report a scalability analysis showing consistent performance on large repositories, including very large ones such as mingus and ydata-profiling (194+ files, 600+ components). To further demonstrate language-agnosticism and size stability, we collected additional large-scale GitHub repositories in Java and C++ during the rebuttal period and report the results below.
- Repositories:
- Java: elastic/logstash (395 files, 4,134 components)
- C++: electron/electron (835 files, 9,190 components)
[Table: Performance on other language, large-scaled repositories (backbone: Qwen3-Coder)]
| Repo | Method | Completeness | Truthfulness | Helpfulness | Time/Doc (s) |
|---|---|---|---|---|---|
| Java | DocAgent | 0.835 | 0.730 | 0.600 | 72.80 |
| Ours | 0.978 | 0.957 | 0.703 | 60.21 | |
| C++ | DocAgent | 0.820 | 0.810 | 0.550 | 69.10 |
| Ours | 0.988 | 0.930 | 0.695 | 58.39 |
These repositories are 2~4× larger in file count and 6–14× larger in component count than the largest repository used in our paper. In such large-scale settings, per-document time increases slightly due to reading dependency-related documents at the module and repository levels, yet MemDocAgent remains more efficient than the SOTA baseline DocAgent in both quality and time cost. We acknowledge that full validation on real industrial deployment environments with complex build/runtime setups remains limited due to resource constraints, and we will collect such data and add the results in the revised version.
Response to Q6: Statistical Significance
We thank the reviewer for this methodological concern. Using the per-repository results in Tables 21–23, we ran paired Wilcoxon signed-rank tests across all 20 repositories for each metric under the Qwen3-Coder-30B backbone. Against Prompting, RepoAgent, and DocAgent, MemDocAgent wins on all 20/20 repositories for every metric (Completeness, Truthfulness, Helpfulness), yielding p < 0.001 in every case. We will add this analysis to the revised version.
References
[1] DocAgent: An Agentic Framework for Multi-Modal Long-Context Document Understanding (Sun et al., EMNLP 2025)
[2] Repoagent: An llm-powered open-source framework for repository-level code documentation generation. (Luo, Qinyu, et al., EMNLP 2024)
[3] ProConSuL: Project Context for Code Summarization with LLMs (Lomshakov et al., EMNLP 2024)
[4] Can large language models serve as evaluators for code summarization?.(Wu, Yang, et al., IEEE Transactions on Software Engineering 2025)
Our final comments :
We have conducted and presented all additional experiments and analyses about all weaknesses and reviewer’s questions. We believe that most of the raised concerns have been adequately addressed. If there are still concerns that need to be addressed, please let us know, and we would be glad to provide further clarification or additional analysis.
- Rating
- 4/6
- Confidence
- 3/5
- Quality
- 3/4
- Clarity
- 3/4
- Significance
- 2/4
- Originality
- 2/4
- Contribution type
- general
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
This paper treats repo-level documentation as one long agent run that builds docs bottom-up (component → module → repo). Two main ideas: a dependency-aware traversal so things get documented in a sensible order, and a shared memory the agent can read/write/verify/commit against, so it doesn’t keep re-fetching the same files or writing inconsistent docs. Results look solid against both open- and closed-source baselines, with a nice extra check that the docs are actually enough to regenerate code. Motivation is clear and the problem is real.
Strengths and weaknesses
Strengths
- This paper feels like a real long-horizon agent setup, not just “doc each file in isolation.” Memory + structured actions is a clean way to cut redundant retrieval and keep docs consistent.
- Evaluation is thoughtful, which considers whether the docs carry enough info to regenerate code
- Good practical story: useful both for human developers and for other coding agents.
Weaknesses
- Only Python, only one benchmark, modest set of repos, but it's hard to know how far this generalizes.
- A lot of the important how-it-works detail lives in the appendix - i personally suggest the authors moving part of them to the main text.
- The experimental comparisons are a bit apples-to-oranges (different pipelines, different output shapes).
Questions
- How exactly is the dependency graph built and ordered? Static analysis, LLM, or both? What about cycles?
- Which NLI model for conflict checks, and how do you break a draft into atomic claims? A small example would help.
- Does the ranking on the code-regen metric still hold with a stronger generator? Also, why isn’t the human docstring baseline more visible in the main results?
- Any plans for non-Python or much larger repos? How does cost/time scale?
- For the few cases that never pass verification, what do those look like? Any human checking yet?
Limitations
Yes
Final justification
I have read the author response and want to keep my decision.
Formatting concerns
No
2 comments
Rebuttal
Dear Reviewer, kK9H
Thank you for your thorough and insightful review! We greatly appreciate your recognition of our method's contributions. Your constructive critiques and suggestions are valuable and have helped us significantly strengthen the paper. We have carefully considered each of your comments and provide detailed responses below.
Responses to W1 and Q4 : Language and scale generalizability
We thank the reviewer for this valuable question. MemDocAgent satisfies generalizability along three axes, language, size, and domain, which we clarify below with existing results and additional experiments.
1. Language-agnostic: As shown in our anonymous code link, MemDocAgent's dependency parser is built on tree-sitter, which natively supports JavaScript, TypeScript, Java, C++, C, C#, PHP, and Kotlin in addition to Python. The framework can therefore generate comprehensive documentation for repositories written in languages beyond Python.
2. Stability across software size: In Appendix C.2 (Table 24), we already report a scalability analysis showing consistent performance on large repositories, including very large ones such as mingus and ydata-profiling (194+ files, 600+ components). To further demonstrate language-agnosticism and size stability, we collected additional large-scale GitHub repositories in Java and C++ during the rebuttal period and report the results below.
- Repositories:
- Java: elastic/logstash (395 files, 4,134 components)
- C++: electron/electron (835 files, 9,190 components)
[Table: Performance on other language, large-scaled repositories (backbone: Qwen3-Coder)]
| Repo | Method | Completeness | Truthfulness | Helpfulness | Time/Doc (s) |
|---|---|---|---|---|---|
| Java | DocAgent | 0.835 | 0.730 | 0.600 | 72.80 |
| Ours | 0.978 | 0.957 | 0.703 | 60.21 | |
| C++ | DocAgent | 0.820 | 0.810 | 0.550 | 69.10 |
| Ours | 0.988 | 0.930 | 0.695 | 58.39 |
These repositories are 2~4× larger in file count and 6–14× larger in component count than the largest repository used in our paper. In such large-scale settings, per-document time increases slightly due to reading dependency-related documents at the module and repository levels, yet MemDocAgent remains more efficient than the SOTA baseline DocAgent in both quality and time cost.
3. Domain generalizability: As shown in Appendix B.4 (Table 20), the 20 repositories in our evaluation span 10 distinct domains (Communication, Internet, Utilities, etc.), differing substantially in code style and repository structure. Tables 21, 22, and 23 show that MemDocAgent performs consistently well across all of these domains.
In conclusion, MemDocAgent satisfies language, size, and domain generalizability. We will explain this more clearly in the revised version.
Responses to W2 : Regarding important details in appendix
We appreciate this suggestion. Due to the page limit, several important details were placed in the appendix. In the revised version, we will move the following into the main text:
- The dependency graph construction algorithm and the NLI-based conflict-checking procedure, to be added to the method section.
- The evaluation metric details from Appendix B.1, to expand Section 5.1.
Response to W3: Fairness of Experimental Comparisons
We thank the reviewer for this comment. We would like to clarify how our comparison is designed.
- "Different pipelines" is precisely what we measure. The contribution of MemDocAgent is not a particular prompt or backbone choice, but a new pipeline design for repository-level code documentation. Prior methods such as DocAgent[1] and RepoAgent[2] likewise propose their own pipeline designs as methods, and this line of work compares different pipelines at the method level. What we measure is therefore which pipeline design produces better documentation.
- Output shapes are already compared under matched granularity. To compare fairly across output formats, Table 2b in Section 6 reports results separated by granularity. In particular, at the component level all systems generate the same unit (a single function, class, or method), enabling a directly aligned, apples-to-apples comparison. MemDocAgent leads on all three metrics under this matched setting.
- All conditions other than the pipeline are held fixed. To isolate the effect of the pipeline design, we control every other factor across all methods, (a) Backbone: the same agent models and hyperparameters, (b) Evaluation: the same evaluation framework and metric definitions, and (c) the same LLM judge model, deliberately chosen not to overlap with any backbone (line 244).
Therefore, any observed performance difference stems solely from the pipeline design, and is not driven by confounds in the model or evaluation setup.
Response to Q1: Dependency Graph Construction and Ordering
Thank you for this question. We clarify the three parts (construction, ordering, and cycles) below.
- Construction : pure static analysis, no LLM. The dependency graph is built entirely via AST-based static analysis, a standard approach in the code domain; the LLM is not involved in graph construction or ordering at all. Specifically, we traverse the abstract syntax tree (AST) of each file to collect code entities (functions, methods, classes) as nodes, and connect them with directed edges representing their relations (function calls, class inheritance, attribute access, imports). Each node stores its AST type and code context, and each edge stores the dependency relation as metadata. This procedure is given in Algorithm 1 (Appendix A.1).
- Ordering. The traversal order is computed by Algorithm 2 to jointly satisfy two constraints: (1) each unit is processed after the units it depends on; and (2) a module is processed only after all of its components, and the repository only after all modules. This guarantees that every unit is documented with all of its dependencies and child units already available.
- Cycles. Since code dependencies may contain cycles (e.g., mutual recursion, circular imports), we collapse each strongly connected component into a single super-node using Tarjan's SCC algorithm before topological ordering (Algorithm 2, line 1). This converts the graph into a DAG so that a valid order always exists, and entities within a collapsed super-node are processed together in the same traversal step. Cycles therefore never cause the ordering to fail or any unit to be skipped.
We acknowledge that compressing this into algorithms makes it harder to follow, and we will describe this step-by-step procedure more explicitly in the main text of the revised version.
Response to Q3: Stronger Generator and Human-Docstring Baseline
- The ranking across systems is preserved. We re-evaluated information sufficiency using a stronger code-generation model (Claude Sonnet). MemDocAgent remains best by a clear margin, confirming that the metric is robust to the downstream generator.
[Table: Information sufficiency with Claude Sonnet as the generator (backbone: Qwen3-Coder)]
| Method | Pass@1 | Pass@3 | CodeBLEU |
|---|---|---|---|
| No docs | 0.180 | 0.205 | 0.270 |
| Ground-truth | 0.221 | 0.353 | 0.298 |
| Prompting | 0.262 | 0.345 | 0.347 |
| RepoAgent | 0.352 | 0.390 | 0.325 |
| DocAgent | 0.305 | 0.355 | 0.308 |
| Ours (C+M+R) | 0.573 | 0.608 | 0.501 |
- The human docstring (Ground-truth) baseline was placed in the appendix rather than the main table due to the page limit during writing, and we agree that in Figure 3 this reference is not visually distinct. In the revised version, we will (1) add the human-docstring baseline values to the main table, and (2) render it with a dashed line and a separate label in Figure 3, clearly marking it as our reference baseline.
Response to Q5: Analysis of Verification-Failure Cases
We thank the reviewer for this important question. We manually inspected 29 cases that never passed verification. As a result, None of them contain critical factual errors that could mislead a user. The 29 cases mostly fall into two mechanisms.
Case 1 : Unresolved cross-component NLI conflict (18/29)
The document is factually correct, but a phrasing mismatch with a neighboring component's document keeps the cross-NLI conflict score high enough to block the final score.
Case 2 — Self-consistency score plateaus just below threshold (11/29)
The document is correct, but the self-evaluation score creeps up without quite reaching 0.90 before the revision budget is exhausted.
Across all 29 cases, no failure stems from a misleading factual error. The common cause is that the strict 0.90 threshold rejects documents whose cross-NLI penalty or helpfulness sub-score falls marginally short. This is also why such documents are never used as trusted references for downstream verification (Appendix A.3, Step 1), so they cannot propagate errors even when committed for coverage. We will add this failure-case analysis to the revised version with clear explanations.
References
[1] DocAgent: An Agentic Framework for Multi-Modal Long-Context Document Understanding (Sun et al., EMNLP 2025)
[2] Repoagent: An llm-powered open-source framework for repository-level code documentation generation. (Luo, Qinyu, et al., EMNLP 2024)
Our final comments :
We have conducted and presented all additional experiments and analyses about all weaknesses and reviewer’s questions. We believe that most of the raised concerns have been adequately addressed. If there are still concerns that need to be addressed, please let us know, and we would be glad to provide further clarification or additional analysis.
Dear Reviewer kK9H,
As the discussion period is nearing its end, we wanted to kindly follow up on our responses to your comments. We have addressed each of your points with additional experiments and clarifications, and we would be grateful to know whether they resolve your concerns. If any point remains unclear or if further analysis would be helpful, we are happy to provide it during the remaining discussion period.
Thank you again for your time and thoughtful review.
Best regards, Authors
From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.
Loading the discussion…
Dear Area Chair,
We thank you for the clear and constructive feedback. We would like to highlight that, during the discussion period, we addressed each of the concerns raised in the meta-review, and most reviewers explicitly confirmed that their concerns were resolved and raised their overall scores.
Conceptual novelty (mH8C) : We clarified that our contribution is the reformulation of repository documentation as generating mutually-consistent outputs over one cumulative trajectory, together with the memory design this requires (structured schema + verification-gated references + dependency-hierarchy traversal). We added (i) a comparison against a generic vector-memory baseline, confirming the gain stems from the documentation-specific design rather than memory in general, and (ii) a shuffled-order ablation showing the traversal forms a cumulative context, distinguishing our setting from mere long sequential processing.
Verification–evaluation entanglement and circularity (8jeK, mH8C) : We clarified that the Figure 1 inconsistency rate is computed post-hoc by a separate LLM-judge, independent of the internal VERIFY (DeBERTa NLI), differing in timing, target, and tool. We further clarified that Section Presence is a sanity check rather than a ranking metric, and that Helpfulness adopts DocAgent's protocol unchanged.
Statistical significance and uncertainty (8jeK, mH8C): We added paired Wilcoxon signed-rank tests across 20 repositories (p < 0.001 against every baseline on all three metrics) and multi-seed re-runs (std ≤ 0.023), confirming the improvements are significant and stable.
Scope-matched comparison (mH8C, kK9H): Beyond the granularity-separated results already in Table 2b, we added a template-matched control where all baselines use the same output format; MemDocAgent still leads on all three metrics, confirming the gain comes from the memory and verification mechanisms, not the task formulation or format.
Metric validity and error propagation (mH8C, kK9H, Dp3t): A length-controlled analysis and evaluation across three different generators show the information-sufficiency ranking reflects documentation quality, not length or a particular generator. For error propagation, below-threshold documents are excluded from trusted references (only score > 0.9 documents are used), and manual inspection of all 29 never-passing cases found no critical factual errors.
Scalability (mH8C, kK9H): We added large-scale, non-Python experiments (Java and C++, up to 9,190 components), where MemDocAgent outperforms DocAgent in both quality and time.
We believe these additions directly satisfy each condition raised in the meta-review, and we are glad to provide any further analysis during the remaining period.
Best regards, The Authors