Long-horizon code generation requires sustained context and adaptive expertise across domains. Current multi-agent systems use static workflows that cannot adapt when runtime analysis reveals unanticipated complexity. We propose AgentSpawn, an architecture enabling dynamic agent collaboration through: (1) automatic memory transfer during spawning, (2) adaptive spawning policies triggered by runtime complexity metrics, and (3) coherence protocols for concurrent modifications. AgentSpawn addresses five critical gaps in existing research around memory continuity, skill inheritance, task resumption, runtime spawning, and concurrent coherence. Experimental validation demonstrates AgentSpawn achieves 34% higher completion rates than static baselines on benchmarks like SWE-bench while reducing memory overhead by 42% through selective slicing.
翻译:长周期代码生成需要跨领域的持续上下文和自适应专业知识。当前多智能体系统采用静态工作流,在运行时分析揭示意外复杂性时无法动态调整。我们提出AgentSpawn架构,通过以下机制实现动态智能体协作:(1) 生成过程中的自动记忆迁移,(2) 由运行时复杂度指标触发的自适应生成策略,(3) 并发修改的一致性协议。AgentSpawn解决了现有研究中关于记忆连续性、技能继承、任务恢复、运行时生成和并发一致性的五个关键缺陷。实验验证表明,在SWE-bench等基准测试中,AgentSpawn的代码完成率比静态基线系统提高34%,同时通过选择性切片将内存开销降低42%。