Source-linked AI summary
MemGovern: Enhancing Code Agents through Learning from Governed Human Experiences
Qihao Wang, Ziming Cheng, Shuo Zhang, Fan Liu, Rui Xu, Heng Lian, Kunyi Wang, Xiaoming Yu, Jianghao Yin, Sen Hu, Yue Hu, Shaolei Zhang, Yanbing Liu, Ronghao Chen, Huacan Wang
TL;DR
Code agents struggle to use GitHub’s fragmented, heterogeneous debugging history as retrievable knowledge. MemGovern governs this experience into structured cards and supports logic-driven search, improving SWE-bench bug-resolution rates by 4.65%.
Problem
GitHub contains valuable debugging experience, but its unstructured, fragmented, noisy, and heterogeneous records lack effective governance for agent retrieval.
Method
MemGovern curates cross-repository GitHub experience into standardized experience cards and enables multi-round agentic search over retrieval signals and repair logic.
Results
4.65% average improvement in real-world bug resolution on SWE-bench was achieved using 135k governed experience cards.
Takeaways & Limitations
MemGovern provides a plug-and-play experience infrastructure that can be integrated into existing code-agent scaffolds with minimal modifications.
Abstract
from arXiv · showhide
While autonomous software engineering (SWE) agents are reshaping programming paradigms, they currently suffer from a "closed-world" limitation: they attempt to fix bugs from scratch or solely using local context, ignoring the immense historical human experience available on platforms like GitHub. Accessing this open-world experience is hindered by the unstructured and fragmented nature of real-world issue-tracking data. In this paper, we introduce MemGovern, a framework designed to govern and transform raw GitHub data into actionable experiential memory for agents. MemGovern employs experience governance to convert human experience into agent-friendly experience cards and introduces an agentic experience search strategy that enables logic-driven retrieval of human expertise. By producing 135K governed experience cards, MemGovern achieves a significant performance boost, improving resolution rates on the SWE-bench Verified by 4.65%. As a plug-in approach, MemGovern provides a solution for agent-friendly memory infrastructure.
1 Introduction
Code agents are reshaping programming, yet effective bug fixing requires exploiting the expert reasoning and repair patterns embedded in GitHub’s historical records. MemGovern addresses the challenge by governing fragmented repair data into agent-friendly memory and enabling logic-driven, iterative experience search.
- Motivation: GitHub records encode expert debugging reasoning and repair patterns that developers commonly consult when addressing complex software issues.Real-world engineers typically examine how similar problems were solved instead of fixing every bug from scratch.
- Challenges: Raw GitHub issue and pull-request discussions obscure technical insights through unstructured social and procedural content, while cross-project variation hinders standardized knowledge.The obstacles include differences in terminology, module organization, and coding styles.
- MemGovern: MemGovern transforms disorganized GitHub repair records into structured, agent-friendly experiential memory that provides code agents with an experience infrastructure.The framework introduces experience governance to make human experience efficiently exploitable by agents.
- Agentic experience search: MemGovern’s agentic experience search uses multiple rounds of searching and browsing to identify underlying repair logic rather than relying only on shallow semantic matching.This interaction is designed to mirror how human engineers explore prior cases.
- Integration: As a plug-and-play module, MemGovern can integrate into existing agent scaffolds with minimal modifications.Its experiential memory is intended to support agents without requiring a wholly new scaffold.
2 Related Work
Prior work has advanced code agents and structured agent memory, but existing approaches leave limitations in the quality, standardization, and actionability of learned experience. MemGovern addresses these limitations by governing large-scale, cross-repository GitHub experiences through curation, purification, and separated retrieval and repair signals.
- Memory Construction for Agents: Prior agent-memory methods organized experience structurally, including ExpeRepair’s dual memory banks and SWE-Exp’s extraction of experience.Earlier commit- and patch-mining approaches captured only syntactic transformations, motivating richer experience organization.
- Code Agents: Code-agent research developed specialized interfaces, improved fault localization, and lower-cost pipelines, with SWE-agent, AutoCodeRover, and Agentless representing these directions.SWE-agent pioneered Agent-Computer Interfaces, AutoCodeRover used syntax-tree and spectrum-based techniques, and Agentless showed simpler pipelines can match agent performance at lower cost.
- Memory Construction for Agents: MemGovern introduces multi-stage curation, content purification, and a dual-layer protocol to transform noisy, heterogeneous GitHub issue discussions into actionable repair knowledge.The protocol separates retrieval signals from actionable repair logic and supports learning from collective debugging knowledge across repositories.
3 MemGovern
MemGovern transforms noisy GitHub debugging records into governed, agent-friendly experience cards and supports their reuse through adaptive agentic search. Its pipeline combines quality-controlled data selection, semantic separation of retrieval and repair knowledge, and staged experience access.
- Framework Overview: MemGovern transforms raw GitHub experiences into standardized experience cards and enables agents to use them through experience governance and agentic experience search.The framework addresses unstructured human experience by first governing it into memory and then supporting its retrieval and use.
- Experience Governance: A two-tiered selection strategy combines repository authority with instance completeness to reduce memory pollution from low-signal data.Repositories are selected using popularity and maintenance activity, while instances require linked issues, merged code, parsable diffs, diagnostic anchors, and technical-content ratio τ = 0.2.
- Experience Representation: Each experience card separates symptom-based retrieval from transferable repair reasoning through an Index Layer and a Resolution Layer.The Index Layer contains normalized problem summaries and diagnostic signals without repository-specific details, while the Resolution Layer stores root causes, abstract fix strategies, and patch digests for cross-repository reuse.
- Quality Control: A checklist-based evaluator uses targeted feedback and up to three refinement iterations to reject or regenerate deficient experience-card sections before ingestion.The quality-control gate addresses hallucinated or missing details by scoring cards across critical dimensions and refining only problematic sections when aggregate quality falls below γ.
- Agentic Experience Search: MemGovern’s agentic search combines ranked symptom-level Searching with detailed Browsing, allowing agents to discover relevant cases before inspecting reusable repair blueprints.Searching matches queries against Index Layers, while Browsing exposes the selected card’s Resolution Layer; the mechanism adapts these actions to the evolving debugging state rather than following a rigid pipeline.
4 Experiments
MemGovern is evaluated on SWE-bench Verified against SWE-Agent and strong baselines, with main results showing consistent improvements across seven LLMs. The experiments also establish a 135K-card memory collection and integrate experience search and browsing into SWE-Agent.
- Evaluation Setup: The evaluation compares MemGovern with SWE-Agent and several strong baselines on SWE-bench Verified.Detailed benchmark and baseline descriptions are provided in Appendix A.
- Experience Collection: After cleaning approximately 150K GitHub Issue–PR–Patch triplets, the governance pipeline produces 135K de-duplicated experience cards.The source repositories were active, well-maintained, open-source projects with more than 100 stars.
- Agent Integration: MemGovern adds Experience Search and Experience Browse tools to SWE-Agent’s default toolset alongside code editing and patch submission.Experience Search returns up to a configurable top-k number of experience-card previews, defaulting to 10 to balance context length and information gain.
- Main Results: MemGovern consistently outperforms SWE-Agent across all seven evaluated LLMs on SWE-bench Verified, with especially pronounced gains for weaker models.The results indicate robust, model-agnostic improvements while stronger models also benefit.
5 Analysis
MemGovern’s analysis attributes its gains to governed experiential memory and agentic search, showing that representation quality, search strategy, retrieval breadth, and repository selection materially affect performance. Behavioral analyses further indicate that experience reduces unguided exploration, promotes self-testing, and enables semantically correct repairs.
- Experiential Memory Size: MemGovern evaluates 10%-100% of its 135K-card experiential memory to test whether broader governed-human-experience coverage drives performance gains.The analysis varies experiential memory size as an ablation of governed experience coverage.
- Experiential Memory Quality: Comparing governed experience with raw historical data tests whether MemGovern’s gains arise from reliable, agent-friendly representations rather than unprocessed experience alone.Experience Standardization and Quality Control are designed to ensure that the memory is large, reliable, and agent-friendly.
- Agentic Experience Search: Agentic Search consistently outperforms static and adaptive RAG across DeepSeek-V3.1-Terminus, Qwen3-Coder-30B, and GPT-4o by strategically managing search depth and breadth.The mechanism decouples broad candidate discovery from selective evidence grounding and logic extraction, enabling structured reasoning over multiple experiences.
- Agentic Experience Search: Increasing retrieval Top-K improves performance when K is small, but gains diminish and eventually plateau beyond a moderate candidate-pool size.The pattern reflects a shift from retrieval coverage being limiting at small K to diminishing returns at larger K.
- Agent Behavior: MemGovern reduces Info Gathering from 15.0% to 11.3% while encouraging more effective editing–execution behavior and self-testing.The baseline spends 40.9% on Code Editing and 19.6% on Code Execution; raw experience raises Code Execution to 35.4% because unrefined context adds verification overhead and noise.
- Qualitative Case Study: In a Django order_by() crash case, the baseline applies a defensive bypass that violates the function’s return contract, whereas MemGovern uses a governed experience card to implement a semantically aware fix.The retrieved card’s Root Cause and Fix Strategy guide explicit type checking and field-name extraction instead of returning the raw object.
6 Conclusion
MemGovern governs raw GitHub data into agent-friendly experiential memory and provides an agentic experience search method as memory infrastructure for software agents. It constructs 135k experience cards and improves SWE-bench resolution rates by 4.65%.
- 6 Conclusion: MemGovern governs raw GitHub data into agent-friendly experiential memory for software agents.
- 6 Conclusion: Its agentic experience search method provides corresponding memory infrastructure for agents.
- 6 Conclusion: 135k experience cards improve SWE-bench resolution rates by 4.65%.
Limitations
MemGovern improves agent performance by learning from human experiences, but its memory searches generate additional tokens during execution in exchange for higher resolution rates.
- Limitations: MemGovern’s memory search adds token-processing overhead during agent execution, trading higher resolution rates for additional generated tokens.The framework achieves an average 4.65% improvement in resolution rates compared to SWE-Agent.
A Experimental Setup
MemGovern is evaluated on SWE-bench Verified, a controlled benchmark of 500 real-world GitHub issues assessed through developer-written unit tests. The evaluation compares it with SWE-Agent and several strong baselines across multiple open and proprietary LLM backbones.
- Benchmark: SWE-bench Verified contains 500 real-world GitHub issues focused on functional bug fixing in a controlled, self-contained setup.Each instance provides only the natural-language issue description and corresponding repository.
- Benchmark: Correctness is assessed by running developer-written unit tests against each generated patch, providing a consistent evaluation of automated bug-fixing performance.
- Baselines: MemGovern is compared with SWE-Agent, AppMap Navie, AutoCodeRover, CodeAct, and SWESynInfer.The baselines include SWE-Agent (Yang et al., 2024c), AppMap Navie, AutoCodeRover (Zhang et al., 2024), CodeAct (Lv et al., 2024), and SWESynInfer (Ma et al., 2024).
- Baselines: The comparison spans multiple LLM backbones covering both open and proprietary paradigms.The passage specifies evaluation with leading open-source models, including DeepSeek-V3.1-Terminus, Qwen3-Coder-30B, and Kimi-K2-.
B Additional Case Study Analysis
This section presents two additional comparisons of MemGovern, examining agentic search versus static retrieval and the necessity of experience governance. These comparisons highlight different aspects of MemGovern’s performance.
- B Additional Case Study Analysis: The additional case study compares agentic search with static retrieval to assess their relative performance.
- B Additional Case Study Analysis: A separate comparison examines the necessity of experience governance within MemGovern.
- B Additional Case Study Analysis: Together, these comparisons highlight distinct aspects of MemGovern’s performance.
B.1 Superiority of Agentic Experience Search
MemGovern’s Agentic Search outperforms standard RAG by using a Search-then-Browse workflow that inspects retrieved logic, filters semantic drift, and identifies technically relevant fixes for the Django issue.
- Comparison: Figure 9 contrasts MemGovern’s Agentic Search with standard RAG on a Django issue where number_format renders small decimals in scientific notation.The comparison illustrates how agentic search addresses semantic drift in retrieved experiences.
- Standard RAG: Standard RAG performs one retrieval and injects all experiences into context, allowing surface-similar but technically irrelevant cases to misdirect the repair.For the query “django numberformat decimal_pos,” retrieval returns frontend CSS-alignment and locale-separator experiences, leading the agent toward an aggressive mutation.
- Agentic Search (MemGovern): MemGovern identifies the relevant “scientific notation cutoff” case and transfers its threshold-check logic to produce a precise fix without side effects.The Search-then-Browse workflow retrieves candidates, inspects their logic, and rejects irrelevant frontend issues.
B.2 Necessity of Experience Governance · C Experience Card Schema
MemGovern’s experience governance removes noise from raw GitHub records and converts them into actionable memory, enabling agents to apply the correct repair logic. Its Experience Card Schema is presented as the structure underlying this governed memory.
- B.2 Necessity of Experience Governance: Raw PR+Patch records overwhelm the agent with unrelated diffs and commentary, causing it to misclassify a memoryview edge case as a generic iterable problem.The retrieved noise includes extraneous information about BaseHandler and make_bytes.
- B.2 Necessity of Experience Governance: Governed experience cards strip away noise through Content Purification and highlight the repair strategy: “Handle memoryview and bytearray objects.”This lets the agent focus on the core logic rather than unrelated changes in the original pull request.
- B.2 Necessity of Experience Governance: MemGovern’s agentic search locates specific backend logic for scientific-notation thresholds, while standard RAG retrieves irrelevant frontend-formatting experiences based on surface similarity.Figure 9 contrasts the two retrieval behaviors.
- B.2 Necessity of Experience Governance: MemGovern correctly converts both memoryview and bytearray objects to raw bytes, whereas raw PR+Patch records produce an incomplete patch that mishandles bytearray.The governed representation isolates the core repair logic and ensures correct serialization.
- B.2 Necessity of Experience Governance: Experience governance is therefore essential for transforming noisy open-source data into actionable, agent-friendly memory.The conclusion follows from the contrasting raw and governed repair behavior.
- C Experience Card Schema: The Experience Card Schema provides the documented structure for MemGovern’s governed experience representation.The paper describes this schema in Figure 11.