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

Abstract

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.

Introduction: The "Closed-World" Limitation

When a human developer encounters a cryptic bug, they rarely start from a blank slate. They search GitHub issues, StackOverflow, and internal documentation to see how others solved similar problems. In contrast, most autonomous software engineering (SWE) agents operate in a "closed world"—they attempt to fix bugs using only the local code context and their internal training.

The challenge isn't a lack of data; GitHub is a goldmine of human experience. However, raw GitHub data is "noisy," filled with social chatter, irrelevant logs, and inconsistent terminology. Standard Retrieval-Augmented Generation (RAG) often fails in this domain because agents suffer from "semantic drift," getting distracted by surface-level keywords while missing the underlying logic.

Methods: Governing Experience

MemGovern introduces a plug-and-play architecture that turns raw GitHub history into an "experience infrastructure" for agents, moving beyond the limitations of existing trajectory-based methods.

Comparison between existing methods and the MemGovern framework.

The framework consists of two main components:

1. Experience Governance

This is a three-stage pipeline designed to clean and structure data:

  • Hierarchical Selection: Filters for high-quality, active repositories and "closed-loop" instances where an issue, a pull request, and a successful patch are all linked.
  • Standardization: An LLM distills the raw thread into a two-layered Experience Card. The Index Layer contains searchable symptoms (error types, signals), while the Resolution Layer contains the "why" and "how" (root cause analysis and abstract fix strategy).
  • Quality Control: A checklist-based evaluator ensures the cards are accurate, using a "Refine Loop" to regenerate any deficient sections.

Instead of just injecting the top search results into the agent's context, MemGovern allows the agent to act like a researcher. The agent uses a Searching tool to find candidate cards and then a Browsing tool to selectively read the detailed resolution logic of the most promising ones. This prevents the agent from being overwhelmed by irrelevant details and mimics the iterative hypothesis-testing process used by human engineers.

Key Results

The framework was evaluated using a collection of 135,000 governed experience cards on the SWE-bench Verified benchmark, a high-quality subset of 500 real-world GitHub issues.

Performance comparison of MemGovern vs. SWE-Agent baseline across multiple LLM backbones.

MemGovern was tested across seven different LLM backbones and consistently outperformed the base frameworks:

  • Performance Boost: Improved resolution rates by an average of 4.65%.
  • Model Agnostic: The gains were particularly high for models like GPT-4o (+9.4%) and Qwen3-235B (+8.2%).
  • Efficiency: Agents using MemGovern spent less time on "unguided exploration" and more time on successful "Code Execution," leading to more reliable fixes.
  • Qualitative Success: Case studies showed that MemGovern-equipped agents avoided superficial "defensive bypasses" and instead implemented semantically correct logic based on historical precedents.

Conclusion and Future Work

MemGovern demonstrates that "governance" is key to making large-scale human experience actionable for AI agents. By decoupling symptoms from logic, it enables better analogical transfer. While the current "search-then-browse" process increases token overhead, future work will explore strategies for compressing experience cards and developing a "living" memory that updates dynamically as the agent solves new problems.

Summary updated

BibTeX
@misc{wang2026memgovern,
  author = {Qihao Wang and Ziming Cheng and Shuo Zhang and Fan Liu and Rui Xu and Heng Lian and Kunyi Wang and Xiaoming Yu and Jianghao Yin and Sen Hu and Yue Hu and Shaolei Zhang and Yanbing Liu and Ronghao Chen and Huacan Wang},
  title = {{MemGovern: Enhancing Code Agents through Learning from Governed Human Experiences}},
  year = {2026},
  eprint = {2601.06789},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2601.06789},
}
Figure