Existing memory systems for LLM-based agents organize histories by semantic similarity, which fragments interdependent decision trajectories and mixes valid with erroneous traces. This mismatches the execution-state dependencies required for long-horizon tasks, where each action depends on cumulative prior steps.
MAGE (Memory as Agent-Guided Exploration) treats memory as a hierarchical state tree. The agent derives its state from the active root-to-current path, combining subgoal summaries, recent traces, and hints from prior branches. Four coupled operations—Grow, Compress, Maintain, and Revise—manage the tree to bound context growth while preserving state integrity and isolating flawed segments.
On the MemoryArena benchmark, MAGE improves average task success rate by 7.8–20.4 percentage points over baselines and reduces token consumption by 55.1%.