[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-81654-en":3,"doc-seo-81654-105":30,"detail-sidebar-cat-0-en-105":91},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":20,"is_deleted":4,"is_public":21,"is_downloadable":21,"audit_status":21,"page_count":22,"language":23,"language_code":24,"site_id":25,"html_lang":24,"table_of_contents":26,"faqs":27,"seo_title":13,"seo_description":14,"update_tm":28,"read_time":29},81654,16904993612988,"Olivia Brown","https://ap-avatar.wpscdn.com/davatar_a8503ba1806abce46bf441b54a3ca4cd",8,"Research & Report","Remember Your Trace Memory-Guided Long-Horizon Agentic Framework for Consistent and Hierarchical Repository-Level Code Documentation","Automated code documentation is essential for modern software development, offering contextual grounding for both human developers and coding agents navigating large repositories. Existing repository-level methods document components independently, causing redundant retrieval and conflicting descriptions while failing to provide hierarchical structure. MemDocAgent is proposed as a long-horizon agentic framework that generates documentation in a single integrated repository context, combining dependency-aware traversal guidance with memory-guided interactions via RepoMemory to reuse, verify, and reconcile prior traces.","arXiv :2605 . 14563v2 [ cs . SE] 10 Jul 2026  \nRemember Your Trace: Memory-Guided Long-Horizon Agentic Framework for Consistent and Hierarchical Repository-Level Code Documentation  \nSuyoung Bae1 , Jaehoon Lee1 , Changkyu Choi2 YunSeok Choi1 Jee-Hyong Lee1 ∗  \n1 Sungkyunkwan University, South Korea  \n2 University of Oslo, Norway  \nAbstract  \nAutomated 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. 2  \n1 Introduction  \nRepository-level documentation requires understanding over an entire codebase to generate coherent natural-language descriptions that span individual function behaviors, dependency structures, and overall architectural patterns [1–3] . As software repositories scale in size and complexity, such documentation serves as a critical interface for both human developers and coding agents, providing the contextual grounding needed for code navigation and collaboration [4–6] . Manual writing at this scale is prohibitively expensive, motivating a new line of work on automating repository-level documentation [7–12] .  \nAutomating this task is inherently a long-horizon: each document depends not only on the local code being summarized, but also on information retrieved, interpreted, and written in earlier documentation steps. However, existing repository-level documentation systems, ranging from open-source frameworks [1–3] to closed-source products [13, 14], decompose a repository into components and document each component independently, treating each as a self-contained task without shared state across the repository. As a result, the same source files are repeatedly retrieved across iterations, with an average overlap of 50% across existing systems as shown in Figure 1 . More critically, prior documentation outputs are not reused across iterations, leaving the system unable to detect dependency conflicts. This leads to contradictory descriptions of the same entity or architectural logic across documents, resulting in an average cross-document inconsistency rate of 13% across existing systems (as shown in Figure 1) .  \n∗Corresponding authors  \n2 Code and Data are available at [https://github.com/bsy99615/MemDocAgent](https://github.com/bsy99615/MemDocAgent).  \nPreprint.  \nFigure 1: Limitations in existing documentation systems. While existing systems suffer from substantial repeated source-file retrieval and cross-document inconsistencies, MemDocAgent eliminates repeated retrieval and reduces inconsistency by 75.5% . N/A denotes closed-source systems for which repeated source-file retrieval cannot be measured because their internal pipelines are inaccessible.  \nBeyond these procedural limitations, existing methods lack hierarchical structure in their documentation outputs. High-quality repository documentation should provide a multi-level view of a codebase, connecting fine-grained component behavior, module-level responsibilities, and repository-wide architectural design into a coherent whole","cbCainj4s0MAuP05","https://ap.wps.com/l/cbCainj4s0MAuP05","pdf",1657071,4,1,44,"English","en",105,"# Introduction\n## Problem with existing repository-level documentation\n## Proposed solution: MemDocAgent\n## Core components","[{\"question\":\"What limitations do existing repository-level documentation systems have?\",\"answer\":\"They often process repository components independently, leading to repeated retrieval of the same files and cross-document inconsistency, and they typically produce outputs without hierarchical structure spanning multiple levels of the codebase.\"},{\"question\":\"How does MemDocAgent improve consistency and reduce redundancy?\",\"answer\":\"MemDocAgent generates documentation within a single integrated context for the entire repository and reuses prior work traces through RepoMemory, which reduces repeated retrieval and significantly lowers inconsistency.\"},{\"question\":\"What are the two core components of MemDocAgent?\",\"answer\":\"It uses Dependency-Aware Traversal Guiding to set a traversal order that respects dependency and granularity hierarchies, and Memory-Guided Agentic Interaction where the agent reads, writes, and verifies information in RepoMemory during the long-horizon process.\"}]",1784175189,111,{"code":4,"msg":31,"data":32},"ok",{"site_id":25,"language":24,"slug":33,"title":13,"keywords":34,"description":14,"schema_data":35,"social_meta":86,"head_meta":88,"extra_data":90,"updated_unix":28},"remember-your-trace-memory-guided-long-horizon-agentic-framework-for-consistent-and-hierarchical-repository-level-code-documentation","",{"@graph":36,"@context":85},[37,53,68],{"@type":38,"itemListElement":39},"BreadcrumbList",[40,44,48,51],{"item":41,"name":42,"@type":43,"position":21},"https://docshare.wps.com","Home","ListItem",{"item":45,"name":46,"@type":43,"position":47},"https://docshare.wps.com/document/","Document",2,{"item":49,"name":12,"@type":43,"position":50},"https://docshare.wps.com/document/research-report/",3,{"item":52,"name":13,"@type":43,"position":20},"https://docshare.wps.com/document/remember-your-trace-memory-guided-long-horizon-agentic-framework-for-consistent-and-hierarchical-repository-level-code-documentation/81654/",{"url":52,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":24,"description":14,"dateModified":61,"datePublished":62,"encodingFormat":60,"isAccessibleForFree":63,"interactionStatistic":64},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":41,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-07-25","2026-07-16",true,{"@type":65,"interactionType":66,"userInteractionCount":20},"InteractionCounter",{"@type":67},"ViewAction",{"@type":69,"mainEntity":70},"FAQPage",[71,77,81],{"name":72,"@type":73,"acceptedAnswer":74},"What limitations do existing repository-level documentation systems have?","Question",{"text":75,"@type":76},"They often process repository components independently, leading to repeated retrieval of the same files and cross-document inconsistency, and they typically produce outputs without hierarchical structure spanning multiple levels of the codebase.","Answer",{"name":78,"@type":73,"acceptedAnswer":79},"How does MemDocAgent improve consistency and reduce redundancy?",{"text":80,"@type":76},"MemDocAgent generates documentation within a single integrated context for the entire repository and reuses prior work traces through RepoMemory, which reduces repeated retrieval and significantly lowers inconsistency.",{"name":82,"@type":73,"acceptedAnswer":83},"What are the two core components of MemDocAgent?",{"text":84,"@type":76},"It uses Dependency-Aware Traversal Guiding to set a traversal order that respects dependency and granularity hierarchies, and Memory-Guided Agentic Interaction where the agent reads, writes, and verifies information in RepoMemory during the long-horizon process.","https://schema.org",{"og:url":52,"og:type":87,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":89,"canonical":52},"index,follow",{"doc_id":7,"site_id":25},{"code":4,"msg":5,"data":92},[93,97,101,105,110,115,120,123,128,131,135],{"id":21,"doc_module":4,"doc_module_name":46,"category_name":94,"show_sort_weight":95,"slug":96},"Story & Novel",90,"story-novel",{"id":47,"doc_module":4,"doc_module_name":46,"category_name":98,"show_sort_weight":99,"slug":100},"Literature",80,"literature",{"id":20,"doc_module":4,"doc_module_name":46,"category_name":102,"show_sort_weight":103,"slug":104},"Exam",70,"exam",{"id":106,"doc_module":4,"doc_module_name":46,"category_name":107,"show_sort_weight":108,"slug":109},5,"Comic",60,"comic",{"id":111,"doc_module":4,"doc_module_name":46,"category_name":112,"show_sort_weight":113,"slug":114},6,"Technology",50,"technology",{"id":116,"doc_module":4,"doc_module_name":46,"category_name":117,"show_sort_weight":118,"slug":119},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":46,"category_name":12,"show_sort_weight":121,"slug":122},30,"research-report",{"id":124,"doc_module":4,"doc_module_name":46,"category_name":125,"show_sort_weight":126,"slug":127},9,"Religion & Spirituality",20,"religion-spirituality",{"id":126,"doc_module":4,"doc_module_name":46,"category_name":129,"show_sort_weight":126,"slug":130},"World Cup","world-cup",{"id":132,"doc_module":4,"doc_module_name":46,"category_name":133,"show_sort_weight":132,"slug":134},10,"Lifestyle","lifestyle",{"id":136,"doc_module":4,"doc_module_name":46,"category_name":137,"show_sort_weight":106,"slug":138},19,"General","general"]