FEP-Agent: Grounding LLM Agent Self-Evolution in Active Inference with Semantic Memory
Abstract
Enabling language model agents to autonomously adapt to new environments remains a fundamental challenge. While recent memory-augmented approaches have achieved promising results, they are largely heuristic in design and treat task execution and knowledge construction as decoupled processes. Inspired by how biological systems rapidly adapt through principled acting and learning, we propose \textbf{FEP-Agent}, a framework that grounds LLM agent self-evolution in the \textit{Free Energy Principle (FEP)}. Our system instantiates the two components of Active Inference into: a Worker agent that minimizes \textit{Expected Free Energy (EFE)} during online interaction, balancing goal-directed exploitation with curiosity-driven exploration to probe uncertain environmental dynamics; and a Builder agent that minimizes \textit{Variational Free Energy (VFE)} post-execution, updating a knowledge base while controlling complexity through counterfactual validation. To support scalable knowledge in open-ended environments, we introduce a structured semantic memory that employs associative linking and overlapping communities for efficient retrieval. The excellent results across multiple LLM-agent benchmarks demonstrate that FEP-Agent achieves principled, self-evolving systems.