The Autonomy Review

Your Agent Learns by Writing Code Now, and Congress Just Drafted the First Federal AI Bill

AgentFactory: Your Agent Learns by Writing Code, Not Reflecting on Feelings

Zhang Zhang, Shuqi Lu, and colleagues propose AgentFactory, a self-evolution framework that preserves successful task solutions as executable Python subagent code rather than textual prompts or reflections. The logic is straightforward: text-based experience logs cannot reliably reproduce complex task execution. Code can. The framework runs a three-phase lifecycle — Install (build subagents from scratch), Self-Evolve (detect limitations and autonomously improve saved subagents), and Deploy (export mature subagents as standalone modules). Because all subagents are pure Python with standardized documentation, they port across any Python-capable system.

The connection to this week's coverage is direct. On Wednesday, we reported that in-context memory loses 60% of stored facts during compaction. AgentFactory sidesteps this problem entirely: the agent's accumulated knowledge lives as executable code outside the context window, not as facts inside it. The library grows and improves over time, progressively reducing effort for similar tasks without manual intervention. arXiv:2603.18000

If your agents accumulate experience as text reflections or prompt additions, you are storing capability in the most lossy format available. Executable code with standardized interfaces is provably more portable and reliable. Evaluate whether your agent's learning loop can produce reusable artifacts, not just better prompts.