AgentFactory: A Self-Evolving Framework Through Executable Subagent Accumulation and Reuse

📅 2026-03-18
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work proposes a novel self-evolution framework for large language model (LLM) agents that addresses the limitations of existing approaches, which rely on textual experience logs that are difficult to reliably reuse and efficiently execute in complex tasks. Instead of storing experiences as natural language, the proposed method preserves successful solutions as executable Python sub-agents. These sub-agents are continuously refined through execution feedback, enabling automatic capability accumulation and cross-system reuse. By leveraging executable code as the medium of experience—combined with modular design and standardized interfaces—the framework constructs an evolving library of sub-agents that improves over time. This paradigm significantly reduces the computational and cognitive overhead for handling similar tasks. The implementation has been open-sourced to facilitate further research and adoption.

Technology Category

Application Category

📝 Abstract
Building LLM-based agents has become increasingly important. Recent works on LLM-based agent self-evolution primarily record successful experiences as textual prompts or reflections, which cannot reliably guarantee efficient task re-execution in complex scenarios. We propose AgentFactory, a new self-evolution paradigm that preserves successful task solutions as executable subagent code rather than textual experience. Crucially, these subagents are continuously refined based on execution feedback, becoming increasingly robust and efficient as more tasks are encountered. Saved subagents are pure Python code with standardized documentation, enabling portability across any Python-capable system. We demonstrate that AgentFactory enables continuous capability accumulation: its library of executable subagents grows and improves over time, progressively reducing the effort required for similar tasks without manual intervention. Our implementation is open-sourced at https://github.com/zzatpku/AgentFactory, and our demonstration video is available at https://youtu.be/iKSsuAXJHW0.
Problem

Research questions and friction points this paper is trying to address.

LLM-based agents
self-evolution
executable subagents
task re-execution
complex scenarios
Innovation

Methods, ideas, or system contributions that make the work stand out.

executable subagents
self-evolution
LLM-based agents
code reuse
capability accumulation
Z
Zhang Zhang
Peking University, Beijing Academy of Artificial Intelligence
S
Shuqi Lu
Beijing Academy of Artificial Intelligence
Hongjin Qian
Hongjin Qian
Peking University
LLMIRNLP
Di He
Di He
Peking University
Machine Learning
Z
Zheng Liu
Hong Kong Polytechnic University, Beijing Academy of Artificial Intelligence