AdaptAgent: A Multi-agent, Domain-Guided Reasoning Framework for Code Adaptation
Xiaokai Rong, Hridya Dhulipala, Aashish Yadavally, Tien N. Nguyen
The University of Texas at Dallas · University of Central Florida
Key points
From the paper's conclusion- AdaptAgent is a multi-agent, domain-guided reasoning framework for code adaptation, decomposing adaptation into specialized agents that communicate via typed artifacts.
- The framework enables robust, policy-aligned adaptations and supports adapting code snippets into a project, outperforming strong baselines in semantic correctness.
- Ablation study shows each agent’s necessity, especially planning for code-hardening and exception-handling, and intent for logic customization.
Abstract
Developers often need to adapt into their projects the code generated from LLMs or code snippets from online forums. However, integrating them into an existing repository remains challenging in a manual process. A successful integration typically requires more than copying code as a user must produce correct adapting changes at a designated location in the target repository. We formalize this as the code adaptation problem: given a snippet, functional intent, a target repository, and an adaptation location, generate a patch that adapts the snippet into the repository. We present AdaptAgent, a multi-agent, domain-guided reasoning framework for code adaptation. Rather than relying on single-shot prompting, AdaptAgent decomposes adaptation into specialized agents that communicate via typed artifacts: an Intent Summarizer extracts adaptation goals from Q&A text; a Policy Agent derives domain policies from six adaptation categories; a Domain Planner generates a self-ordered plan; a Context Miner distills sibling-method semantics from the target codebase; and a Code Adapter realizes the plan as a minimal unified diff, iteratively refined using a compiler-based Verifier. This division of labor enables robust, policy-aligned adaptations and supports adapting code snippets into a project. On a real-world dataset, AdaptAgent outperforms strong baselines in semantic correctness and produces patches that mirror developers’ actual adaptation patterns. Our ablation study shows each agent’s necessity, especially planning for code-hardening and exception-handling, and intent for logic customization.
Read the paper
Discussion · 1
Science Skim's AI key points, plus readers' public thoughts
- AdaptAgent is a multi-agent, domain-guided reasoning framework for code adaptation, decomposing adaptation into specialized agents that communicate via typed artifacts.
- The framework enables robust, policy-aligned adaptations and supports adapting code snippets into a project, outperforming strong baselines in semantic correctness.
- Ablation study shows each agent’s necessity, especially planning for code-hardening and exception-handling, and intent for logic customization.
Readers' thoughts
No reader thoughts yet.
Related papers
- How Much Static Structure Do Code Agents Need? A Study of Deterministic AnchoringProceedings of the ACM on software engineering. · 2026
- CodeMeepo: A Multi-Agent Workflow for Repository-Level Code Migration and OptimizationarXiv · 2026
- How Should Agents See Code? Rethinking Code Representations for Agentic Software EngineeringarXiv · 2026
- Agentic Much? Adoption of Coding Agents on GitHubACM Transactions on Software Engineering and Methodology · 2026
- LoLBench: Evaluating Coding Agents with Long-Horizon Proposals on Large Software SystemsarXiv · 2026
- ADAPT: Agentic Diff-Aware Patch Testing for Pull RequestsarXiv · 2026