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.
翻译:构建基于大语言模型的智能体日益重要。现有关于LLM智能体自我演化的研究主要将成功经验记录为文本提示或反思,但这在复杂场景中无法可靠地保证任务的高效重复执行。我们提出AgentFactory这一新型自我演化范式,它将成功的任务解决方案保存为可执行的子智能体代码而非文本经验。关键在于,这些子智能体基于执行反馈持续优化,随着处理任务数量的增加而愈发鲁棒和高效。保存的子智能体是带有标准化文档的纯Python代码,可移植至任何支持Python的系统。我们证明AgentFactory实现了能力的持续积累:其可执行子智能体库随时间增长和进化,逐步减少同类任务所需的工作量,而无需人工干预。我们的实现已开源至https://github.com/zzatpku/AgentFactory,演示视频见https://youtu.be/iKSsuAXJHW0。